]> git.proxmox.com Git - rustc.git/blame - src/test/ui/suggestions/adt-param-with-implicit-sized-bound.stderr
New upstream version 1.53.0+dfsg1
[rustc.git] / src / test / ui / suggestions / adt-param-with-implicit-sized-bound.stderr
CommitLineData
f035d41b 1error[E0277]: the size for values of type `T` cannot be known at compilation time
3dfed10e 2 --> $DIR/adt-param-with-implicit-sized-bound.rs:25:9
f035d41b
XL
3 |
4LL | struct X<T>(T);
5 | - required by this bound in `X`
6...
7LL | struct Struct5<T: ?Sized>{
cdc7bbd5 8 | - this type parameter needs to be `std::marker::Sized`
f035d41b 9LL | _t: X<T>,
3dfed10e 10 | ^^^^ doesn't have a size known at compile-time
f035d41b 11 |
f035d41b
XL
12help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
13 --> $DIR/adt-param-with-implicit-sized-bound.rs:18:10
14 |
15LL | struct X<T>(T);
6a06907d 16 | ^ - ...if indirection were used here: `Box<T>`
f035d41b
XL
17 | |
18 | this could be changed to `T: ?Sized`...
19
20error[E0277]: the size for values of type `Self` cannot be known at compilation time
21 --> $DIR/adt-param-with-implicit-sized-bound.rs:2:19
22 |
23LL | fn func1() -> Struct1<Self>;
24 | ^^^^^^^^^^^^^ doesn't have a size known at compile-time
25...
26LL | struct Struct1<T>{
27 | - required by this bound in `Struct1`
28 |
f035d41b
XL
29help: consider further restricting `Self`
30 |
1b1a35ee
XL
31LL | fn func1() -> Struct1<Self> where Self: Sized;
32 | ^^^^^^^^^^^^^^^^^
f035d41b
XL
33help: consider relaxing the implicit `Sized` restriction
34 |
35LL | struct Struct1<T: ?Sized>{
36 | ^^^^^^^^
37
38error[E0277]: the size for values of type `Self` cannot be known at compilation time
39 --> $DIR/adt-param-with-implicit-sized-bound.rs:3:23
40 |
41LL | fn func2<'a>() -> Struct2<'a, Self>;
42 | ^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
43...
44LL | struct Struct2<'a, T>{
45 | - required by this bound in `Struct2`
46 |
f035d41b
XL
47help: consider further restricting `Self`
48 |
1b1a35ee
XL
49LL | fn func2<'a>() -> Struct2<'a, Self> where Self: Sized;
50 | ^^^^^^^^^^^^^^^^^
f035d41b
XL
51help: consider relaxing the implicit `Sized` restriction
52 |
53LL | struct Struct2<'a, T: ?Sized>{
54 | ^^^^^^^^
55
56error[E0277]: the size for values of type `Self` cannot be known at compilation time
57 --> $DIR/adt-param-with-implicit-sized-bound.rs:4:19
58 |
59LL | fn func3() -> Struct3<Self>;
60 | ^^^^^^^^^^^^^ doesn't have a size known at compile-time
61...
62LL | struct Struct3<T>{
63 | - required by this bound in `Struct3`
64 |
f035d41b
XL
65help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
66 --> $DIR/adt-param-with-implicit-sized-bound.rs:14:16
67 |
68LL | struct Struct3<T>{
69 | ^ this could be changed to `T: ?Sized`...
70LL | _t: T,
6a06907d 71 | - ...if indirection were used here: `Box<T>`
f035d41b
XL
72help: consider further restricting `Self`
73 |
1b1a35ee
XL
74LL | fn func3() -> Struct3<Self> where Self: Sized;
75 | ^^^^^^^^^^^^^^^^^
f035d41b
XL
76
77error[E0277]: the size for values of type `Self` cannot be known at compilation time
78 --> $DIR/adt-param-with-implicit-sized-bound.rs:5:19
79 |
80LL | fn func4() -> Struct4<Self>;
81 | ^^^^^^^^^^^^^ doesn't have a size known at compile-time
82...
83LL | struct Struct4<T>{
84 | - required by this bound in `Struct4`
85 |
f035d41b
XL
86help: consider further restricting `Self`
87 |
1b1a35ee
XL
88LL | fn func4() -> Struct4<Self> where Self: Sized;
89 | ^^^^^^^^^^^^^^^^^
f035d41b
XL
90help: consider relaxing the implicit `Sized` restriction
91 |
92LL | struct Struct4<T: ?Sized>{
93 | ^^^^^^^^
94
95error: aborting due to 5 previous errors
96
97For more information about this error, try `rustc --explain E0277`.