1 error[E0080]: evaluation of `Inline::<dyn std::fmt::Debug>::{constant#0}` failed
2 --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
4 LL | intrinsics::size_of::<T>()
5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
7 | size_of called on unsized type `dyn Debug`
8 | inside `std::mem::size_of::<dyn Debug>` at $SRC_DIR/core/src/mem/mod.rs:LL:COL
10 ::: $DIR/issue-80742.rs:22:10
12 LL | [u8; size_of::<T>() + 1]: ,
13 | -------------- inside `Inline::<dyn Debug>::{constant#0}` at $DIR/issue-80742.rs:22:10
15 error[E0599]: the function or associated item `new` exists for struct `Inline<dyn Debug>`, but its trait bounds were not satisfied
16 --> $DIR/issue-80742.rs:30:36
18 LL | / struct Inline<T>
20 LL | | [u8; size_of::<T>() + 1]: ,
22 LL | | _phantom: PhantomData<T>,
23 LL | | buf: [u8; size_of::<T>() + 1],
25 | |_- function or associated item `new` not found for this
27 LL | let dst = Inline::<dyn Debug>::new(0);
28 | ^^^ function or associated item cannot be called on `Inline<dyn Debug>` due to unsatisfied trait bounds
30 ::: $SRC_DIR/core/src/fmt/mod.rs:LL:COL
32 LL | pub trait Debug {
33 | --------------- doesn't satisfy `dyn Debug: Sized`
35 = note: the following trait bounds were not satisfied:
38 error[E0080]: evaluation of `Inline::<dyn std::fmt::Debug>::{constant#0}` failed
39 --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
41 LL | intrinsics::size_of::<T>()
42 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
44 | size_of called on unsized type `dyn Debug`
45 | inside `std::mem::size_of::<dyn Debug>` at $SRC_DIR/core/src/mem/mod.rs:LL:COL
47 ::: $DIR/issue-80742.rs:14:10
49 LL | [u8; size_of::<T>() + 1]: ,
50 | -------------- inside `Inline::<dyn Debug>::{constant#0}` at $DIR/issue-80742.rs:14:10
52 error[E0277]: the size for values of type `dyn Debug` cannot be known at compilation time
53 --> $DIR/issue-80742.rs:30:15
55 LL | let dst = Inline::<dyn Debug>::new(0);
56 | ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
58 = help: the trait `Sized` is not implemented for `dyn Debug`
59 note: required by a bound in `Inline`
60 --> $DIR/issue-80742.rs:12:15
63 | ^ required by this bound in `Inline`
64 help: consider relaxing the implicit `Sized` restriction
66 LL | struct Inline<T: ?Sized>
69 error: aborting due to 4 previous errors
71 Some errors have detailed explanations: E0080, E0277, E0599.
72 For more information about an error, try `rustc --explain E0080`.