diff options
| -rw-r--r-- | src/librustc_mir/interpret/validation.rs | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/librustc_mir/interpret/validation.rs b/src/librustc_mir/interpret/validation.rs index a6c2871cf52..4454e21b1aa 100644 --- a/src/librustc_mir/interpret/validation.rs +++ b/src/librustc_mir/interpret/validation.rs @@ -42,18 +42,24 @@ impl<'a, 'tcx, M: Machine<'tcx>> EvalContext<'a, 'tcx, M> { // HACK: Determine if this method is whitelisted and hence we do not perform any validation. // We currently insta-UB on anything passing around uninitialized memory, so we have to whitelist // the places that are allowed to do that. + // The second group is stuff libstd does that is forbidden even under relaxed validation. { // The regexp we use for filtering use regex::Regex; lazy_static! { static ref RE: Regex = Regex::new("^(\ -std::mem::uninitialized::|\ -std::mem::forget::|\ -<std::heap::Heap as std::heap::Alloc>::|\ -<std::mem::ManuallyDrop<T>><.*>::new$|\ -<std::mem::ManuallyDrop<T> as std::ops::DerefMut><.*>::deref_mut$|\ -std::ptr::read::\ -)").unwrap(); + std::mem::uninitialized::|\ + std::mem::forget::|\ + <std::heap::Heap as std::heap::Alloc>::|\ + <std::mem::ManuallyDrop<T>><.*>::new$|\ + <std::mem::ManuallyDrop<T> as std::ops::DerefMut><.*>::deref_mut$|\ + std::ptr::read::|\ + \ + <std::sync::Arc<T>><.*>::inner$|\ + <std::sync::Arc<T>><.*>::drop_slow$|\ + std::heap::Layout::for_value::|\ + std::mem::(size|align)_of_val::\ + )").unwrap(); } // Now test let name = self.stack[self.cur_frame()].instance.to_string(); |
