diff --git a/compiler/rustc_middle/src/ty/mod.rs b/compiler/rustc_middle/src/ty/mod.rs index db6b35026a8e7..8d94aa9ecb851 100644 --- a/compiler/rustc_middle/src/ty/mod.rs +++ b/compiler/rustc_middle/src/ty/mod.rs @@ -2109,10 +2109,9 @@ impl<'tcx> TyCtxt<'tcx> { /// See [`item_name`][Self::item_name] for more information. pub fn opt_item_ident(self, def_id: DefId) -> Option { let def = self.opt_item_name(def_id)?; - let span = def_id - .as_local() - .and_then(|id| self.def_ident_span(id)) - .unwrap_or(rustc_span::DUMMY_SP); + let span = self + .def_ident_span(def_id) + .unwrap_or_else(|| bug!("missing ident span for {def_id:?}")); Some(Ident::new(def, span)) } diff --git a/tests/ui/const-generics/generic_const_exprs/cross_crate_predicate.stderr b/tests/ui/const-generics/generic_const_exprs/cross_crate_predicate.stderr index 6b3396a25cf97..3a7f3cd0ba00c 100644 --- a/tests/ui/const-generics/generic_const_exprs/cross_crate_predicate.stderr +++ b/tests/ui/const-generics/generic_const_exprs/cross_crate_predicate.stderr @@ -8,6 +8,9 @@ LL | let _ = const_evaluatable_lib::test1::(); note: required by a bound in `test1` --> $DIR/auxiliary/const_evaluatable_lib.rs:6:10 | +LL | pub fn test1() -> [u8; std::mem::size_of::() - 1] + | ----- required by a bound in this function +LL | where LL | [u8; std::mem::size_of::() - 1]: Sized, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `test1` @@ -34,6 +37,9 @@ LL | let _ = const_evaluatable_lib::test1::(); note: required by a bound in `test1` --> $DIR/auxiliary/const_evaluatable_lib.rs:6:10 | +LL | pub fn test1() -> [u8; std::mem::size_of::() - 1] + | ----- required by a bound in this function +LL | where LL | [u8; std::mem::size_of::() - 1]: Sized, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `test1` diff --git a/tests/ui/error-codes/E0277.stderr b/tests/ui/error-codes/E0277.stderr index 2b4784d7eccbd..440e43dff8188 100644 --- a/tests/ui/error-codes/E0277.stderr +++ b/tests/ui/error-codes/E0277.stderr @@ -5,7 +5,8 @@ LL | fn f(p: Path) { } | ^ doesn't have a size known at compile-time | = help: within `Path`, the trait `Sized` is not implemented for `[u8]` - = note: required because it appears within the type `Path` +note: required because it appears within the type `Path` + --> $SRC_DIR/std/src/path.rs:LL:COL = help: unsized fn params are gated as an unstable feature help: function arguments must have a statically known size, borrowed types always have a known size | diff --git a/tests/ui/fmt/send-sync.stderr b/tests/ui/fmt/send-sync.stderr index b517a342e634d..e3ebe6cdcb81a 100644 --- a/tests/ui/fmt/send-sync.stderr +++ b/tests/ui/fmt/send-sync.stderr @@ -8,10 +8,12 @@ LL | send(format_args!("{:?}", c)); | = help: within `[core::fmt::rt::Argument<'_>]`, the trait `Sync` is not implemented for `core::fmt::rt::Opaque` = note: required because it appears within the type `&core::fmt::rt::Opaque` - = note: required because it appears within the type `Argument<'_>` +note: required because it appears within the type `Argument<'_>` + --> $SRC_DIR/core/src/fmt/rt.rs:LL:COL = note: required because it appears within the type `[Argument<'_>]` = note: required for `&[core::fmt::rt::Argument<'_>]` to implement `Send` - = note: required because it appears within the type `Arguments<'_>` +note: required because it appears within the type `Arguments<'_>` + --> $SRC_DIR/core/src/fmt/mod.rs:LL:COL note: required by a bound in `send` --> $DIR/send-sync.rs:1:12 | @@ -28,10 +30,12 @@ LL | sync(format_args!("{:?}", c)); | = help: within `Arguments<'_>`, the trait `Sync` is not implemented for `core::fmt::rt::Opaque` = note: required because it appears within the type `&core::fmt::rt::Opaque` - = note: required because it appears within the type `Argument<'_>` +note: required because it appears within the type `Argument<'_>` + --> $SRC_DIR/core/src/fmt/rt.rs:LL:COL = note: required because it appears within the type `[Argument<'_>]` = note: required because it appears within the type `&[Argument<'_>]` - = note: required because it appears within the type `Arguments<'_>` +note: required because it appears within the type `Arguments<'_>` + --> $SRC_DIR/core/src/fmt/mod.rs:LL:COL note: required by a bound in `sync` --> $DIR/send-sync.rs:2:12 | diff --git a/tests/ui/interior-mutability/interior-mutability.stderr b/tests/ui/interior-mutability/interior-mutability.stderr index 034d22591b38a..0c3be7ca60774 100644 --- a/tests/ui/interior-mutability/interior-mutability.stderr +++ b/tests/ui/interior-mutability/interior-mutability.stderr @@ -7,7 +7,8 @@ LL | catch_unwind(|| { x.set(23); }); | required by a bound introduced by this call | = help: within `Cell`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell` - = note: required because it appears within the type `Cell` +note: required because it appears within the type `Cell` + --> $SRC_DIR/core/src/cell.rs:LL:COL = note: required for `&Cell` to implement `UnwindSafe` note: required because it's used within this closure --> $DIR/interior-mutability.rs:5:18 diff --git a/tests/ui/issues/issue-21763.rs b/tests/ui/issues/issue-21763.rs index 5beb1d8b8c476..38103ff4f9c85 100644 --- a/tests/ui/issues/issue-21763.rs +++ b/tests/ui/issues/issue-21763.rs @@ -1,5 +1,7 @@ // Regression test for HashMap only impl'ing Send/Sync if its contents do +// normalize-stderr-test: "\S+hashbrown-\S+" -> "$$HASHBROWN_SRC_LOCATION" + use std::collections::HashMap; use std::rc::Rc; diff --git a/tests/ui/issues/issue-21763.stderr b/tests/ui/issues/issue-21763.stderr index 04379f07ba0f7..df50118ac4774 100644 --- a/tests/ui/issues/issue-21763.stderr +++ b/tests/ui/issues/issue-21763.stderr @@ -1,5 +1,5 @@ error[E0277]: `Rc<()>` cannot be sent between threads safely - --> $DIR/issue-21763.rs:9:11 + --> $DIR/issue-21763.rs:11:11 | LL | foo::, Rc<()>>>(); | ^^^^^^^^^^^^^^^^^^^^^^^ `Rc<()>` cannot be sent between threads safely @@ -7,10 +7,15 @@ LL | foo::, Rc<()>>>(); = help: within `(Rc<()>, Rc<()>)`, the trait `Send` is not implemented for `Rc<()>` = note: required because it appears within the type `(Rc<()>, Rc<()>)` = note: required for `hashbrown::raw::RawTable<(Rc<()>, Rc<()>)>` to implement `Send` - = note: required because it appears within the type `HashMap, Rc<()>, RandomState>` - = note: required because it appears within the type `HashMap, Rc<()>>` +note: required because it appears within the type `HashMap, Rc<()>, RandomState>` + --> $HASHBROWN_SRC_LOCATION + | +LL | pub struct HashMap { + | ^^^^^^^ +note: required because it appears within the type `HashMap, Rc<()>>` + --> $SRC_DIR/std/src/collections/hash/map.rs:LL:COL note: required by a bound in `foo` - --> $DIR/issue-21763.rs:6:11 + --> $DIR/issue-21763.rs:8:11 | LL | fn foo() {} | ^^^^ required by this bound in `foo` diff --git a/tests/ui/issues/issue-7364.stderr b/tests/ui/issues/issue-7364.stderr index aee73380f15e7..7449fe697ae9f 100644 --- a/tests/ui/issues/issue-7364.stderr +++ b/tests/ui/issues/issue-7364.stderr @@ -7,7 +7,8 @@ LL | static boxed: Box> = Box::new(RefCell::new(0)); = help: the trait `Sync` is not implemented for `RefCell` = note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead = note: required for `Unique>` to implement `Sync` - = note: required because it appears within the type `Box>` +note: required because it appears within the type `Box>` + --> $SRC_DIR/alloc/src/boxed.rs:LL:COL = note: shared static variables must have a type that implements `Sync` error: aborting due to previous error diff --git a/tests/ui/kindck/kindck-send-object.stderr b/tests/ui/kindck/kindck-send-object.stderr index e9bbeeacd7013..284d5dcec3107 100644 --- a/tests/ui/kindck/kindck-send-object.stderr +++ b/tests/ui/kindck/kindck-send-object.stderr @@ -20,7 +20,8 @@ LL | assert_send::>(); | = help: the trait `Send` is not implemented for `dyn Dummy` = note: required for `Unique` to implement `Send` - = note: required because it appears within the type `Box` +note: required because it appears within the type `Box` + --> $SRC_DIR/alloc/src/boxed.rs:LL:COL note: required by a bound in `assert_send` --> $DIR/kindck-send-object.rs:5:18 | diff --git a/tests/ui/kindck/kindck-send-object1.stderr b/tests/ui/kindck/kindck-send-object1.stderr index 19ef4f6fc68d4..269193f73b475 100644 --- a/tests/ui/kindck/kindck-send-object1.stderr +++ b/tests/ui/kindck/kindck-send-object1.stderr @@ -20,7 +20,8 @@ LL | assert_send::>(); | = help: the trait `Send` is not implemented for `(dyn Dummy + 'a)` = note: required for `Unique<(dyn Dummy + 'a)>` to implement `Send` - = note: required because it appears within the type `Box` +note: required because it appears within the type `Box` + --> $SRC_DIR/alloc/src/boxed.rs:LL:COL note: required by a bound in `assert_send` --> $DIR/kindck-send-object1.rs:5:18 | diff --git a/tests/ui/kindck/kindck-send-object2.stderr b/tests/ui/kindck/kindck-send-object2.stderr index b8af33d0dc120..6b8df60227f55 100644 --- a/tests/ui/kindck/kindck-send-object2.stderr +++ b/tests/ui/kindck/kindck-send-object2.stderr @@ -20,7 +20,8 @@ LL | assert_send::>(); | = help: the trait `Send` is not implemented for `dyn Dummy` = note: required for `Unique` to implement `Send` - = note: required because it appears within the type `Box` +note: required because it appears within the type `Box` + --> $SRC_DIR/alloc/src/boxed.rs:LL:COL note: required by a bound in `assert_send` --> $DIR/kindck-send-object2.rs:3:18 | diff --git a/tests/ui/kindck/kindck-send-owned.stderr b/tests/ui/kindck/kindck-send-owned.stderr index b03f56465cea0..dc1bb6206afcf 100644 --- a/tests/ui/kindck/kindck-send-owned.stderr +++ b/tests/ui/kindck/kindck-send-owned.stderr @@ -6,7 +6,8 @@ LL | assert_send::>(); | = help: the trait `Send` is not implemented for `*mut u8` = note: required for `Unique<*mut u8>` to implement `Send` - = note: required because it appears within the type `Box<*mut u8>` +note: required because it appears within the type `Box<*mut u8>` + --> $SRC_DIR/alloc/src/boxed.rs:LL:COL note: required by a bound in `assert_send` --> $DIR/kindck-send-owned.rs:3:18 | diff --git a/tests/ui/not-panic/not-panic-safe-2.stderr b/tests/ui/not-panic/not-panic-safe-2.stderr index 3b0f83b3b9a47..0c399f15a25bb 100644 --- a/tests/ui/not-panic/not-panic-safe-2.stderr +++ b/tests/ui/not-panic/not-panic-safe-2.stderr @@ -5,7 +5,8 @@ LL | assert::>>(); | ^^^^^^^^^^^^^^^^ `UnsafeCell` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary | = help: within `RefCell`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell` - = note: required because it appears within the type `RefCell` +note: required because it appears within the type `RefCell` + --> $SRC_DIR/core/src/cell.rs:LL:COL = note: required for `Rc>` to implement `UnwindSafe` note: required by a bound in `assert` --> $DIR/not-panic-safe-2.rs:7:14 @@ -20,8 +21,10 @@ LL | assert::>>(); | ^^^^^^^^^^^^^^^^ `UnsafeCell` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary | = help: within `RefCell`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell` - = note: required because it appears within the type `Cell` - = note: required because it appears within the type `RefCell` +note: required because it appears within the type `Cell` + --> $SRC_DIR/core/src/cell.rs:LL:COL +note: required because it appears within the type `RefCell` + --> $SRC_DIR/core/src/cell.rs:LL:COL = note: required for `Rc>` to implement `UnwindSafe` note: required by a bound in `assert` --> $DIR/not-panic-safe-2.rs:7:14 diff --git a/tests/ui/not-panic/not-panic-safe-3.stderr b/tests/ui/not-panic/not-panic-safe-3.stderr index 9e9a12764a4b6..53028d6a3371a 100644 --- a/tests/ui/not-panic/not-panic-safe-3.stderr +++ b/tests/ui/not-panic/not-panic-safe-3.stderr @@ -5,7 +5,8 @@ LL | assert::>>(); | ^^^^^^^^^^^^^^^^^ `UnsafeCell` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary | = help: within `RefCell`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell` - = note: required because it appears within the type `RefCell` +note: required because it appears within the type `RefCell` + --> $SRC_DIR/core/src/cell.rs:LL:COL = note: required for `Arc>` to implement `UnwindSafe` note: required by a bound in `assert` --> $DIR/not-panic-safe-3.rs:7:14 @@ -20,8 +21,10 @@ LL | assert::>>(); | ^^^^^^^^^^^^^^^^^ `UnsafeCell` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary | = help: within `RefCell`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell` - = note: required because it appears within the type `Cell` - = note: required because it appears within the type `RefCell` +note: required because it appears within the type `Cell` + --> $SRC_DIR/core/src/cell.rs:LL:COL +note: required because it appears within the type `RefCell` + --> $SRC_DIR/core/src/cell.rs:LL:COL = note: required for `Arc>` to implement `UnwindSafe` note: required by a bound in `assert` --> $DIR/not-panic-safe-3.rs:7:14 diff --git a/tests/ui/not-panic/not-panic-safe-4.stderr b/tests/ui/not-panic/not-panic-safe-4.stderr index 9428c125651ec..b1361cfd87ef2 100644 --- a/tests/ui/not-panic/not-panic-safe-4.stderr +++ b/tests/ui/not-panic/not-panic-safe-4.stderr @@ -5,7 +5,8 @@ LL | assert::<&RefCell>(); | ^^^^^^^^^^^^^ `UnsafeCell` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary | = help: within `RefCell`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell` - = note: required because it appears within the type `RefCell` +note: required because it appears within the type `RefCell` + --> $SRC_DIR/core/src/cell.rs:LL:COL = note: required for `&RefCell` to implement `UnwindSafe` note: required by a bound in `assert` --> $DIR/not-panic-safe-4.rs:6:14 @@ -25,8 +26,10 @@ LL | assert::<&RefCell>(); | ^^^^^^^^^^^^^ `UnsafeCell` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary | = help: within `RefCell`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell` - = note: required because it appears within the type `Cell` - = note: required because it appears within the type `RefCell` +note: required because it appears within the type `Cell` + --> $SRC_DIR/core/src/cell.rs:LL:COL +note: required because it appears within the type `RefCell` + --> $SRC_DIR/core/src/cell.rs:LL:COL = note: required for `&RefCell` to implement `UnwindSafe` note: required by a bound in `assert` --> $DIR/not-panic-safe-4.rs:6:14 diff --git a/tests/ui/not-panic/not-panic-safe-6.stderr b/tests/ui/not-panic/not-panic-safe-6.stderr index 7986e341eb01f..47f28257409eb 100644 --- a/tests/ui/not-panic/not-panic-safe-6.stderr +++ b/tests/ui/not-panic/not-panic-safe-6.stderr @@ -5,7 +5,8 @@ LL | assert::<*mut RefCell>(); | ^^^^^^^^^^^^^^^^^ `UnsafeCell` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary | = help: within `RefCell`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell` - = note: required because it appears within the type `RefCell` +note: required because it appears within the type `RefCell` + --> $SRC_DIR/core/src/cell.rs:LL:COL = note: required for `*mut RefCell` to implement `UnwindSafe` note: required by a bound in `assert` --> $DIR/not-panic-safe-6.rs:6:14 @@ -20,8 +21,10 @@ LL | assert::<*mut RefCell>(); | ^^^^^^^^^^^^^^^^^ `UnsafeCell` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary | = help: within `RefCell`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell` - = note: required because it appears within the type `Cell` - = note: required because it appears within the type `RefCell` +note: required because it appears within the type `Cell` + --> $SRC_DIR/core/src/cell.rs:LL:COL +note: required because it appears within the type `RefCell` + --> $SRC_DIR/core/src/cell.rs:LL:COL = note: required for `*mut RefCell` to implement `UnwindSafe` note: required by a bound in `assert` --> $DIR/not-panic-safe-6.rs:6:14 diff --git a/tests/ui/phantom-auto-trait.stderr b/tests/ui/phantom-auto-trait.stderr index 4769d53eb354f..5af648f6a0cf1 100644 --- a/tests/ui/phantom-auto-trait.stderr +++ b/tests/ui/phantom-auto-trait.stderr @@ -11,7 +11,8 @@ note: required for `&T` to implement `Zen` | LL | unsafe impl<'a, T: 'a> Zen for &'a T where T: Sync {} | ^^^ ^^^^^ ---- unsatisfied trait bound introduced here - = note: required because it appears within the type `PhantomData<&T>` +note: required because it appears within the type `PhantomData<&T>` + --> $SRC_DIR/core/src/marker.rs:LL:COL note: required because it appears within the type `Guard<'_, T>` --> $DIR/phantom-auto-trait.rs:12:8 | @@ -40,7 +41,8 @@ note: required for `&T` to implement `Zen` | LL | unsafe impl<'a, T: 'a> Zen for &'a T where T: Sync {} | ^^^ ^^^^^ ---- unsatisfied trait bound introduced here - = note: required because it appears within the type `PhantomData<&T>` +note: required because it appears within the type `PhantomData<&T>` + --> $SRC_DIR/core/src/marker.rs:LL:COL note: required because it appears within the type `Guard<'_, T>` --> $DIR/phantom-auto-trait.rs:12:8 | diff --git a/tests/ui/recursion/recursive-requirements.stderr b/tests/ui/recursion/recursive-requirements.stderr index 8ee154ce57ba5..bb63f7cd0dce0 100644 --- a/tests/ui/recursion/recursive-requirements.stderr +++ b/tests/ui/recursion/recursive-requirements.stderr @@ -28,7 +28,8 @@ note: required because it appears within the type `Bar` | LL | pub struct Bar { | ^^^ - = note: required because it appears within the type `PhantomData` +note: required because it appears within the type `PhantomData` + --> $SRC_DIR/core/src/marker.rs:LL:COL note: required because it appears within the type `Foo` --> $DIR/recursive-requirements.rs:5:12 | diff --git a/tests/ui/suggestions/path-by-value.stderr b/tests/ui/suggestions/path-by-value.stderr index bbeaa26a93a0b..fd3646b8c3c6a 100644 --- a/tests/ui/suggestions/path-by-value.stderr +++ b/tests/ui/suggestions/path-by-value.stderr @@ -5,7 +5,8 @@ LL | fn f(p: Path) { } | ^ doesn't have a size known at compile-time | = help: within `Path`, the trait `Sized` is not implemented for `[u8]` - = note: required because it appears within the type `Path` +note: required because it appears within the type `Path` + --> $SRC_DIR/std/src/path.rs:LL:COL = help: unsized fn params are gated as an unstable feature help: function arguments must have a statically known size, borrowed types always have a known size | diff --git a/tests/ui/suggestions/suggest-borrow-to-dyn-object.stderr b/tests/ui/suggestions/suggest-borrow-to-dyn-object.stderr index 6ce9bfd9dcaa2..365c1016eb3dc 100644 --- a/tests/ui/suggestions/suggest-borrow-to-dyn-object.stderr +++ b/tests/ui/suggestions/suggest-borrow-to-dyn-object.stderr @@ -5,7 +5,8 @@ LL | check(s); | ^ doesn't have a size known at compile-time | = help: within `OsStr`, the trait `Sized` is not implemented for `[u8]` - = note: required because it appears within the type `OsStr` +note: required because it appears within the type `OsStr` + --> $SRC_DIR/std/src/ffi/os_str.rs:LL:COL = note: required for the cast from `OsStr` to the object type `dyn AsRef` help: consider borrowing the value, since `&OsStr` can be coerced into `dyn AsRef` | diff --git a/tests/ui/traits/issue-7013.stderr b/tests/ui/traits/issue-7013.stderr index 4575f4dbae62d..9ac5c4725ab12 100644 --- a/tests/ui/traits/issue-7013.stderr +++ b/tests/ui/traits/issue-7013.stderr @@ -5,7 +5,8 @@ LL | let a = A {v: Box::new(B{v: None}) as Box}; | ^^^^^^^^^^^^^^^^^^^^ `Rc>` cannot be sent between threads safely | = help: within `B`, the trait `Send` is not implemented for `Rc>` - = note: required because it appears within the type `Option>>` +note: required because it appears within the type `Option>>` + --> $SRC_DIR/core/src/option.rs:LL:COL note: required because it appears within the type `B` --> $DIR/issue-7013.rs:8:8 | diff --git a/tests/ui/traits/negative-impls/negated-auto-traits-error.stderr b/tests/ui/traits/negative-impls/negated-auto-traits-error.stderr index b680ce7f99013..a53879657f5a4 100644 --- a/tests/ui/traits/negative-impls/negated-auto-traits-error.stderr +++ b/tests/ui/traits/negative-impls/negated-auto-traits-error.stderr @@ -67,7 +67,8 @@ LL | is_send(Box::new(TestType)); | = note: the trait bound `Unique: Send` is not satisfied = note: required for `Unique` to implement `Send` - = note: required because it appears within the type `Box` +note: required because it appears within the type `Box` + --> $SRC_DIR/alloc/src/boxed.rs:LL:COL note: required by a bound in `is_send` --> $DIR/negated-auto-traits-error.rs:16:15 | @@ -93,7 +94,8 @@ note: required because it appears within the type `Outer2` LL | struct Outer2(T); | ^^^^^^ = note: required for `Unique>` to implement `Send` - = note: required because it appears within the type `Box>` +note: required because it appears within the type `Box>` + --> $SRC_DIR/alloc/src/boxed.rs:LL:COL note: required by a bound in `is_send` --> $DIR/negated-auto-traits-error.rs:16:15 | diff --git a/tests/ui/union/union-sized-field.stderr b/tests/ui/union/union-sized-field.stderr index 771e8f2619995..bf1ff9c8bc154 100644 --- a/tests/ui/union/union-sized-field.stderr +++ b/tests/ui/union/union-sized-field.stderr @@ -6,7 +6,8 @@ LL | union Foo { LL | value: ManuallyDrop, | ^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | - = note: required because it appears within the type `ManuallyDrop` +note: required because it appears within the type `ManuallyDrop` + --> $SRC_DIR/core/src/mem/manually_drop.rs:LL:COL = note: no field of a union may have a dynamically sized type = help: change the field's type to have a statically known size help: consider removing the `?Sized` bound to make the type parameter `Sized` @@ -31,7 +32,8 @@ LL | struct Foo2 { LL | value: ManuallyDrop, | ^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | - = note: required because it appears within the type `ManuallyDrop` +note: required because it appears within the type `ManuallyDrop` + --> $SRC_DIR/core/src/mem/manually_drop.rs:LL:COL = note: only the last field of a struct may have a dynamically sized type = help: change the field's type to have a statically known size help: consider removing the `?Sized` bound to make the type parameter `Sized` @@ -56,7 +58,8 @@ LL | enum Foo3 { LL | Value(ManuallyDrop), | ^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | - = note: required because it appears within the type `ManuallyDrop` +note: required because it appears within the type `ManuallyDrop` + --> $SRC_DIR/core/src/mem/manually_drop.rs:LL:COL = note: no field of an enum variant may have a dynamically sized type = help: change the field's type to have a statically known size help: consider removing the `?Sized` bound to make the type parameter `Sized`