1 error[E0277]: the size for values of type `T` cannot be known at compilation time
2 --> $DIR/const-argument-if-length.rs:7:28
4 LL | pub const fn is_zst<T: ?Sized>() -> usize {
5 | - this type parameter needs to be `std::marker::Sized`
6 LL | if std::mem::size_of::<T>() == 0 {
7 | ^ doesn't have a size known at compile-time
9 ::: $SRC_DIR/core/src/mem/mod.rs:LL:COL
11 LL | pub const fn size_of<T>() -> usize {
12 | - required by this bound in `std::mem::size_of`
14 error[E0277]: the size for values of type `T` cannot be known at compilation time
15 --> $DIR/const-argument-if-length.rs:16:12
17 LL | pub struct AtLeastByte<T: ?Sized> {
18 | - this type parameter needs to be `std::marker::Sized`
20 | ^ doesn't have a size known at compile-time
22 = note: only the last field of a struct may have a dynamically sized type
23 = help: change the field's type to have a statically known size
24 help: borrowed types always have a statically known size
28 help: the `Box` type always has a statically known size and allocates its contents in the heap
33 error: aborting due to 2 previous errors
35 For more information about this error, try `rustc --explain E0277`.