mozilla / mp4parse-rust

Parser for ISO Base Media Format aka video/mp4 written in Rust.
Mozilla Public License 2.0
404 stars 62 forks source link

mp4parse 0.12.0 fails to build with rust 1.70 #406

Closed tranzystorekk closed 1 year ago

tranzystorekk commented 1 year ago

Build error:

Compiling mp4parse v0.12.0 (/tmp/test-mp4parse/mp4parse-rust/mp4parse)
error[E0277]: the trait bound `u64: Mul<NonZeroU8>` is not satisfied
    --> mp4parse/src/lib.rs:2547:62
     |
2547 |                 static_assertions::const_assert!(<$lhs>::MAX * <$rhs>::MAX <= <$output>::MAX);
     |                                                              ^ no implementation for `u64 * NonZeroU8`
...
2557 | impl_mul!((U8, std::num::NonZeroU8) => (U16, u16));
     | -------------------------------------------------- in this macro invocation
     |
     = help: the trait `~const Mul<NonZeroU8>` is not implemented for `u64`
     = help: the following other types implement trait `Mul<Rhs>`:
               <&'a u64 as Mul<u64>>
               <&u64 as Mul<&u64>>
               <u64 as Mul<&u64>>
               <u64 as Mul>
     = note: this error originates in the macro `impl_mul` (in Nightly builds, run with -Z macro-backtrace for more info)

note: erroneous constant used
    --> mp4parse/src/lib.rs:2557:1
     |
2557 | impl_mul!((U8, std::num::NonZeroU8) => (U16, u16));
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = note: this note originates in the macro `static_assertions::const_assert` which comes from the expansion of the macro `impl_mul` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `u64: Mul<NonZeroU8>` is not satisfied
    --> mp4parse/src/lib.rs:2547:62
     |
2547 |                 static_assertions::const_assert!(<$lhs>::MAX * <$rhs>::MAX <= <$output>::MAX);
     |                                                              ^ no implementation for `u64 * NonZeroU8`
...
2558 | impl_mul!((U32, std::num::NonZeroU8) => (U32MulU8, u64));
     | -------------------------------------------------------- in this macro invocation
     |
     = help: the trait `~const Mul<NonZeroU8>` is not implemented for `u64`
     = help: the following other types implement trait `Mul<Rhs>`:
               <&'a u64 as Mul<u64>>
               <&u64 as Mul<&u64>>
               <u64 as Mul<&u64>>
               <u64 as Mul>
     = note: this error originates in the macro `impl_mul` (in Nightly builds, run with -Z macro-backtrace for more info)

note: erroneous constant used
    --> mp4parse/src/lib.rs:2558:1
     |
2558 | impl_mul!((U32, std::num::NonZeroU8) => (U32MulU8, u64));
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = note: this note originates in the macro `static_assertions::const_assert` which comes from the expansion of the macro `impl_mul` (in Nightly builds, run with -Z macro-backtrace for more info)

For more information about this error, try `rustc --explain E0277`.
error: could not compile `mp4parse` (lib) due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
kinetiknz commented 1 year ago

0.12.1 was released to fix this: https://github.com/mozilla/mp4parse-rust/issues/387