Add mp4parse-rust patch to build with rust 1.70

Discovered as
8b5b652d38
apparently its commit summary "Fix unstable-name-collisions warning by using
fully qualified path" being completely unrelated to this confusing error
message:

    error[E0277]: the trait bound `u64: Mul<NonZeroU8>` is not satisfied
	--> /builddir/build/BUILD/thunderbird-102.11.1/third_party/rust/mp4parse/src/lib.rs:3188:62
	 |
    3188 |                 static_assertions::const_assert!(<$lhs>::MAX * <$rhs>::MAX <= <$output>::MAX);
	 |                                                              ^ no implementation for `u64 * NonZeroU8`
    ...
    3198 | 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
	--> /builddir/build/BUILD/thunderbird-102.11.1/third_party/rust/mp4parse/src/lib.rs:3198:1
	 |
    3198 | 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
	--> /builddir/build/BUILD/thunderbird-102.11.1/third_party/rust/mp4parse/src/lib.rs:3188:62
	 |
    3188 |                 static_assertions::const_assert!(<$lhs>::MAX * <$rhs>::MAX <= <$output>::MAX);
	 |                                                              ^ no implementation for `u64 * NonZeroU8`
    ...
    3199 | 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
	--> /builddir/build/BUILD/thunderbird-102.11.1/third_party/rust/mp4parse/src/lib.rs:3199:1
	 |
    3199 | 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
This commit is contained in:
Eike Rathke 2023-06-08 14:28:08 +02:00
parent 8ffd7f5713
commit 6ed875ba67
2 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,18 @@
--- thunderbird-102.11.1/third_party/rust/mp4parse/src/lib.rs.mp4parse-rust-8b5b652d38e007e736bb442ccd5aa5ed699db100 2023-05-24 00:50:52.000000000 +0200
+++ thunderbird-102.11.1/third_party/rust/mp4parse/src/lib.rs 2023-06-08 14:17:40.193695212 +0200
@@ -3184,8 +3184,13 @@ macro_rules! impl_mul {
type Output = $output;
fn mul(self, rhs: $rhs) -> Self::Output {
- static_assertions::const_assert!(<$output>::MAX <= <$inner>::MAX as u64);
- static_assertions::const_assert!(<$lhs>::MAX * <$rhs>::MAX <= <$output>::MAX);
+ static_assertions::const_assert!(
+ <$output as UpperBounded>::MAX <= <$inner>::MAX as u64
+ );
+ static_assertions::const_assert!(
+ <$lhs as UpperBounded>::MAX * <$rhs as UpperBounded>::MAX
+ <= <$output as UpperBounded>::MAX
+ );
let lhs: $inner = self.get().into();
let rhs: $inner = rhs.get().into();

View File

@ -140,6 +140,10 @@ Patch426: gcc13-header-dependencies.patch
# https://github.com/rust-lang/rust-bindgen/pull/2339
Patch427: rust-bindgen-2319-2339.patch
# Needed with rust 1.70
# https://github.com/mozilla/mp4parse-rust/commit/8b5b652d38e007e736bb442ccd5aa5ed699db100
Patch428: mp4parse-rust-8b5b652d38e007e736bb442ccd5aa5ed699db100.patch
# PPC fix
Patch304: mozilla-1245783.patch
@ -339,6 +343,8 @@ popd
# MUST ONLY be applied for building against clang LLVM 16.
# Would crash with earlier clang.
%patch -P 427 -p1 -b .rust-bindgen-2319-2339
# Needed with rust 1.70
%patch -P 428 -p1 -b .mp4parse-rust-8b5b652d38e007e736bb442ccd5aa5ed699db100
%endif
%patch -P 501 -p1 -b .expat-CVE-2022-25235