]> git.lizzy.rs Git - rust.git/blob - src/test/ui/union/union-sized-field.stderr
62dacd064bed0b63ee047bdc105bbc4faeaa1d3b
[rust.git] / src / test / ui / union / union-sized-field.stderr
1 error[E0277]: the size for values of type `T` cannot be known at compilation time
2   --> $DIR/union-sized-field.rs:4:5
3    |
4 LL | union Foo<T: ?Sized> {
5    |           - this type parameter needs to be `std::marker::Sized`
6 LL |     value: T,
7    |     ^^^^^^^^ doesn't have a size known at compile-time
8    |
9    = help: the trait `std::marker::Sized` is not implemented for `T`
10    = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
11    = note: no field of a union may have a dynamically sized type
12
13 error[E0277]: the size for values of type `T` cannot be known at compilation time
14   --> $DIR/union-sized-field.rs:9:5
15    |
16 LL | struct Foo2<T: ?Sized> {
17    |             - this type parameter needs to be `std::marker::Sized`
18 LL |     value: T,
19    |     ^^^^^^^^ doesn't have a size known at compile-time
20    |
21    = help: the trait `std::marker::Sized` is not implemented for `T`
22    = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
23    = note: only the last field of a struct may have a dynamically sized type
24
25 error[E0277]: the size for values of type `T` cannot be known at compilation time
26   --> $DIR/union-sized-field.rs:15:11
27    |
28 LL | enum Foo3<T: ?Sized> {
29    |           - this type parameter needs to be `std::marker::Sized`
30 LL |     Value(T),
31    |           ^ doesn't have a size known at compile-time
32    |
33    = help: the trait `std::marker::Sized` is not implemented for `T`
34    = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
35    = note: no field of an enum variant may have a dynamically sized type
36
37 error: aborting due to 3 previous errors
38
39 For more information about this error, try `rustc --explain E0277`.