Skip to content

Commit 6f6c379

Browse files
committed
rustc_middle: Fix opt_item_ident for non-local def ids
1 parent 82cd953 commit 6f6c379

23 files changed

+88
-42
lines changed

Diff for: compiler/rustc_middle/src/ty/mod.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -2109,10 +2109,9 @@ impl<'tcx> TyCtxt<'tcx> {
21092109
/// See [`item_name`][Self::item_name] for more information.
21102110
pub fn opt_item_ident(self, def_id: DefId) -> Option<Ident> {
21112111
let def = self.opt_item_name(def_id)?;
2112-
let span = def_id
2113-
.as_local()
2114-
.and_then(|id| self.def_ident_span(id))
2115-
.unwrap_or(rustc_span::DUMMY_SP);
2112+
let span = self
2113+
.def_ident_span(def_id)
2114+
.unwrap_or_else(|| bug!("missing ident span for {def_id:?}"));
21162115
Some(Ident::new(def, span))
21172116
}
21182117

Diff for: tests/ui/const-generics/generic_const_exprs/cross_crate_predicate.stderr

+6
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ LL | let _ = const_evaluatable_lib::test1::<T>();
88
note: required by a bound in `test1`
99
--> $DIR/auxiliary/const_evaluatable_lib.rs:6:10
1010
|
11+
LL | pub fn test1<T>() -> [u8; std::mem::size_of::<T>() - 1]
12+
| ----- required by a bound in this function
13+
LL | where
1114
LL | [u8; std::mem::size_of::<T>() - 1]: Sized,
1215
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `test1`
1316

@@ -34,6 +37,9 @@ LL | let _ = const_evaluatable_lib::test1::<T>();
3437
note: required by a bound in `test1`
3538
--> $DIR/auxiliary/const_evaluatable_lib.rs:6:10
3639
|
40+
LL | pub fn test1<T>() -> [u8; std::mem::size_of::<T>() - 1]
41+
| ----- required by a bound in this function
42+
LL | where
3743
LL | [u8; std::mem::size_of::<T>() - 1]: Sized,
3844
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `test1`
3945

Diff for: tests/ui/error-codes/E0277.stderr

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ LL | fn f(p: Path) { }
55
| ^ doesn't have a size known at compile-time
66
|
77
= help: within `Path`, the trait `Sized` is not implemented for `[u8]`
8-
= note: required because it appears within the type `Path`
8+
note: required because it appears within the type `Path`
9+
--> $SRC_DIR/std/src/path.rs:LL:COL
910
= help: unsized fn params are gated as an unstable feature
1011
help: function arguments must have a statically known size, borrowed types always have a known size
1112
|

Diff for: tests/ui/fmt/send-sync.stderr

+8-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ LL | send(format_args!("{:?}", c));
88
|
99
= help: within `[core::fmt::rt::Argument<'_>]`, the trait `Sync` is not implemented for `core::fmt::rt::Opaque`
1010
= note: required because it appears within the type `&core::fmt::rt::Opaque`
11-
= note: required because it appears within the type `Argument<'_>`
11+
note: required because it appears within the type `Argument<'_>`
12+
--> $SRC_DIR/core/src/fmt/rt.rs:LL:COL
1213
= note: required because it appears within the type `[Argument<'_>]`
1314
= note: required for `&[core::fmt::rt::Argument<'_>]` to implement `Send`
14-
= note: required because it appears within the type `Arguments<'_>`
15+
note: required because it appears within the type `Arguments<'_>`
16+
--> $SRC_DIR/core/src/fmt/mod.rs:LL:COL
1517
note: required by a bound in `send`
1618
--> $DIR/send-sync.rs:1:12
1719
|
@@ -28,10 +30,12 @@ LL | sync(format_args!("{:?}", c));
2830
|
2931
= help: within `Arguments<'_>`, the trait `Sync` is not implemented for `core::fmt::rt::Opaque`
3032
= note: required because it appears within the type `&core::fmt::rt::Opaque`
31-
= note: required because it appears within the type `Argument<'_>`
33+
note: required because it appears within the type `Argument<'_>`
34+
--> $SRC_DIR/core/src/fmt/rt.rs:LL:COL
3235
= note: required because it appears within the type `[Argument<'_>]`
3336
= note: required because it appears within the type `&[Argument<'_>]`
34-
= note: required because it appears within the type `Arguments<'_>`
37+
note: required because it appears within the type `Arguments<'_>`
38+
--> $SRC_DIR/core/src/fmt/mod.rs:LL:COL
3539
note: required by a bound in `sync`
3640
--> $DIR/send-sync.rs:2:12
3741
|

Diff for: tests/ui/interior-mutability/interior-mutability.stderr

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ LL | catch_unwind(|| { x.set(23); });
77
| required by a bound introduced by this call
88
|
99
= help: within `Cell<i32>`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<i32>`
10-
= note: required because it appears within the type `Cell<i32>`
10+
note: required because it appears within the type `Cell<i32>`
11+
--> $SRC_DIR/core/src/cell.rs:LL:COL
1112
= note: required for `&Cell<i32>` to implement `UnwindSafe`
1213
note: required because it's used within this closure
1314
--> $DIR/interior-mutability.rs:5:18

Diff for: tests/ui/issues/issue-21763.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// Regression test for HashMap only impl'ing Send/Sync if its contents do
22

3+
// normalize-stderr-test: "\S+hashbrown-\S+" -> "$$HASHBROWN_SRC_LOCATION"
4+
35
use std::collections::HashMap;
46
use std::rc::Rc;
57

Diff for: tests/ui/issues/issue-21763.stderr

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
error[E0277]: `Rc<()>` cannot be sent between threads safely
2-
--> $DIR/issue-21763.rs:9:11
2+
--> $DIR/issue-21763.rs:11:11
33
|
44
LL | foo::<HashMap<Rc<()>, Rc<()>>>();
55
| ^^^^^^^^^^^^^^^^^^^^^^^ `Rc<()>` cannot be sent between threads safely
66
|
77
= help: within `(Rc<()>, Rc<()>)`, the trait `Send` is not implemented for `Rc<()>`
88
= note: required because it appears within the type `(Rc<()>, Rc<()>)`
99
= note: required for `hashbrown::raw::RawTable<(Rc<()>, Rc<()>)>` to implement `Send`
10-
= note: required because it appears within the type `HashMap<Rc<()>, Rc<()>, RandomState>`
11-
= note: required because it appears within the type `HashMap<Rc<()>, Rc<()>>`
10+
note: required because it appears within the type `HashMap<Rc<()>, Rc<()>, RandomState>`
11+
--> $HASHBROWN_SRC_LOCATION
12+
|
13+
LL | pub struct HashMap<K, V, S = DefaultHashBuilder, A: Allocator + Clone = Global> {
14+
| ^^^^^^^
15+
note: required because it appears within the type `HashMap<Rc<()>, Rc<()>>`
16+
--> $SRC_DIR/std/src/collections/hash/map.rs:LL:COL
1217
note: required by a bound in `foo`
13-
--> $DIR/issue-21763.rs:6:11
18+
--> $DIR/issue-21763.rs:8:11
1419
|
1520
LL | fn foo<T: Send>() {}
1621
| ^^^^ required by this bound in `foo`

Diff for: tests/ui/issues/issue-7364.stderr

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ LL | static boxed: Box<RefCell<isize>> = Box::new(RefCell::new(0));
77
= help: the trait `Sync` is not implemented for `RefCell<isize>`
88
= note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead
99
= note: required for `Unique<RefCell<isize>>` to implement `Sync`
10-
= note: required because it appears within the type `Box<RefCell<isize>>`
10+
note: required because it appears within the type `Box<RefCell<isize>>`
11+
--> $SRC_DIR/alloc/src/boxed.rs:LL:COL
1112
= note: shared static variables must have a type that implements `Sync`
1213

1314
error: aborting due to previous error

Diff for: tests/ui/kindck/kindck-send-object.stderr

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ LL | assert_send::<Box<dyn Dummy>>();
2020
|
2121
= help: the trait `Send` is not implemented for `dyn Dummy`
2222
= note: required for `Unique<dyn Dummy>` to implement `Send`
23-
= note: required because it appears within the type `Box<dyn Dummy>`
23+
note: required because it appears within the type `Box<dyn Dummy>`
24+
--> $SRC_DIR/alloc/src/boxed.rs:LL:COL
2425
note: required by a bound in `assert_send`
2526
--> $DIR/kindck-send-object.rs:5:18
2627
|

Diff for: tests/ui/kindck/kindck-send-object1.stderr

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ LL | assert_send::<Box<dyn Dummy + 'a>>();
2020
|
2121
= help: the trait `Send` is not implemented for `(dyn Dummy + 'a)`
2222
= note: required for `Unique<(dyn Dummy + 'a)>` to implement `Send`
23-
= note: required because it appears within the type `Box<dyn Dummy>`
23+
note: required because it appears within the type `Box<dyn Dummy>`
24+
--> $SRC_DIR/alloc/src/boxed.rs:LL:COL
2425
note: required by a bound in `assert_send`
2526
--> $DIR/kindck-send-object1.rs:5:18
2627
|

Diff for: tests/ui/kindck/kindck-send-object2.stderr

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ LL | assert_send::<Box<dyn Dummy>>();
2020
|
2121
= help: the trait `Send` is not implemented for `dyn Dummy`
2222
= note: required for `Unique<dyn Dummy>` to implement `Send`
23-
= note: required because it appears within the type `Box<dyn Dummy>`
23+
note: required because it appears within the type `Box<dyn Dummy>`
24+
--> $SRC_DIR/alloc/src/boxed.rs:LL:COL
2425
note: required by a bound in `assert_send`
2526
--> $DIR/kindck-send-object2.rs:3:18
2627
|

Diff for: tests/ui/kindck/kindck-send-owned.stderr

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ LL | assert_send::<Box<*mut u8>>();
66
|
77
= help: the trait `Send` is not implemented for `*mut u8`
88
= note: required for `Unique<*mut u8>` to implement `Send`
9-
= note: required because it appears within the type `Box<*mut u8>`
9+
note: required because it appears within the type `Box<*mut u8>`
10+
--> $SRC_DIR/alloc/src/boxed.rs:LL:COL
1011
note: required by a bound in `assert_send`
1112
--> $DIR/kindck-send-owned.rs:3:18
1213
|

Diff for: tests/ui/not-panic/not-panic-safe-2.stderr

+6-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ LL | assert::<Rc<RefCell<i32>>>();
55
| ^^^^^^^^^^^^^^^^ `UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
66
|
77
= help: within `RefCell<i32>`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<i32>`
8-
= note: required because it appears within the type `RefCell<i32>`
8+
note: required because it appears within the type `RefCell<i32>`
9+
--> $SRC_DIR/core/src/cell.rs:LL:COL
910
= note: required for `Rc<RefCell<i32>>` to implement `UnwindSafe`
1011
note: required by a bound in `assert`
1112
--> $DIR/not-panic-safe-2.rs:7:14
@@ -20,8 +21,10 @@ LL | assert::<Rc<RefCell<i32>>>();
2021
| ^^^^^^^^^^^^^^^^ `UnsafeCell<isize>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
2122
|
2223
= help: within `RefCell<i32>`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<isize>`
23-
= note: required because it appears within the type `Cell<isize>`
24-
= note: required because it appears within the type `RefCell<i32>`
24+
note: required because it appears within the type `Cell<isize>`
25+
--> $SRC_DIR/core/src/cell.rs:LL:COL
26+
note: required because it appears within the type `RefCell<i32>`
27+
--> $SRC_DIR/core/src/cell.rs:LL:COL
2528
= note: required for `Rc<RefCell<i32>>` to implement `UnwindSafe`
2629
note: required by a bound in `assert`
2730
--> $DIR/not-panic-safe-2.rs:7:14

Diff for: tests/ui/not-panic/not-panic-safe-3.stderr

+6-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ LL | assert::<Arc<RefCell<i32>>>();
55
| ^^^^^^^^^^^^^^^^^ `UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
66
|
77
= help: within `RefCell<i32>`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<i32>`
8-
= note: required because it appears within the type `RefCell<i32>`
8+
note: required because it appears within the type `RefCell<i32>`
9+
--> $SRC_DIR/core/src/cell.rs:LL:COL
910
= note: required for `Arc<RefCell<i32>>` to implement `UnwindSafe`
1011
note: required by a bound in `assert`
1112
--> $DIR/not-panic-safe-3.rs:7:14
@@ -20,8 +21,10 @@ LL | assert::<Arc<RefCell<i32>>>();
2021
| ^^^^^^^^^^^^^^^^^ `UnsafeCell<isize>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
2122
|
2223
= help: within `RefCell<i32>`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<isize>`
23-
= note: required because it appears within the type `Cell<isize>`
24-
= note: required because it appears within the type `RefCell<i32>`
24+
note: required because it appears within the type `Cell<isize>`
25+
--> $SRC_DIR/core/src/cell.rs:LL:COL
26+
note: required because it appears within the type `RefCell<i32>`
27+
--> $SRC_DIR/core/src/cell.rs:LL:COL
2528
= note: required for `Arc<RefCell<i32>>` to implement `UnwindSafe`
2629
note: required by a bound in `assert`
2730
--> $DIR/not-panic-safe-3.rs:7:14

Diff for: tests/ui/not-panic/not-panic-safe-4.stderr

+6-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ LL | assert::<&RefCell<i32>>();
55
| ^^^^^^^^^^^^^ `UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
66
|
77
= help: within `RefCell<i32>`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<i32>`
8-
= note: required because it appears within the type `RefCell<i32>`
8+
note: required because it appears within the type `RefCell<i32>`
9+
--> $SRC_DIR/core/src/cell.rs:LL:COL
910
= note: required for `&RefCell<i32>` to implement `UnwindSafe`
1011
note: required by a bound in `assert`
1112
--> $DIR/not-panic-safe-4.rs:6:14
@@ -25,8 +26,10 @@ LL | assert::<&RefCell<i32>>();
2526
| ^^^^^^^^^^^^^ `UnsafeCell<isize>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
2627
|
2728
= help: within `RefCell<i32>`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<isize>`
28-
= note: required because it appears within the type `Cell<isize>`
29-
= note: required because it appears within the type `RefCell<i32>`
29+
note: required because it appears within the type `Cell<isize>`
30+
--> $SRC_DIR/core/src/cell.rs:LL:COL
31+
note: required because it appears within the type `RefCell<i32>`
32+
--> $SRC_DIR/core/src/cell.rs:LL:COL
3033
= note: required for `&RefCell<i32>` to implement `UnwindSafe`
3134
note: required by a bound in `assert`
3235
--> $DIR/not-panic-safe-4.rs:6:14

Diff for: tests/ui/not-panic/not-panic-safe-6.stderr

+6-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ LL | assert::<*mut RefCell<i32>>();
55
| ^^^^^^^^^^^^^^^^^ `UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
66
|
77
= help: within `RefCell<i32>`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<i32>`
8-
= note: required because it appears within the type `RefCell<i32>`
8+
note: required because it appears within the type `RefCell<i32>`
9+
--> $SRC_DIR/core/src/cell.rs:LL:COL
910
= note: required for `*mut RefCell<i32>` to implement `UnwindSafe`
1011
note: required by a bound in `assert`
1112
--> $DIR/not-panic-safe-6.rs:6:14
@@ -20,8 +21,10 @@ LL | assert::<*mut RefCell<i32>>();
2021
| ^^^^^^^^^^^^^^^^^ `UnsafeCell<isize>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
2122
|
2223
= help: within `RefCell<i32>`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<isize>`
23-
= note: required because it appears within the type `Cell<isize>`
24-
= note: required because it appears within the type `RefCell<i32>`
24+
note: required because it appears within the type `Cell<isize>`
25+
--> $SRC_DIR/core/src/cell.rs:LL:COL
26+
note: required because it appears within the type `RefCell<i32>`
27+
--> $SRC_DIR/core/src/cell.rs:LL:COL
2528
= note: required for `*mut RefCell<i32>` to implement `UnwindSafe`
2629
note: required by a bound in `assert`
2730
--> $DIR/not-panic-safe-6.rs:6:14

Diff for: tests/ui/phantom-auto-trait.stderr

+4-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ note: required for `&T` to implement `Zen`
1111
|
1212
LL | unsafe impl<'a, T: 'a> Zen for &'a T where T: Sync {}
1313
| ^^^ ^^^^^ ---- unsatisfied trait bound introduced here
14-
= note: required because it appears within the type `PhantomData<&T>`
14+
note: required because it appears within the type `PhantomData<&T>`
15+
--> $SRC_DIR/core/src/marker.rs:LL:COL
1516
note: required because it appears within the type `Guard<'_, T>`
1617
--> $DIR/phantom-auto-trait.rs:12:8
1718
|
@@ -40,7 +41,8 @@ note: required for `&T` to implement `Zen`
4041
|
4142
LL | unsafe impl<'a, T: 'a> Zen for &'a T where T: Sync {}
4243
| ^^^ ^^^^^ ---- unsatisfied trait bound introduced here
43-
= note: required because it appears within the type `PhantomData<&T>`
44+
note: required because it appears within the type `PhantomData<&T>`
45+
--> $SRC_DIR/core/src/marker.rs:LL:COL
4446
note: required because it appears within the type `Guard<'_, T>`
4547
--> $DIR/phantom-auto-trait.rs:12:8
4648
|

Diff for: tests/ui/recursion/recursive-requirements.stderr

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ note: required because it appears within the type `Bar`
2828
|
2929
LL | pub struct Bar {
3030
| ^^^
31-
= note: required because it appears within the type `PhantomData<Bar>`
31+
note: required because it appears within the type `PhantomData<Bar>`
32+
--> $SRC_DIR/core/src/marker.rs:LL:COL
3233
note: required because it appears within the type `Foo`
3334
--> $DIR/recursive-requirements.rs:5:12
3435
|

Diff for: tests/ui/suggestions/path-by-value.stderr

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ LL | fn f(p: Path) { }
55
| ^ doesn't have a size known at compile-time
66
|
77
= help: within `Path`, the trait `Sized` is not implemented for `[u8]`
8-
= note: required because it appears within the type `Path`
8+
note: required because it appears within the type `Path`
9+
--> $SRC_DIR/std/src/path.rs:LL:COL
910
= help: unsized fn params are gated as an unstable feature
1011
help: function arguments must have a statically known size, borrowed types always have a known size
1112
|

Diff for: tests/ui/suggestions/suggest-borrow-to-dyn-object.stderr

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ LL | check(s);
55
| ^ doesn't have a size known at compile-time
66
|
77
= help: within `OsStr`, the trait `Sized` is not implemented for `[u8]`
8-
= note: required because it appears within the type `OsStr`
8+
note: required because it appears within the type `OsStr`
9+
--> $SRC_DIR/std/src/ffi/os_str.rs:LL:COL
910
= note: required for the cast from `OsStr` to the object type `dyn AsRef<Path>`
1011
help: consider borrowing the value, since `&OsStr` can be coerced into `dyn AsRef<Path>`
1112
|

Diff for: tests/ui/traits/issue-7013.stderr

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ LL | let a = A {v: Box::new(B{v: None}) as Box<dyn Foo + Send>};
55
| ^^^^^^^^^^^^^^^^^^^^ `Rc<RefCell<A>>` cannot be sent between threads safely
66
|
77
= help: within `B`, the trait `Send` is not implemented for `Rc<RefCell<A>>`
8-
= note: required because it appears within the type `Option<Rc<RefCell<A>>>`
8+
note: required because it appears within the type `Option<Rc<RefCell<A>>>`
9+
--> $SRC_DIR/core/src/option.rs:LL:COL
910
note: required because it appears within the type `B`
1011
--> $DIR/issue-7013.rs:8:8
1112
|

Diff for: tests/ui/traits/negative-impls/negated-auto-traits-error.stderr

+4-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ LL | is_send(Box::new(TestType));
6767
|
6868
= note: the trait bound `Unique<dummy2::TestType>: Send` is not satisfied
6969
= note: required for `Unique<dummy2::TestType>` to implement `Send`
70-
= note: required because it appears within the type `Box<TestType>`
70+
note: required because it appears within the type `Box<TestType>`
71+
--> $SRC_DIR/alloc/src/boxed.rs:LL:COL
7172
note: required by a bound in `is_send`
7273
--> $DIR/negated-auto-traits-error.rs:16:15
7374
|
@@ -93,7 +94,8 @@ note: required because it appears within the type `Outer2<TestType>`
9394
LL | struct Outer2<T>(T);
9495
| ^^^^^^
9596
= note: required for `Unique<Outer2<dummy3::TestType>>` to implement `Send`
96-
= note: required because it appears within the type `Box<Outer2<TestType>>`
97+
note: required because it appears within the type `Box<Outer2<TestType>>`
98+
--> $SRC_DIR/alloc/src/boxed.rs:LL:COL
9799
note: required by a bound in `is_send`
98100
--> $DIR/negated-auto-traits-error.rs:16:15
99101
|

Diff for: tests/ui/union/union-sized-field.stderr

+6-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ LL | union Foo<T: ?Sized> {
66
LL | value: ManuallyDrop<T>,
77
| ^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
88
|
9-
= note: required because it appears within the type `ManuallyDrop<T>`
9+
note: required because it appears within the type `ManuallyDrop<T>`
10+
--> $SRC_DIR/core/src/mem/manually_drop.rs:LL:COL
1011
= note: no field of a union may have a dynamically sized type
1112
= help: change the field's type to have a statically known size
1213
help: consider removing the `?Sized` bound to make the type parameter `Sized`
@@ -31,7 +32,8 @@ LL | struct Foo2<T: ?Sized> {
3132
LL | value: ManuallyDrop<T>,
3233
| ^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
3334
|
34-
= note: required because it appears within the type `ManuallyDrop<T>`
35+
note: required because it appears within the type `ManuallyDrop<T>`
36+
--> $SRC_DIR/core/src/mem/manually_drop.rs:LL:COL
3537
= note: only the last field of a struct may have a dynamically sized type
3638
= help: change the field's type to have a statically known size
3739
help: consider removing the `?Sized` bound to make the type parameter `Sized`
@@ -56,7 +58,8 @@ LL | enum Foo3<T: ?Sized> {
5658
LL | Value(ManuallyDrop<T>),
5759
| ^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
5860
|
59-
= note: required because it appears within the type `ManuallyDrop<T>`
61+
note: required because it appears within the type `ManuallyDrop<T>`
62+
--> $SRC_DIR/core/src/mem/manually_drop.rs:LL:COL
6063
= note: no field of an enum variant may have a dynamically sized type
6164
= help: change the field's type to have a statically known size
6265
help: consider removing the `?Sized` bound to make the type parameter `Sized`

0 commit comments

Comments
 (0)