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