]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unsized5.stderr
de4da309791c0d5a928e510f27c52292476c571f
[rust.git] / src / test / ui / unsized5.stderr
1 error[E0277]: the size for values of type `X` cannot be known at compilation time
2   --> $DIR/unsized5.rs:4:5
3    |
4 LL | struct S1<X: ?Sized> {
5    |           - this type parameter needs to be `std::marker::Sized`
6 LL |     f1: X,
7    |     ^^^^^ doesn't have a size known at compile-time
8    |
9    = help: the trait `std::marker::Sized` is not implemented for `X`
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: only the last field of a struct may have a dynamically sized type
12
13 error[E0277]: the size for values of type `X` cannot be known at compilation time
14   --> $DIR/unsized5.rs:10:5
15    |
16 LL | struct S2<X: ?Sized> {
17    |           - this type parameter needs to be `std::marker::Sized`
18 LL |     f: isize,
19 LL |     g: X,
20    |     ^^^^ doesn't have a size known at compile-time
21    |
22    = help: the trait `std::marker::Sized` is not implemented for `X`
23    = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
24    = note: only the last field of a struct may have a dynamically sized type
25
26 error[E0277]: the size for values of type `str` cannot be known at compilation time
27   --> $DIR/unsized5.rs:15:5
28    |
29 LL |     f: str,
30    |     ^^^^^^ doesn't have a size known at compile-time
31    |
32    = help: the trait `std::marker::Sized` is not implemented for `str`
33    = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
34    = note: only the last field of a struct may have a dynamically sized type
35
36 error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
37   --> $DIR/unsized5.rs:20:5
38    |
39 LL |     f: [u8],
40    |     ^^^^^^^ doesn't have a size known at compile-time
41    |
42    = help: the trait `std::marker::Sized` is not implemented for `[u8]`
43    = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
44    = note: only the last field of a struct may have a dynamically sized type
45
46 error[E0277]: the size for values of type `X` cannot be known at compilation time
47   --> $DIR/unsized5.rs:25:8
48    |
49 LL | enum E<X: ?Sized> {
50    |        - this type parameter needs to be `std::marker::Sized`
51 LL |     V1(X, isize),
52    |        ^ doesn't have a size known at compile-time
53    |
54    = help: the trait `std::marker::Sized` is not implemented for `X`
55    = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
56    = note: no field of an enum variant may have a dynamically sized type
57
58 error[E0277]: the size for values of type `X` cannot be known at compilation time
59   --> $DIR/unsized5.rs:29:8
60    |
61 LL | enum F<X: ?Sized> {
62    |        - this type parameter needs to be `std::marker::Sized`
63 LL |     V2{f1: X, f: isize},
64    |        ^^^^^ doesn't have a size known at compile-time
65    |
66    = help: the trait `std::marker::Sized` is not implemented for `X`
67    = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
68    = note: no field of an enum variant may have a dynamically sized type
69
70 error: aborting due to 6 previous errors
71
72 For more information about this error, try `rustc --explain E0277`.