]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/const-argument-if-length.min.stderr
Rollup merge of #78332 - PoignardAzur:doc_E0308, r=camelid
[rust.git] / src / test / ui / const-generics / const-argument-if-length.min.stderr
1 error: generic parameters may not be used in const operations
2   --> $DIR/const-argument-if-length.rs:19:24
3    |
4 LL |     pad: [u8; is_zst::<T>()],
5    |                        ^ cannot perform const operation using `T`
6    |
7    = note: type parameters may not be used in const expressions
8
9 error[E0277]: the size for values of type `T` cannot be known at compilation time
10   --> $DIR/const-argument-if-length.rs:17:12
11    |
12 LL | pub struct AtLeastByte<T: ?Sized> {
13    |                        - this type parameter needs to be `Sized`
14 LL |     value: T,
15    |            ^ doesn't have a size known at compile-time
16    |
17    = note: only the last field of a struct may have a dynamically sized type
18    = help: change the field's type to have a statically known size
19 help: borrowed types always have a statically known size
20    |
21 LL |     value: &T,
22    |            ^
23 help: the `Box` type always has a statically known size and allocates its contents in the heap
24    |
25 LL |     value: Box<T>,
26    |            ^^^^ ^
27
28 error: aborting due to 2 previous errors
29
30 For more information about this error, try `rustc --explain E0277`.