]> git.lizzy.rs Git - rust.git/blob - src/test/ui/mir/issue-80742.stderr
Auto merge of #87150 - rusticstuff:simplify_wrapping_neg, r=m-ou-se
[rust.git] / src / test / ui / mir / issue-80742.stderr
1 error[E0080]: evaluation of `Inline::<dyn std::fmt::Debug>::{constant#0}` failed
2   --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
3    |
4 LL |     intrinsics::size_of::<T>()
5    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
6    |     |
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
9    |
10   ::: $DIR/issue-80742.rs:23:10
11    |
12 LL |     [u8; size_of::<T>() + 1]: ,
13    |          -------------- inside `Inline::<dyn Debug>::{constant#0}` at $DIR/issue-80742.rs:23:10
14
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:31:36
17    |
18 LL | / struct Inline<T>
19 LL | | where
20 LL | |     [u8; size_of::<T>() + 1]: ,
21 LL | | {
22 LL | |     _phantom: PhantomData<T>,
23 LL | |     buf: [u8; size_of::<T>() + 1],
24 LL | | }
25    | |_- function or associated item `new` not found for this
26 ...
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
29    |
30   ::: $SRC_DIR/core/src/fmt/mod.rs:LL:COL
31    |
32 LL |   pub trait Debug {
33    |   --------------- doesn't satisfy `dyn Debug: Sized`
34    |
35    = note: the following trait bounds were not satisfied:
36            `dyn Debug: Sized`
37
38 error[E0080]: evaluation of `Inline::<dyn std::fmt::Debug>::{constant#0}` failed
39   --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
40    |
41 LL |     intrinsics::size_of::<T>()
42    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
43    |     |
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
46    |
47   ::: $DIR/issue-80742.rs:15:10
48    |
49 LL |     [u8; size_of::<T>() + 1]: ,
50    |          -------------- inside `Inline::<dyn Debug>::{constant#0}` at $DIR/issue-80742.rs:15:10
51
52 error[E0277]: the size for values of type `dyn Debug` cannot be known at compilation time
53   --> $DIR/issue-80742.rs:31:15
54    |
55 LL | struct Inline<T>
56    |               - required by this bound in `Inline`
57 ...
58 LL |     let dst = Inline::<dyn Debug>::new(0);
59    |               ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
60    |
61    = help: the trait `Sized` is not implemented for `dyn Debug`
62 help: consider relaxing the implicit `Sized` restriction
63    |
64 LL | struct Inline<T: ?Sized>
65    |                ^^^^^^^^
66
67 error: aborting due to 4 previous errors
68
69 Some errors have detailed explanations: E0080, E0277, E0599.
70 For more information about an error, try `rustc --explain E0080`.