rust/src/test/ui/unsized5.stderr

73 lines
3.3 KiB
Plaintext
Raw Normal View History

2018-08-08 07:28:26 -05:00
error[E0277]: the size for values of type `X` cannot be known at compilation time
2018-12-25 09:56:47 -06:00
--> $DIR/unsized5.rs:4:5
2018-08-08 07:28:26 -05:00
|
2019-10-08 13:03:35 -05:00
LL | struct S1<X: ?Sized> {
| - this type parameter needs to be `std::marker::Sized`
2018-08-08 07:28:26 -05:00
LL | f1: X,
| ^^^^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `X`
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
2018-08-08 07:28:26 -05:00
= note: only the last field of a struct may have a dynamically sized type
error[E0277]: the size for values of type `X` cannot be known at compilation time
2018-12-25 09:56:47 -06:00
--> $DIR/unsized5.rs:10:5
2018-08-08 07:28:26 -05:00
|
2019-10-08 13:03:35 -05:00
LL | struct S2<X: ?Sized> {
| - this type parameter needs to be `std::marker::Sized`
2019-10-08 13:03:35 -05:00
LL | f: isize,
2018-08-08 07:28:26 -05:00
LL | g: X,
| ^^^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `X`
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
2018-08-08 07:28:26 -05:00
= note: only the last field of a struct may have a dynamically sized type
error[E0277]: the size for values of type `str` cannot be known at compilation time
2018-12-25 09:56:47 -06:00
--> $DIR/unsized5.rs:15:5
2018-08-08 07:28:26 -05:00
|
LL | f: str,
| ^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `str`
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
2018-08-08 07:28:26 -05:00
= note: only the last field of a struct may have a dynamically sized type
error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
2018-12-25 09:56:47 -06:00
--> $DIR/unsized5.rs:20:5
2018-08-08 07:28:26 -05:00
|
LL | f: [u8],
| ^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `[u8]`
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
2018-08-08 07:28:26 -05:00
= note: only the last field of a struct may have a dynamically sized type
error[E0277]: the size for values of type `X` cannot be known at compilation time
2018-12-25 09:56:47 -06:00
--> $DIR/unsized5.rs:25:8
2018-08-08 07:28:26 -05:00
|
2019-10-08 13:03:35 -05:00
LL | enum E<X: ?Sized> {
| - this type parameter needs to be `std::marker::Sized`
2018-08-08 07:28:26 -05:00
LL | V1(X, isize),
| ^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `X`
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
2018-08-08 07:28:26 -05:00
= note: no field of an enum variant may have a dynamically sized type
error[E0277]: the size for values of type `X` cannot be known at compilation time
2018-12-25 09:56:47 -06:00
--> $DIR/unsized5.rs:29:8
2018-08-08 07:28:26 -05:00
|
2019-10-08 13:03:35 -05:00
LL | enum F<X: ?Sized> {
| - this type parameter needs to be `std::marker::Sized`
2018-08-08 07:28:26 -05:00
LL | V2{f1: X, f: isize},
| ^^^^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `X`
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
2018-08-08 07:28:26 -05:00
= note: no field of an enum variant may have a dynamically sized type
error: aborting due to 6 previous errors
For more information about this error, try `rustc --explain E0277`.