From 2940da9d1f22982b237cf7c64d7e9e5829397f88 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 20 Jun 2020 11:48:42 +0200 Subject: [PATCH] bump Rust --- rust-version | 2 +- .../{invalid_enum_discriminant.rs => invalid_enum_tag.rs} | 2 +- .../{invalid_enum_discriminant.rs => invalid_enum_tag.rs} | 2 +- tests/compile-fail/validity/transmute_through_ptr.rs | 4 ++-- tests/run-pass/panic/catch_panic.rs | 4 ++-- tests/run-pass/panic/catch_panic.stderr | 4 ++-- tests/run-pass/specialization.rs | 1 + 7 files changed, 10 insertions(+), 9 deletions(-) rename tests/compile-fail/{invalid_enum_discriminant.rs => invalid_enum_tag.rs} (85%) rename tests/compile-fail/validity/{invalid_enum_discriminant.rs => invalid_enum_tag.rs} (63%) diff --git a/rust-version b/rust-version index 342ec7486e6..f001577e7f0 100644 --- a/rust-version +++ b/rust-version @@ -1 +1 @@ -ff4a2533a0720f9cdd86e02eafa3725f07aa7752 +033013cab3a861224fd55f494c8be1cb0349eb49 diff --git a/tests/compile-fail/invalid_enum_discriminant.rs b/tests/compile-fail/invalid_enum_tag.rs similarity index 85% rename from tests/compile-fail/invalid_enum_discriminant.rs rename to tests/compile-fail/invalid_enum_tag.rs index 893dd03c64e..762a70d803a 100644 --- a/tests/compile-fail/invalid_enum_discriminant.rs +++ b/tests/compile-fail/invalid_enum_tag.rs @@ -2,7 +2,7 @@ // Make sure we find these even with many checks disabled. // compile-flags: -Zmiri-disable-alignment-check -Zmiri-disable-stacked-borrows -Zmiri-disable-validation -// error-pattern: enum value has invalid discriminant: 0x0000002a +// error-pattern: enum value has invalid tag: 0x0000002a use std::mem; diff --git a/tests/compile-fail/validity/invalid_enum_discriminant.rs b/tests/compile-fail/validity/invalid_enum_tag.rs similarity index 63% rename from tests/compile-fail/validity/invalid_enum_discriminant.rs rename to tests/compile-fail/validity/invalid_enum_tag.rs index a3234ba0920..897bfa90a70 100644 --- a/tests/compile-fail/validity/invalid_enum_discriminant.rs +++ b/tests/compile-fail/validity/invalid_enum_tag.rs @@ -4,5 +4,5 @@ pub enum Foo { } fn main() { - let _f = unsafe { std::mem::transmute::(42) }; //~ ERROR encountered 0x0000002a, but expected a valid enum discriminant + let _f = unsafe { std::mem::transmute::(42) }; //~ ERROR encountered 0x0000002a, but expected a valid enum tag } diff --git a/tests/compile-fail/validity/transmute_through_ptr.rs b/tests/compile-fail/validity/transmute_through_ptr.rs index 617781c1275..1d5cf16aa5e 100644 --- a/tests/compile-fail/validity/transmute_through_ptr.rs +++ b/tests/compile-fail/validity/transmute_through_ptr.rs @@ -3,12 +3,12 @@ enum Bool { True } fn evil(x: &mut Bool) { let x = x as *mut _ as *mut u32; - unsafe { *x = 44; } // out-of-bounds enum discriminant + unsafe { *x = 44; } // out-of-bounds enum tag } fn main() { let mut x = Bool::True; evil(&mut x); let _y = x; // reading this ought to be enough to trigger validation - //~^ ERROR encountered 0x0000002c, but expected a valid enum discriminant + //~^ ERROR encountered 0x0000002c, but expected a valid enum tag } diff --git a/tests/run-pass/panic/catch_panic.rs b/tests/run-pass/panic/catch_panic.rs index 7689b85f765..288ae1965a6 100644 --- a/tests/run-pass/panic/catch_panic.rs +++ b/tests/run-pass/panic/catch_panic.rs @@ -1,5 +1,5 @@ // ignore-windows: Unwind panicking does not currently work on Windows -// normalize-stderr-test "[^ ]*libcore/(macros|mem)/mod.rs[0-9:]*" -> "$$LOC" +// normalize-stderr-test "[^ ]*libcore/[a-z/]+.rs[0-9:]*" -> "$$LOC" #![feature(never_type)] #![allow(unconditional_panic)] use std::panic::{catch_unwind, AssertUnwindSafe}; @@ -75,7 +75,7 @@ fn main() { // Assertion and debug assertion test(None, |_old_val| { assert!(false); loop {} }); test(None, |_old_val| { debug_assert!(false); loop {} }); - test(None, |_old_val| { unsafe { (1 as *const i32).read() }; loop {} }); // trigger debug-assertion in libstd + test(None, |_old_val| { unsafe { std::char::from_u32_unchecked(0xFD10000); } loop {} }); // trigger debug-assertion in libstd eprintln!("Success!"); // Make sure we get this in stderr } diff --git a/tests/run-pass/panic/catch_panic.stderr b/tests/run-pass/panic/catch_panic.stderr index 6da9cd29963..f64ff118661 100644 --- a/tests/run-pass/panic/catch_panic.stderr +++ b/tests/run-pass/panic/catch_panic.stderr @@ -22,6 +22,6 @@ thread 'main' panicked at 'assertion failed: false', $DIR/catch_panic.rs:76:29 Caught panic message (&str): assertion failed: false thread 'main' panicked at 'assertion failed: false', $DIR/catch_panic.rs:77:29 Caught panic message (&str): assertion failed: false -thread 'main' panicked at 'attempt to copy from unaligned or null pointer', $LOC -Caught panic message (String): attempt to copy from unaligned or null pointer +thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', $LOC +Caught panic message (String): called `Option::unwrap()` on a `None` value Success! diff --git a/tests/run-pass/specialization.rs b/tests/run-pass/specialization.rs index 13894926d36..44cef00a22c 100644 --- a/tests/run-pass/specialization.rs +++ b/tests/run-pass/specialization.rs @@ -1,3 +1,4 @@ +#![allow(incomplete_features)] #![feature(specialization)] trait IsUnit {