/
adt-param-with-implicit-sized-bound.stderr
107 lines (101 loc) · 4.68 KB
/
adt-param-with-implicit-sized-bound.stderr
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
error[E0277]: the size for values of type `T` cannot be known at compilation time
--> $DIR/adt-param-with-implicit-sized-bound.rs:25:5
|
LL | struct X<T>(T);
| - required by this bound in `X`
...
LL | struct Struct5<T: ?Sized>{
| - this type parameter needs to be `std::marker::Sized`
LL | _t: X<T>,
| ^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `T`
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
--> $DIR/adt-param-with-implicit-sized-bound.rs:18:10
|
LL | struct X<T>(T);
| ^ - ...if indirection was used here: `Box<T>`
| |
| this could be changed to `T: ?Sized`...
error[E0277]: the size for values of type `Self` cannot be known at compilation time
--> $DIR/adt-param-with-implicit-sized-bound.rs:2:19
|
LL | fn func1() -> Struct1<Self>;
| ^^^^^^^^^^^^^ doesn't have a size known at compile-time
...
LL | struct Struct1<T>{
| - required by this bound in `Struct1`
|
= help: the trait `std::marker::Sized` is not implemented for `Self`
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
help: consider further restricting `Self`
|
LL | fn func1() -> Struct1<Self> where Self: std::marker::Sized;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: consider relaxing the implicit `Sized` restriction
|
LL | struct Struct1<T: ?Sized>{
| ^^^^^^^^
error[E0277]: the size for values of type `Self` cannot be known at compilation time
--> $DIR/adt-param-with-implicit-sized-bound.rs:3:23
|
LL | fn func2<'a>() -> Struct2<'a, Self>;
| ^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
...
LL | struct Struct2<'a, T>{
| - required by this bound in `Struct2`
|
= help: the trait `std::marker::Sized` is not implemented for `Self`
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
help: consider further restricting `Self`
|
LL | fn func2<'a>() -> Struct2<'a, Self> where Self: std::marker::Sized;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: consider relaxing the implicit `Sized` restriction
|
LL | struct Struct2<'a, T: ?Sized>{
| ^^^^^^^^
error[E0277]: the size for values of type `Self` cannot be known at compilation time
--> $DIR/adt-param-with-implicit-sized-bound.rs:4:19
|
LL | fn func3() -> Struct3<Self>;
| ^^^^^^^^^^^^^ doesn't have a size known at compile-time
...
LL | struct Struct3<T>{
| - required by this bound in `Struct3`
|
= help: the trait `std::marker::Sized` is not implemented for `Self`
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
--> $DIR/adt-param-with-implicit-sized-bound.rs:14:16
|
LL | struct Struct3<T>{
| ^ this could be changed to `T: ?Sized`...
LL | _t: T,
| - ...if indirection was used here: `Box<T>`
help: consider further restricting `Self`
|
LL | fn func3() -> Struct3<Self> where Self: std::marker::Sized;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0277]: the size for values of type `Self` cannot be known at compilation time
--> $DIR/adt-param-with-implicit-sized-bound.rs:5:19
|
LL | fn func4() -> Struct4<Self>;
| ^^^^^^^^^^^^^ doesn't have a size known at compile-time
...
LL | struct Struct4<T>{
| - required by this bound in `Struct4`
|
= help: the trait `std::marker::Sized` is not implemented for `Self`
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
help: consider further restricting `Self`
|
LL | fn func4() -> Struct4<Self> where Self: std::marker::Sized;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: consider relaxing the implicit `Sized` restriction
|
LL | struct Struct4<T: ?Sized>{
| ^^^^^^^^
error: aborting due to 5 previous errors
For more information about this error, try `rustc --explain E0277`.