From ac5bcd9b968560f74996da12f01dd484d3f9cc83 Mon Sep 17 00:00:00 2001 From: Ximin Luo Date: Thu, 6 Aug 2020 14:21:19 +0100 Subject: [PATCH] Add some more big-endian test patches --- debian/changelog | 6 ++ debian/patches/series | 2 + ...fed4c0bdc6d3246ea63a91f600bcb8874626.patch | 32 +++++++++++ ...a5ba3ee08171e7d2ff35d28ec0dd93b0287b.patch | 56 +++++++++++++++++++ debian/patches/u-ignore-endian.patch | 24 ++++++++ 5 files changed, 120 insertions(+) create mode 100644 debian/patches/u-1629fed4c0bdc6d3246ea63a91f600bcb8874626.patch create mode 100644 debian/patches/u-fb9fa5ba3ee08171e7d2ff35d28ec0dd93b0287b.patch diff --git a/debian/changelog b/debian/changelog index a079a55810..7f042b69af 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +rustc (1.45.0+dfsg1-2) UNRELEASED; urgency=medium + + * Add some more big-endian test patches. + + -- Ximin Luo Thu, 06 Aug 2020 14:21:07 +0100 + rustc (1.45.0+dfsg1-1) unstable; urgency=medium * Upload to unstable. diff --git a/debian/patches/series b/debian/patches/series index 7a8febc3f7..9092a537b9 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -8,6 +8,8 @@ u-mips-fixes.diff #u-allow-system-compiler-rt.patch u-fix-exec.patch u-ignore-endian.patch +u-fb9fa5ba3ee08171e7d2ff35d28ec0dd93b0287b.patch +u-1629fed4c0bdc6d3246ea63a91f600bcb8874626.patch # not forwarded, or forwarded but unlikely to be merged u-rustc-llvm-cross-flags.patch diff --git a/debian/patches/u-1629fed4c0bdc6d3246ea63a91f600bcb8874626.patch b/debian/patches/u-1629fed4c0bdc6d3246ea63a91f600bcb8874626.patch new file mode 100644 index 0000000000..28093009c5 --- /dev/null +++ b/debian/patches/u-1629fed4c0bdc6d3246ea63a91f600bcb8874626.patch @@ -0,0 +1,32 @@ +From 1629fed4c0bdc6d3246ea63a91f600bcb8874626 Mon Sep 17 00:00:00 2001 +From: Yuki Okushi +Date: Fri, 31 Jul 2020 09:03:14 +0900 +Subject: [PATCH] Presort restrictions to make output consistent + +--- + src/librustc_typeck/check/method/suggest.rs | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/src/librustc_typeck/check/method/suggest.rs b/src/librustc_typeck/check/method/suggest.rs +index ae2cf6daf5350..e69102d1995d3 100644 +--- a/src/librustc_typeck/check/method/suggest.rs ++++ b/src/librustc_typeck/check/method/suggest.rs +@@ -678,6 +678,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { + .collect::>(); + for ((span, empty_where), obligations) in type_params.into_iter() { + restrict_type_params = true; ++ // #74886: Sort here so that the output is always the same. ++ let mut obligations = obligations.into_iter().collect::>(); ++ obligations.sort(); + err.span_suggestion_verbose( + span, + &format!( +@@ -688,7 +691,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { + format!( + "{} {}", + if empty_where { " where" } else { "," }, +- obligations.into_iter().collect::>().join(", ") ++ obligations.join(", ") + ), + Applicability::MaybeIncorrect, + ); diff --git a/debian/patches/u-fb9fa5ba3ee08171e7d2ff35d28ec0dd93b0287b.patch b/debian/patches/u-fb9fa5ba3ee08171e7d2ff35d28ec0dd93b0287b.patch new file mode 100644 index 0000000000..5310b23f68 --- /dev/null +++ b/debian/patches/u-fb9fa5ba3ee08171e7d2ff35d28ec0dd93b0287b.patch @@ -0,0 +1,56 @@ +From fb9fa5ba3ee08171e7d2ff35d28ec0dd93b0287b Mon Sep 17 00:00:00 2001 +From: Ralf Jung +Date: Fri, 3 Jul 2020 12:12:50 +0200 +Subject: [PATCH] adjust ub-enum test to be endianess-independent + +--- + src/test/ui/consts/const-eval/ub-enum.rs | 5 +++-- + src/test/ui/consts/const-eval/ub-enum.stderr | 12 ++++++------ + 2 files changed, 9 insertions(+), 8 deletions(-) + +diff --git a/src/test/ui/consts/const-eval/ub-enum.rs b/src/test/ui/consts/const-eval/ub-enum.rs +index c49997c6c33f6..136b33208c293 100644 +--- a/src/test/ui/consts/const-eval/ub-enum.rs ++++ b/src/test/ui/consts/const-eval/ub-enum.rs +@@ -88,9 +88,10 @@ const BAD_OPTION_CHAR: Option<(char, char)> = Some(('x', unsafe { mem::transmute + //~^ ERROR is undefined behavior + + // All variants are uninhabited but also have data. +-const BAD_UNINHABITED_WITH_DATA1: Result<(i32, Never), (i32, !)> = unsafe { mem::transmute(1u64) }; ++// Use `0` as constant to make behavior endianess-independent. ++const BAD_UNINHABITED_WITH_DATA1: Result<(i32, Never), (i32, !)> = unsafe { mem::transmute(0u64) }; + //~^ ERROR is undefined behavior +-const BAD_UNINHABITED_WITH_DATA2: Result<(i32, !), (i32, Never)> = unsafe { mem::transmute(1u64) }; ++const BAD_UNINHABITED_WITH_DATA2: Result<(i32, !), (i32, Never)> = unsafe { mem::transmute(0u64) }; + //~^ ERROR is undefined behavior + + fn main() { +diff --git a/src/test/ui/consts/const-eval/ub-enum.stderr b/src/test/ui/consts/const-eval/ub-enum.stderr +index 1f7593c6db9b6..9c29aa1a51d1c 100644 +--- a/src/test/ui/consts/const-eval/ub-enum.stderr ++++ b/src/test/ui/consts/const-eval/ub-enum.stderr +@@ -87,18 +87,18 @@ LL | const BAD_OPTION_CHAR: Option<(char, char)> = Some(('x', unsafe { mem::tran + = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. + + error[E0080]: it is undefined behavior to use this value +- --> $DIR/ub-enum.rs:91:1 ++ --> $DIR/ub-enum.rs:92:1 + | +-LL | const BAD_UNINHABITED_WITH_DATA1: Result<(i32, Never), (i32, !)> = unsafe { mem::transmute(1u64) }; +- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a value of the never type `!` at ..0.1 ++LL | const BAD_UNINHABITED_WITH_DATA1: Result<(i32, Never), (i32, !)> = unsafe { mem::transmute(0u64) }; ++ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a value of uninhabited type Never at ..0.1 + | + = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. + + error[E0080]: it is undefined behavior to use this value +- --> $DIR/ub-enum.rs:93:1 ++ --> $DIR/ub-enum.rs:94:1 + | +-LL | const BAD_UNINHABITED_WITH_DATA2: Result<(i32, !), (i32, Never)> = unsafe { mem::transmute(1u64) }; +- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a value of uninhabited type Never at ..0.1 ++LL | const BAD_UNINHABITED_WITH_DATA2: Result<(i32, !), (i32, Never)> = unsafe { mem::transmute(0u64) }; ++ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a value of the never type `!` at ..0.1 + | + = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. + diff --git a/debian/patches/u-ignore-endian.patch b/debian/patches/u-ignore-endian.patch index 288cc3fe0f..7c539f49f4 100644 --- a/debian/patches/u-ignore-endian.patch +++ b/debian/patches/u-ignore-endian.patch @@ -94,3 +94,27 @@ // EMIT_MIR rustc.main.Inline.diff fn main() { let _x: Box> = box Vec::new(); +--- a/src/test/ui/simd/simd-intrinsic-generic-bitmask.rs ++++ b/src/test/ui/simd/simd-intrinsic-generic-bitmask.rs +@@ -2,6 +2,7 @@ + #![allow(non_camel_case_types)] + + // ignore-emscripten ++// ignore-endian-big behavior of simd_bitmask is endian-specific + + // Test that the simd_bitmask intrinsic produces correct results. + +--- a/src/test/ui/simd/simd-intrinsic-generic-select.rs ++++ b/src/test/ui/simd/simd-intrinsic-generic-select.rs +@@ -2,10 +2,7 @@ + #![allow(non_camel_case_types)] + + // ignore-emscripten +-// ignore-mips behavior of simd_select_bitmask is endian-specific +-// ignore-mips64 behavior of simd_select_bitmask is endian-specific +-// ignore-powerpc behavior of simd_select_bitmask is endian-specific +-// ignore-powerpc64 behavior of simd_select_bitmask is endian-specific ++// ignore-endian-big behavior of simd_select_bitmask is endian-specific + + // Test that the simd_select intrinsics produces correct results. +