rust/src/test/ui/union/union-sized-field.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

76 lines
2.5 KiB
Plaintext
Raw Normal View History

2018-07-10 21:10:13 +00:00
error[E0277]: the size for values of type `T` cannot be known at compilation time
--> $DIR/union-sized-field.rs:4:12
|
2019-10-08 18:03:35 +00:00
LL | union Foo<T: ?Sized> {
| - this type parameter needs to be `std::marker::Sized`
LL | value: T,
| ^ doesn't have a size known at compile-time
|
= note: no field of a union may have a dynamically sized type
= help: change the field's type to have a statically known size
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
LL - union Foo<T: ?Sized> {
LL + union Foo<T> {
2022-06-08 17:34:57 +00:00
|
help: borrowed types always have a statically known size
|
LL | value: &T,
| +
2020-07-14 19:18:01 +00:00
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | value: Box<T>,
| ++++ +
2018-07-10 21:10:13 +00:00
error[E0277]: the size for values of type `T` cannot be known at compilation time
--> $DIR/union-sized-field.rs:9:12
|
2019-10-08 18:03:35 +00:00
LL | struct Foo2<T: ?Sized> {
| - this type parameter needs to be `std::marker::Sized`
LL | value: T,
| ^ doesn't have a size known at compile-time
|
= note: only the last field of a struct may have a dynamically sized type
= help: change the field's type to have a statically known size
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
LL - struct Foo2<T: ?Sized> {
LL + struct Foo2<T> {
2022-06-08 17:34:57 +00:00
|
help: borrowed types always have a statically known size
|
LL | value: &T,
| +
2020-07-14 19:18:01 +00:00
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | value: Box<T>,
| ++++ +
2018-07-10 21:10:13 +00:00
error[E0277]: the size for values of type `T` cannot be known at compilation time
2018-12-25 15:56:47 +00:00
--> $DIR/union-sized-field.rs:15:11
|
2019-10-08 18:03:35 +00:00
LL | enum Foo3<T: ?Sized> {
| - this type parameter needs to be `std::marker::Sized`
LL | Value(T),
2018-06-19 22:53:51 +00:00
| ^ doesn't have a size known at compile-time
|
= note: no field of an enum variant may have a dynamically sized type
= help: change the field's type to have a statically known size
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
LL - enum Foo3<T: ?Sized> {
LL + enum Foo3<T> {
2022-06-08 17:34:57 +00:00
|
help: borrowed types always have a statically known size
|
LL | Value(&T),
| +
2020-07-14 19:18:01 +00:00
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | Value(Box<T>),
| ++++ +
error: aborting due to 3 previous errors
2018-03-03 14:59:40 +00:00
For more information about this error, try `rustc --explain E0277`.