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 help: consider removing the `?Sized` bound to make the type parameter `Sized`
16 LL | pub const fn is_zst<T>() -> usize {
19 error[E0277]: the size for values of type `T` cannot be known at compilation time
20 --> $DIR/const-argument-if-length.rs:16:12
22 LL | pub struct AtLeastByte<T: ?Sized> {
23 | - this type parameter needs to be `std::marker::Sized`
25 | ^ doesn't have a size known at compile-time
27 = note: only the last field of a struct may have a dynamically sized type
28 = help: change the field's type to have a statically known size
29 help: consider removing the `?Sized` bound to make the type parameter `Sized`
31 LL | pub struct AtLeastByte<T> {
33 help: borrowed types always have a statically known size
37 help: the `Box` type always has a statically known size and allocates its contents in the heap
42 error: aborting due to 2 previous errors
44 For more information about this error, try `rustc --explain E0277`.