From c6fd750d7d583748a85b306a3ef768589e0fe6dc Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Thu, 4 Aug 2022 14:21:27 +0000 Subject: [PATCH] Don't trim paths when printing const eval frame --- .../src/interpret/eval_context.rs | 3 ++- .../generic_const_exprs/issue-80742.stderr | 8 +++---- .../const-ptr/forbidden_slices.64bit.stderr | 24 +++++++++---------- .../ui/const-ptr/out_of_bounds_read.stderr | 10 ++++---- .../const-float-bits-reject-conv.stderr | 16 ++++++------- .../consts/const_unsafe_unreachable_ub.stderr | 2 +- src/test/ui/consts/issue-100114.rs | 15 ++++++++++++ src/test/ui/consts/issue-100114.stderr | 22 +++++++++++++++++ src/test/ui/consts/issue-miri-1910.stderr | 4 ++-- .../consts/miri_unleashed/assoc_const.stderr | 6 ++--- src/test/ui/consts/miri_unleashed/drop.stderr | 2 +- src/test/ui/consts/offset_from_ub.stderr | 6 ++--- src/test/ui/consts/offset_ub.stderr | 24 +++++++++---------- src/test/ui/consts/ptr_comparisons.stderr | 2 +- 14 files changed, 91 insertions(+), 53 deletions(-) create mode 100644 src/test/ui/consts/issue-100114.rs create mode 100644 src/test/ui/consts/issue-100114.stderr diff --git a/compiler/rustc_const_eval/src/interpret/eval_context.rs b/compiler/rustc_const_eval/src/interpret/eval_context.rs index 150d6589b0807..27537c8ad557b 100644 --- a/compiler/rustc_const_eval/src/interpret/eval_context.rs +++ b/compiler/rustc_const_eval/src/interpret/eval_context.rs @@ -10,6 +10,7 @@ use rustc_middle::ty::layout::{ self, FnAbiError, FnAbiOfHelpers, FnAbiRequest, LayoutError, LayoutOf, LayoutOfHelpers, TyAndLayout, }; +use rustc_middle::ty::print::with_no_trimmed_paths; use rustc_middle::ty::{ self, query::TyCtxtAt, subst::SubstsRef, ParamEnv, Ty, TyCtxt, TypeFoldable, }; @@ -261,7 +262,7 @@ impl<'tcx> fmt::Display for FrameInfo<'tcx> { { write!(f, "inside closure")?; } else { - write!(f, "inside `{}`", self.instance)?; + with_no_trimmed_paths!(write!(f, "inside `{}`", self.instance))?; } if !self.span.is_dummy() { let sm = tcx.sess.source_map(); diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-80742.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-80742.stderr index 1b502642eb7d0..3436791fdfc4c 100644 --- a/src/test/ui/const-generics/generic_const_exprs/issue-80742.stderr +++ b/src/test/ui/const-generics/generic_const_exprs/issue-80742.stderr @@ -5,12 +5,12 @@ LL | intrinsics::size_of::() | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | size_of called on unsized type `dyn Debug` - | inside `std::mem::size_of::` at $SRC_DIR/core/src/mem/mod.rs:LL:COL + | inside `std::mem::size_of::` at $SRC_DIR/core/src/mem/mod.rs:LL:COL | ::: $DIR/issue-80742.rs:22:10 | LL | [u8; size_of::() + 1]: , - | -------------- inside `Inline::::{constant#0}` at $DIR/issue-80742.rs:22:10 + | -------------- inside `Inline::::{constant#0}` at $DIR/issue-80742.rs:22:10 error[E0599]: the function or associated item `new` exists for struct `Inline`, but its trait bounds were not satisfied --> $DIR/issue-80742.rs:30:36 @@ -36,12 +36,12 @@ LL | intrinsics::size_of::() | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | size_of called on unsized type `dyn Debug` - | inside `std::mem::size_of::` at $SRC_DIR/core/src/mem/mod.rs:LL:COL + | inside `std::mem::size_of::` at $SRC_DIR/core/src/mem/mod.rs:LL:COL | ::: $DIR/issue-80742.rs:14:10 | LL | [u8; size_of::() + 1]: , - | -------------- inside `Inline::::{constant#0}` at $DIR/issue-80742.rs:14:10 + | -------------- inside `Inline::::{constant#0}` at $DIR/issue-80742.rs:14:10 error[E0277]: the size for values of type `dyn Debug` cannot be known at compilation time --> $DIR/issue-80742.rs:30:15 diff --git a/src/test/ui/const-ptr/forbidden_slices.64bit.stderr b/src/test/ui/const-ptr/forbidden_slices.64bit.stderr index 5f2821a91937b..8cd8db5a16fd1 100644 --- a/src/test/ui/const-ptr/forbidden_slices.64bit.stderr +++ b/src/test/ui/const-ptr/forbidden_slices.64bit.stderr @@ -105,12 +105,12 @@ LL | unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | out-of-bounds offset_from: null pointer is a dangling pointer (it has no provenance) - | inside `ptr::const_ptr::::sub_ptr` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL + | inside `std::ptr::const_ptr::::sub_ptr` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | ::: $SRC_DIR/core/src/slice/raw.rs:LL:COL | LL | unsafe { from_raw_parts(range.start, range.end.sub_ptr(range.start)) } - | ------------------------------ inside `from_ptr_range::` at $SRC_DIR/core/src/slice/raw.rs:LL:COL + | ------------------------------ inside `std::slice::from_ptr_range::` at $SRC_DIR/core/src/slice/raw.rs:LL:COL | ::: $DIR/forbidden_slices.rs:46:34 | @@ -124,12 +124,12 @@ LL | assert!(0 < pointee_size && pointee_size <= isize::MAX as usize); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | the evaluated program panicked at 'assertion failed: 0 < pointee_size && pointee_size <= isize::MAX as usize', $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | inside `ptr::const_ptr::::sub_ptr` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL + | inside `std::ptr::const_ptr::::sub_ptr` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | ::: $SRC_DIR/core/src/slice/raw.rs:LL:COL | LL | unsafe { from_raw_parts(range.start, range.end.sub_ptr(range.start)) } - | ------------------------------ inside `from_ptr_range::<()>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL + | ------------------------------ inside `std::slice::from_ptr_range::<()>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL | ::: $DIR/forbidden_slices.rs:47:33 | @@ -145,10 +145,10 @@ LL | unsafe { intrinsics::offset(self, count) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | out-of-bounds pointer arithmetic: ALLOC_ID has size 4, so pointer to 8 bytes starting at offset 0 is out-of-bounds - | inside `ptr::const_ptr::::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL + | inside `std::ptr::const_ptr::::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL ... LL | unsafe { self.offset(count as isize) } - | --------------------------- inside `ptr::const_ptr::::add` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL + | --------------------------- inside `std::ptr::const_ptr::::add` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | ::: $DIR/forbidden_slices.rs:50:25 | @@ -206,10 +206,10 @@ LL | unsafe { intrinsics::offset(self, count) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | out-of-bounds pointer arithmetic: ALLOC_ID has size 8, so pointer to 8 bytes starting at offset 1 is out-of-bounds - | inside `ptr::const_ptr::::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL + | inside `std::ptr::const_ptr::::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL ... LL | unsafe { self.offset(count as isize) } - | --------------------------- inside `ptr::const_ptr::::add` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL + | --------------------------- inside `std::ptr::const_ptr::::add` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | ::: $DIR/forbidden_slices.rs:74:25 | @@ -223,12 +223,12 @@ LL | unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | `ptr_offset_from_unsigned` called on pointers into different allocations - | inside `ptr::const_ptr::::sub_ptr` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL + | inside `std::ptr::const_ptr::::sub_ptr` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | ::: $SRC_DIR/core/src/slice/raw.rs:LL:COL | LL | unsafe { from_raw_parts(range.start, range.end.sub_ptr(range.start)) } - | ------------------------------ inside `from_ptr_range::` at $SRC_DIR/core/src/slice/raw.rs:LL:COL + | ------------------------------ inside `std::slice::from_ptr_range::` at $SRC_DIR/core/src/slice/raw.rs:LL:COL | ::: $DIR/forbidden_slices.rs:79:34 | @@ -242,12 +242,12 @@ LL | unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | `ptr_offset_from_unsigned` called on pointers into different allocations - | inside `ptr::const_ptr::::sub_ptr` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL + | inside `std::ptr::const_ptr::::sub_ptr` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | ::: $SRC_DIR/core/src/slice/raw.rs:LL:COL | LL | unsafe { from_raw_parts(range.start, range.end.sub_ptr(range.start)) } - | ------------------------------ inside `from_ptr_range::` at $SRC_DIR/core/src/slice/raw.rs:LL:COL + | ------------------------------ inside `std::slice::from_ptr_range::` at $SRC_DIR/core/src/slice/raw.rs:LL:COL | ::: $DIR/forbidden_slices.rs:80:35 | diff --git a/src/test/ui/const-ptr/out_of_bounds_read.stderr b/src/test/ui/const-ptr/out_of_bounds_read.stderr index 52b173c4d04a8..40389675f5cde 100644 --- a/src/test/ui/const-ptr/out_of_bounds_read.stderr +++ b/src/test/ui/const-ptr/out_of_bounds_read.stderr @@ -10,7 +10,7 @@ LL | copy_nonoverlapping(src, tmp.as_mut_ptr(), 1); ::: $DIR/out_of_bounds_read.rs:12:33 | LL | const _READ: u32 = unsafe { ptr::read(PAST_END_PTR) }; - | ----------------------- inside `_READ` at $DIR/out_of_bounds_read.rs:12:33 + | ----------------------- inside `main::_READ` at $DIR/out_of_bounds_read.rs:12:33 error[E0080]: evaluation of constant value failed --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL @@ -24,12 +24,12 @@ LL | copy_nonoverlapping(src, tmp.as_mut_ptr(), 1); ::: $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | LL | unsafe { read(self) } - | ---------- inside `ptr::const_ptr::::read` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL + | ---------- inside `std::ptr::const_ptr::::read` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | ::: $DIR/out_of_bounds_read.rs:13:39 | LL | const _CONST_READ: u32 = unsafe { PAST_END_PTR.read() }; - | ------------------- inside `_CONST_READ` at $DIR/out_of_bounds_read.rs:13:39 + | ------------------- inside `main::_CONST_READ` at $DIR/out_of_bounds_read.rs:13:39 error[E0080]: evaluation of constant value failed --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL @@ -43,12 +43,12 @@ LL | copy_nonoverlapping(src, tmp.as_mut_ptr(), 1); ::: $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL | LL | unsafe { read(self) } - | ---------- inside `ptr::mut_ptr::::read` at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL + | ---------- inside `std::ptr::mut_ptr::::read` at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL | ::: $DIR/out_of_bounds_read.rs:14:37 | LL | const _MUT_READ: u32 = unsafe { (PAST_END_PTR as *mut u32).read() }; - | --------------------------------- inside `_MUT_READ` at $DIR/out_of_bounds_read.rs:14:37 + | --------------------------------- inside `main::_MUT_READ` at $DIR/out_of_bounds_read.rs:14:37 error: aborting due to 3 previous errors diff --git a/src/test/ui/consts/const-float-bits-reject-conv.stderr b/src/test/ui/consts/const-float-bits-reject-conv.stderr index d6e993a10101d..554261cd21989 100644 --- a/src/test/ui/consts/const-float-bits-reject-conv.stderr +++ b/src/test/ui/consts/const-float-bits-reject-conv.stderr @@ -13,12 +13,12 @@ LL | unsafe { intrinsics::const_eval_select((self,), ct_f32_to_u32, rt_f ::: $SRC_DIR/core/src/ops/function.rs:LL:COL | LL | extern "rust-call" fn call_once(self, args: Args) -> Self::Output; - | ------------------------------------------------------------------ inside ` u32 {core::f32::::to_bits::ct_f32_to_u32} as FnOnce<(f32,)>>::call_once - shim(fn(f32) -> u32 {core::f32::::to_bits::ct_f32_to_u32})` at $SRC_DIR/core/src/ops/function.rs:LL:COL + | ------------------------------------------------------------------ inside ` u32 {core::f32::::to_bits::ct_f32_to_u32} as std::ops::FnOnce<(f32,)>>::call_once - shim(fn(f32) -> u32 {core::f32::::to_bits::ct_f32_to_u32})` at $SRC_DIR/core/src/ops/function.rs:LL:COL | ::: $SRC_DIR/core/src/intrinsics.rs:LL:COL | LL | called_in_const.call_once(arg) - | ------------------------------ inside `const_eval_select::<(f32,), fn(f32) -> u32 {core::f32::::to_bits::ct_f32_to_u32}, [closure@core::f32::::to_bits::{closure#0}], u32>` at $SRC_DIR/core/src/intrinsics.rs:LL:COL + | ------------------------------ inside `std::intrinsics::const_eval_select::<(f32,), fn(f32) -> u32 {core::f32::::to_bits::ct_f32_to_u32}, [closure@core::f32::::to_bits::{closure#0}], u32>` at $SRC_DIR/core/src/intrinsics.rs:LL:COL | ::: $DIR/const-float-bits-reject-conv.rs:27:30 | @@ -42,12 +42,12 @@ LL | unsafe { intrinsics::const_eval_select((self,), ct_f32_to_u32, rt_f ::: $SRC_DIR/core/src/ops/function.rs:LL:COL | LL | extern "rust-call" fn call_once(self, args: Args) -> Self::Output; - | ------------------------------------------------------------------ inside ` u32 {core::f32::::to_bits::ct_f32_to_u32} as FnOnce<(f32,)>>::call_once - shim(fn(f32) -> u32 {core::f32::::to_bits::ct_f32_to_u32})` at $SRC_DIR/core/src/ops/function.rs:LL:COL + | ------------------------------------------------------------------ inside ` u32 {core::f32::::to_bits::ct_f32_to_u32} as std::ops::FnOnce<(f32,)>>::call_once - shim(fn(f32) -> u32 {core::f32::::to_bits::ct_f32_to_u32})` at $SRC_DIR/core/src/ops/function.rs:LL:COL | ::: $SRC_DIR/core/src/intrinsics.rs:LL:COL | LL | called_in_const.call_once(arg) - | ------------------------------ inside `const_eval_select::<(f32,), fn(f32) -> u32 {core::f32::::to_bits::ct_f32_to_u32}, [closure@core::f32::::to_bits::{closure#0}], u32>` at $SRC_DIR/core/src/intrinsics.rs:LL:COL + | ------------------------------ inside `std::intrinsics::const_eval_select::<(f32,), fn(f32) -> u32 {core::f32::::to_bits::ct_f32_to_u32}, [closure@core::f32::::to_bits::{closure#0}], u32>` at $SRC_DIR/core/src/intrinsics.rs:LL:COL | ::: $DIR/const-float-bits-reject-conv.rs:28:30 | @@ -120,12 +120,12 @@ LL | unsafe { intrinsics::const_eval_select((self,), ct_f64_to_u64, rt_f ::: $SRC_DIR/core/src/ops/function.rs:LL:COL | LL | extern "rust-call" fn call_once(self, args: Args) -> Self::Output; - | ------------------------------------------------------------------ inside ` u64 {core::f64::::to_bits::ct_f64_to_u64} as FnOnce<(f64,)>>::call_once - shim(fn(f64) -> u64 {core::f64::::to_bits::ct_f64_to_u64})` at $SRC_DIR/core/src/ops/function.rs:LL:COL + | ------------------------------------------------------------------ inside ` u64 {core::f64::::to_bits::ct_f64_to_u64} as std::ops::FnOnce<(f64,)>>::call_once - shim(fn(f64) -> u64 {core::f64::::to_bits::ct_f64_to_u64})` at $SRC_DIR/core/src/ops/function.rs:LL:COL | ::: $SRC_DIR/core/src/intrinsics.rs:LL:COL | LL | called_in_const.call_once(arg) - | ------------------------------ inside `const_eval_select::<(f64,), fn(f64) -> u64 {core::f64::::to_bits::ct_f64_to_u64}, [closure@core::f64::::to_bits::{closure#0}], u64>` at $SRC_DIR/core/src/intrinsics.rs:LL:COL + | ------------------------------ inside `std::intrinsics::const_eval_select::<(f64,), fn(f64) -> u64 {core::f64::::to_bits::ct_f64_to_u64}, [closure@core::f64::::to_bits::{closure#0}], u64>` at $SRC_DIR/core/src/intrinsics.rs:LL:COL | ::: $DIR/const-float-bits-reject-conv.rs:54:30 | @@ -149,12 +149,12 @@ LL | unsafe { intrinsics::const_eval_select((self,), ct_f64_to_u64, rt_f ::: $SRC_DIR/core/src/ops/function.rs:LL:COL | LL | extern "rust-call" fn call_once(self, args: Args) -> Self::Output; - | ------------------------------------------------------------------ inside ` u64 {core::f64::::to_bits::ct_f64_to_u64} as FnOnce<(f64,)>>::call_once - shim(fn(f64) -> u64 {core::f64::::to_bits::ct_f64_to_u64})` at $SRC_DIR/core/src/ops/function.rs:LL:COL + | ------------------------------------------------------------------ inside ` u64 {core::f64::::to_bits::ct_f64_to_u64} as std::ops::FnOnce<(f64,)>>::call_once - shim(fn(f64) -> u64 {core::f64::::to_bits::ct_f64_to_u64})` at $SRC_DIR/core/src/ops/function.rs:LL:COL | ::: $SRC_DIR/core/src/intrinsics.rs:LL:COL | LL | called_in_const.call_once(arg) - | ------------------------------ inside `const_eval_select::<(f64,), fn(f64) -> u64 {core::f64::::to_bits::ct_f64_to_u64}, [closure@core::f64::::to_bits::{closure#0}], u64>` at $SRC_DIR/core/src/intrinsics.rs:LL:COL + | ------------------------------ inside `std::intrinsics::const_eval_select::<(f64,), fn(f64) -> u64 {core::f64::::to_bits::ct_f64_to_u64}, [closure@core::f64::::to_bits::{closure#0}], u64>` at $SRC_DIR/core/src/intrinsics.rs:LL:COL | ::: $DIR/const-float-bits-reject-conv.rs:55:30 | diff --git a/src/test/ui/consts/const_unsafe_unreachable_ub.stderr b/src/test/ui/consts/const_unsafe_unreachable_ub.stderr index ec6ce1f5d7c08..97f921018f5f7 100644 --- a/src/test/ui/consts/const_unsafe_unreachable_ub.stderr +++ b/src/test/ui/consts/const_unsafe_unreachable_ub.stderr @@ -5,7 +5,7 @@ LL | unsafe { intrinsics::unreachable() } | ^^^^^^^^^^^^^^^^^^^^^^^^^ | | | entering unreachable code - | inside `unreachable_unchecked` at $SRC_DIR/core/src/hint.rs:LL:COL + | inside `std::hint::unreachable_unchecked` at $SRC_DIR/core/src/hint.rs:LL:COL | ::: $DIR/const_unsafe_unreachable_ub.rs:6:18 | diff --git a/src/test/ui/consts/issue-100114.rs b/src/test/ui/consts/issue-100114.rs new file mode 100644 index 0000000000000..139602403135a --- /dev/null +++ b/src/test/ui/consts/issue-100114.rs @@ -0,0 +1,15 @@ +// check-pass + +#![allow(warnings)] +#![feature(never_type)] +#![allow(const_err)] + +use std::mem::MaybeUninit; + +const fn never() -> ! { + unsafe { MaybeUninit::uninit().assume_init() } +} + +const NEVER: ! = never(); + +fn main() {} diff --git a/src/test/ui/consts/issue-100114.stderr b/src/test/ui/consts/issue-100114.stderr new file mode 100644 index 0000000000000..e5087627a0a1c --- /dev/null +++ b/src/test/ui/consts/issue-100114.stderr @@ -0,0 +1,22 @@ +Future incompatibility report: Future breakage diagnostic: +warning: any use of this value will cause an error + --> $DIR/issue-100114.rs:10:14 + | +LL | unsafe { MaybeUninit::uninit().assume_init() } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | | + | aborted execution: attempted to instantiate uninhabited type `!` + | inside `never` at $DIR/issue-100114.rs:10:14 + | inside `NEVER` at $DIR/issue-100114.rs:13:18 +... +LL | const NEVER: ! = never(); + | -------------- + | +note: the lint level is defined here + --> $DIR/issue-100114.rs:5:10 + | +LL | #![allow(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/issue-miri-1910.stderr b/src/test/ui/consts/issue-miri-1910.stderr index afcf11bd5f247..b3ddd8a5761a7 100644 --- a/src/test/ui/consts/issue-miri-1910.stderr +++ b/src/test/ui/consts/issue-miri-1910.stderr @@ -6,7 +6,7 @@ LL | copy_nonoverlapping(src, tmp.as_mut_ptr(), 1); | | | unable to turn pointer into raw bytes | inside `std::ptr::read::` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL - | inside `ptr::const_ptr::::read` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL + | inside `std::ptr::const_ptr::::read` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | inside `C` at $DIR/issue-miri-1910.rs:7:5 | ::: $DIR/issue-miri-1910.rs:4:1 @@ -29,7 +29,7 @@ LL | copy_nonoverlapping(src, tmp.as_mut_ptr(), 1); | | | unable to turn pointer into raw bytes | inside `std::ptr::read::` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL - | inside `ptr::const_ptr::::read` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL + | inside `std::ptr::const_ptr::::read` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | inside `C` at $DIR/issue-miri-1910.rs:7:5 | ::: $DIR/issue-miri-1910.rs:4:1 diff --git a/src/test/ui/consts/miri_unleashed/assoc_const.stderr b/src/test/ui/consts/miri_unleashed/assoc_const.stderr index 1f82ac827ad1d..8c5c19a01fe4c 100644 --- a/src/test/ui/consts/miri_unleashed/assoc_const.stderr +++ b/src/test/ui/consts/miri_unleashed/assoc_const.stderr @@ -23,9 +23,9 @@ LL | pub unsafe fn drop_in_place(to_drop: *mut T) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | calling non-const function ` as Drop>::drop` - | inside `std::ptr::drop_in_place::> - shim(Some(Vec))` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL - | inside `std::ptr::drop_in_place::<(Vec, u32)> - shim(Some((Vec, u32)))` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL - | inside `, String>>::F` at $DIR/assoc_const.rs:14:31 + | inside `std::ptr::drop_in_place::> - shim(Some(std::vec::Vec))` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL + | inside `std::ptr::drop_in_place::<(std::vec::Vec, u32)> - shim(Some((std::vec::Vec, u32)))` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL + | inside `, std::string::String>>::F` at $DIR/assoc_const.rs:14:31 | ::: $DIR/assoc_const.rs:14:5 | diff --git a/src/test/ui/consts/miri_unleashed/drop.stderr b/src/test/ui/consts/miri_unleashed/drop.stderr index 36db6b7865af2..6946a680c776b 100644 --- a/src/test/ui/consts/miri_unleashed/drop.stderr +++ b/src/test/ui/consts/miri_unleashed/drop.stderr @@ -5,7 +5,7 @@ LL | pub unsafe fn drop_in_place(to_drop: *mut T) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | calling non-const function ` as Drop>::drop` - | inside `std::ptr::drop_in_place::> - shim(Some(Vec))` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL + | inside `std::ptr::drop_in_place::> - shim(Some(std::vec::Vec))` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL | ::: $DIR/drop.rs:18:1 | diff --git a/src/test/ui/consts/offset_from_ub.stderr b/src/test/ui/consts/offset_from_ub.stderr index 62a087d94d356..0a5fb886c8613 100644 --- a/src/test/ui/consts/offset_from_ub.stderr +++ b/src/test/ui/consts/offset_from_ub.stderr @@ -11,7 +11,7 @@ LL | unsafe { intrinsics::ptr_offset_from(self, origin) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | `ptr_offset_from` called on pointers into different allocations - | inside `ptr::const_ptr::::offset_from` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL + | inside `std::ptr::const_ptr::::offset_from` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | ::: $DIR/offset_from_ub.rs:24:14 | @@ -91,7 +91,7 @@ LL | unsafe { intrinsics::ptr_offset_from(self, origin) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | out-of-bounds offset_from: null pointer is a dangling pointer (it has no provenance) - | inside `ptr::const_ptr::::offset_from` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL + | inside `std::ptr::const_ptr::::offset_from` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | ::: $DIR/offset_from_ub.rs:115:14 | @@ -105,7 +105,7 @@ LL | unsafe { intrinsics::ptr_offset_from(self, origin) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | out-of-bounds offset_from: null pointer is a dangling pointer (it has no provenance) - | inside `ptr::const_ptr::::offset_from` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL + | inside `std::ptr::const_ptr::::offset_from` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | ::: $DIR/offset_from_ub.rs:121:14 | diff --git a/src/test/ui/consts/offset_ub.stderr b/src/test/ui/consts/offset_ub.stderr index 5a792bba50cb2..0417890d17e86 100644 --- a/src/test/ui/consts/offset_ub.stderr +++ b/src/test/ui/consts/offset_ub.stderr @@ -5,7 +5,7 @@ LL | unsafe { intrinsics::offset(self, count) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | overflowing in-bounds pointer arithmetic - | inside `ptr::const_ptr::::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL + | inside `std::ptr::const_ptr::::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | ::: $DIR/offset_ub.rs:7:46 | @@ -19,7 +19,7 @@ LL | unsafe { intrinsics::offset(self, count) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | out-of-bounds pointer arithmetic: allocN has size 1, so pointer to 2 bytes starting at offset 0 is out-of-bounds - | inside `ptr::const_ptr::::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL + | inside `std::ptr::const_ptr::::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | ::: $DIR/offset_ub.rs:8:43 | @@ -33,7 +33,7 @@ LL | unsafe { intrinsics::offset(self, count) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | out-of-bounds pointer arithmetic: allocN has size 100, so pointer to 101 bytes starting at offset 0 is out-of-bounds - | inside `ptr::const_ptr::::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL + | inside `std::ptr::const_ptr::::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | ::: $DIR/offset_ub.rs:9:45 | @@ -47,7 +47,7 @@ LL | unsafe { intrinsics::offset(self, count) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | overflowing in-bounds pointer arithmetic - | inside `ptr::const_ptr::::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL + | inside `std::ptr::const_ptr::::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | ::: $DIR/offset_ub.rs:11:43 | @@ -61,7 +61,7 @@ LL | unsafe { intrinsics::offset(self, count) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | overflowing in-bounds pointer arithmetic - | inside `ptr::const_ptr::::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL + | inside `std::ptr::const_ptr::::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | ::: $DIR/offset_ub.rs:12:44 | @@ -75,7 +75,7 @@ LL | unsafe { intrinsics::offset(self, count) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | overflowing in-bounds pointer arithmetic - | inside `ptr::const_ptr::::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL + | inside `std::ptr::const_ptr::::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | ::: $DIR/offset_ub.rs:13:56 | @@ -89,7 +89,7 @@ LL | unsafe { intrinsics::offset(self, count) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | overflowing in-bounds pointer arithmetic - | inside `ptr::const_ptr::::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL + | inside `std::ptr::const_ptr::::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | ::: $DIR/offset_ub.rs:14:57 | @@ -103,7 +103,7 @@ LL | unsafe { intrinsics::offset(self, count) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | out-of-bounds pointer arithmetic: allocN has size 1, so pointer to 2 bytes starting at offset -4 is out-of-bounds - | inside `ptr::const_ptr::::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL + | inside `std::ptr::const_ptr::::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | ::: $DIR/offset_ub.rs:15:49 | @@ -117,7 +117,7 @@ LL | unsafe { intrinsics::offset(self, count) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | out-of-bounds pointer arithmetic: allocN has size 0, so pointer to 1 byte starting at offset 0 is out-of-bounds - | inside `ptr::const_ptr::::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL + | inside `std::ptr::const_ptr::::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | ::: $DIR/offset_ub.rs:17:50 | @@ -131,7 +131,7 @@ LL | unsafe { intrinsics::offset(self, count) as *mut T } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | out-of-bounds pointer arithmetic: 0x1[noalloc] is a dangling pointer (it has no provenance) - | inside `ptr::mut_ptr::::offset` at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL + | inside `std::ptr::mut_ptr::::offset` at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL | ::: $DIR/offset_ub.rs:18:42 | @@ -145,7 +145,7 @@ LL | unsafe { intrinsics::offset(self, count) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | out-of-bounds pointer arithmetic: null pointer is a dangling pointer (it has no provenance) - | inside `ptr::const_ptr::::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL + | inside `std::ptr::const_ptr::::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | ::: $DIR/offset_ub.rs:21:50 | @@ -159,7 +159,7 @@ LL | unsafe { intrinsics::offset(self, count) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | out-of-bounds pointer arithmetic: 0x7f..f[noalloc] is a dangling pointer (it has no provenance) - | inside `ptr::const_ptr::::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL + | inside `std::ptr::const_ptr::::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | ::: $DIR/offset_ub.rs:24:47 | diff --git a/src/test/ui/consts/ptr_comparisons.stderr b/src/test/ui/consts/ptr_comparisons.stderr index 67b9fec4a0e11..80a4736a47e54 100644 --- a/src/test/ui/consts/ptr_comparisons.stderr +++ b/src/test/ui/consts/ptr_comparisons.stderr @@ -5,7 +5,7 @@ LL | unsafe { intrinsics::offset(self, count) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | out-of-bounds pointer arithmetic: alloc3 has size $WORD, so pointer to $TWO_WORDS bytes starting at offset 0 is out-of-bounds - | inside `ptr::const_ptr::::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL + | inside `std::ptr::const_ptr::::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | ::: $DIR/ptr_comparisons.rs:58:34 |