]> git.proxmox.com Git - rustc.git/blob - src/test/ui/const-generics/const-argument-if-length.min.stderr
New upstream version 1.51.0+dfsg1
[rustc.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:18: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 = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
9
10 error[E0277]: the size for values of type `T` cannot be known at compilation time
11 --> $DIR/const-argument-if-length.rs:16:12
12 |
13 LL | pub struct AtLeastByte<T: ?Sized> {
14 | - this type parameter needs to be `Sized`
15 LL | value: T,
16 | ^ doesn't have a size known at compile-time
17 |
18 = note: only the last field of a struct may have a dynamically sized type
19 = help: change the field's type to have a statically known size
20 help: borrowed types always have a statically known size
21 |
22 LL | value: &T,
23 | ^
24 help: the `Box` type always has a statically known size and allocates its contents in the heap
25 |
26 LL | value: Box<T>,
27 | ^^^^ ^
28
29 error: aborting due to 2 previous errors
30
31 For more information about this error, try `rustc --explain E0277`.