fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum49cae55760d

1.44.0
3.3 KiB72 linesraw
1error[E0277]: the size for values of type `X` cannot be known at compilation time
2  --> $DIR/unsized5.rs:4:5
3   |
4LL | struct S1<X: ?Sized> {
5   |           - this type parameter needs to be `std::marker::Sized`
6LL |     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
13error[E0277]: the size for values of type `X` cannot be known at compilation time
14  --> $DIR/unsized5.rs:10:5
15   |
16LL | struct S2<X: ?Sized> {
17   |           - this type parameter needs to be `std::marker::Sized`
18LL |     f: isize,
19LL |     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
26error[E0277]: the size for values of type `str` cannot be known at compilation time
27  --> $DIR/unsized5.rs:15:5
28   |
29LL |     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
36error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
37  --> $DIR/unsized5.rs:20:5
38   |
39LL |     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
46error[E0277]: the size for values of type `X` cannot be known at compilation time
47  --> $DIR/unsized5.rs:25:8
48   |
49LL | enum E<X: ?Sized> {
50   |        - this type parameter needs to be `std::marker::Sized`
51LL |     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
58error[E0277]: the size for values of type `X` cannot be known at compilation time
59  --> $DIR/unsized5.rs:29:8
60   |
61LL | enum F<X: ?Sized> {
62   |        - this type parameter needs to be `std::marker::Sized`
63LL |     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
70error: aborting due to 6 previous errors
71
72For more information about this error, try `rustc --explain E0277`.