]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/generic_const_exprs/issue-80742.stderr
Move generic error message to separate branches
[rust.git] / src / test / ui / const-generics / generic_const_exprs / 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:22:10
11    |
12 LL |     [u8; size_of::<T>() + 1]: ,
13    |          -------------- inside `Inline::<dyn Debug>::{constant#0}` at $DIR/issue-80742.rs:22: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:30: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:14:10
48    |
49 LL |     [u8; size_of::<T>() + 1]: ,
50    |          -------------- inside `Inline::<dyn Debug>::{constant#0}` at $DIR/issue-80742.rs:14:10
51
52 error[E0277]: the size for values of type `dyn Debug` cannot be known at compilation time
53   --> $DIR/issue-80742.rs:30:15
54    |
55 LL |     let dst = Inline::<dyn Debug>::new(0);
56    |               ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
57    |
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
61    |
62 LL | struct Inline<T>
63    |               ^ required by this bound in `Inline`
64 help: consider relaxing the implicit `Sized` restriction
65    |
66 LL | struct Inline<T: ?Sized>
67    |                ++++++++
68
69 error: aborting due to 4 previous errors
70
71 Some errors have detailed explanations: E0080, E0277, E0599.
72 For more information about an error, try `rustc --explain E0080`.