1
- error[E0277]: the size for values of type `B ` cannot be known at compilation time
1
+ error[E0277]: the size for values of type `A ` cannot be known at compilation time
2
2
--> $DIR/unsized-bound.rs:2:30
3
3
|
4
4
LL | impl<A, B> Trait<(A, B)> for (A, B) where A: ?Sized, B: ?Sized, {}
5
- | - ^^^^^^ doesn't have a size known at compile-time
6
- | |
7
- | this type parameter needs to be `Sized`
5
+ | - ^^^^^^ doesn't have a size known at compile-time
6
+ | |
7
+ | this type parameter needs to be `Sized`
8
8
|
9
9
= note: required because it appears within the type `(A, B)`
10
10
note: required by an implicit `Sized` bound in `Trait`
@@ -15,35 +15,42 @@ LL | trait Trait<A> {}
15
15
help: consider removing the `?Sized` bound to make the type parameter `Sized`
16
16
|
17
17
LL - impl<A, B> Trait<(A, B)> for (A, B) where A: ?Sized, B: ?Sized, {}
18
- LL + impl<A, B> Trait<(A, B)> for (A, B) where A : ?Sized, {}
18
+ LL + impl<A, B> Trait<(A, B)> for (A, B) where B : ?Sized, {}
19
19
|
20
20
help: consider relaxing the implicit `Sized` restriction
21
21
|
22
22
LL | trait Trait<A: ?Sized> {}
23
23
| ++++++++
24
24
25
- error[E0277]: the size for values of type `A ` cannot be known at compilation time
25
+ error[E0277]: the size for values of type `B ` cannot be known at compilation time
26
26
--> $DIR/unsized-bound.rs:2:30
27
27
|
28
28
LL | impl<A, B> Trait<(A, B)> for (A, B) where A: ?Sized, B: ?Sized, {}
29
- | - ^^^^^^ doesn't have a size known at compile-time
30
- | |
31
- | this type parameter needs to be `Sized`
29
+ | - ^^^^^^ doesn't have a size known at compile-time
30
+ | |
31
+ | this type parameter needs to be `Sized`
32
32
|
33
- = note: only the last element of a tuple may have a dynamically sized type
33
+ = note: required because it appears within the type `(A, B)`
34
+ note: required by an implicit `Sized` bound in `Trait`
35
+ --> $DIR/unsized-bound.rs:1:13
36
+ |
37
+ LL | trait Trait<A> {}
38
+ | ^ required by the implicit `Sized` requirement on this type parameter in `Trait`
34
39
help: consider removing the `?Sized` bound to make the type parameter `Sized`
35
40
|
36
41
LL - impl<A, B> Trait<(A, B)> for (A, B) where A: ?Sized, B: ?Sized, {}
37
- LL + impl<A, B> Trait<(A, B)> for (A, B) where B : ?Sized, {}
42
+ LL + impl<A, B> Trait<(A, B)> for (A, B) where A : ?Sized, {}
38
43
|
44
+ help: consider relaxing the implicit `Sized` restriction
45
+ |
46
+ LL | trait Trait<A: ?Sized> {}
47
+ | ++++++++
39
48
40
- error[E0277]: the size for values of type `C ` cannot be known at compilation time
49
+ error[E0277]: the size for values of type `A ` cannot be known at compilation time
41
50
--> $DIR/unsized-bound.rs:5:52
42
51
|
43
52
LL | impl<A, B: ?Sized, C: ?Sized> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
44
- | - ^^^^^^^^^ doesn't have a size known at compile-time
45
- | |
46
- | this type parameter needs to be `Sized`
53
+ | - this type parameter needs to be `Sized` ^^^^^^^^^ doesn't have a size known at compile-time
47
54
|
48
55
= note: required because it appears within the type `(A, B, C)`
49
56
note: required by an implicit `Sized` bound in `Trait`
@@ -54,46 +61,66 @@ LL | trait Trait<A> {}
54
61
help: consider removing the `?Sized` bound to make the type parameter `Sized`
55
62
|
56
63
LL - impl<A, B: ?Sized, C: ?Sized> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
57
- LL + impl<A, B: ?Sized, C> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
64
+ LL + impl<A, B: ?Sized, C: ?Sized > Trait<(A, B, C)> for (A, B, C) {}
58
65
|
59
66
help: consider relaxing the implicit `Sized` restriction
60
67
|
61
68
LL | trait Trait<A: ?Sized> {}
62
69
| ++++++++
63
70
64
- error[E0277]: the size for values of type `A ` cannot be known at compilation time
71
+ error[E0277]: the size for values of type `B ` cannot be known at compilation time
65
72
--> $DIR/unsized-bound.rs:5:52
66
73
|
67
74
LL | impl<A, B: ?Sized, C: ?Sized> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
68
- | - this type parameter needs to be `Sized` ^^^^^^^^^ doesn't have a size known at compile-time
75
+ | - this type parameter needs to be `Sized` ^^^^^^^^^ doesn't have a size known at compile-time
76
+ |
77
+ = note: required because it appears within the type `(A, B, C)`
78
+ note: required by an implicit `Sized` bound in `Trait`
79
+ --> $DIR/unsized-bound.rs:1:13
69
80
|
70
- = note: only the last element of a tuple may have a dynamically sized type
81
+ LL | trait Trait<A> {}
82
+ | ^ required by the implicit `Sized` requirement on this type parameter in `Trait`
71
83
help: consider removing the `?Sized` bound to make the type parameter `Sized`
72
84
|
73
85
LL - impl<A, B: ?Sized, C: ?Sized> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
74
- LL + impl<A, B: ?Sized, C: ?Sized> Trait<(A, B, C)> for (A, B, C) {}
86
+ LL + impl<A, B, C: ?Sized> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
87
+ |
88
+ help: consider relaxing the implicit `Sized` restriction
75
89
|
90
+ LL | trait Trait<A: ?Sized> {}
91
+ | ++++++++
76
92
77
- error[E0277]: the size for values of type `B ` cannot be known at compilation time
93
+ error[E0277]: the size for values of type `C ` cannot be known at compilation time
78
94
--> $DIR/unsized-bound.rs:5:52
79
95
|
80
96
LL | impl<A, B: ?Sized, C: ?Sized> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
81
- | - this type parameter needs to be `Sized` ^^^^^^^^^ doesn't have a size known at compile-time
97
+ | - ^^^^^^^^^ doesn't have a size known at compile-time
98
+ | |
99
+ | this type parameter needs to be `Sized`
100
+ |
101
+ = note: required because it appears within the type `(A, B, C)`
102
+ note: required by an implicit `Sized` bound in `Trait`
103
+ --> $DIR/unsized-bound.rs:1:13
82
104
|
83
- = note: only the last element of a tuple may have a dynamically sized type
105
+ LL | trait Trait<A> {}
106
+ | ^ required by the implicit `Sized` requirement on this type parameter in `Trait`
84
107
help: consider removing the `?Sized` bound to make the type parameter `Sized`
85
108
|
86
109
LL - impl<A, B: ?Sized, C: ?Sized> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
87
- LL + impl<A, B, C : ?Sized> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
110
+ LL + impl<A, B: ?Sized, C > Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
88
111
|
112
+ help: consider relaxing the implicit `Sized` restriction
113
+ |
114
+ LL | trait Trait<A: ?Sized> {}
115
+ | ++++++++
89
116
90
- error[E0277]: the size for values of type `B ` cannot be known at compilation time
117
+ error[E0277]: the size for values of type `A ` cannot be known at compilation time
91
118
--> $DIR/unsized-bound.rs:10:47
92
119
|
93
120
LL | impl<A: ?Sized, B: ?Sized> Trait2<(A, B)> for (A, B) {}
94
- | - ^^^^^^ doesn't have a size known at compile-time
95
- | |
96
- | this type parameter needs to be `Sized`
121
+ | - ^^^^^^ doesn't have a size known at compile-time
122
+ | |
123
+ | this type parameter needs to be `Sized`
97
124
|
98
125
= note: required because it appears within the type `(A, B)`
99
126
note: required by an implicit `Sized` bound in `Trait2`
@@ -104,27 +131,36 @@ LL | trait Trait2<A> {}
104
131
help: consider removing the `?Sized` bound to make the type parameter `Sized`
105
132
|
106
133
LL - impl<A: ?Sized, B: ?Sized> Trait2<(A, B)> for (A, B) {}
107
- LL + impl<A: ?Sized, B > Trait2<(A, B)> for (A, B) {}
134
+ LL + impl<A, B : ?Sized> Trait2<(A, B)> for (A, B) {}
108
135
|
109
136
help: consider relaxing the implicit `Sized` restriction
110
137
|
111
138
LL | trait Trait2<A: ?Sized> {}
112
139
| ++++++++
113
140
114
- error[E0277]: the size for values of type `A ` cannot be known at compilation time
141
+ error[E0277]: the size for values of type `B ` cannot be known at compilation time
115
142
--> $DIR/unsized-bound.rs:10:47
116
143
|
117
144
LL | impl<A: ?Sized, B: ?Sized> Trait2<(A, B)> for (A, B) {}
118
- | - ^^^^^^ doesn't have a size known at compile-time
119
- | |
120
- | this type parameter needs to be `Sized`
145
+ | - ^^^^^^ doesn't have a size known at compile-time
146
+ | |
147
+ | this type parameter needs to be `Sized`
121
148
|
122
- = note: only the last element of a tuple may have a dynamically sized type
149
+ = note: required because it appears within the type `(A, B)`
150
+ note: required by an implicit `Sized` bound in `Trait2`
151
+ --> $DIR/unsized-bound.rs:9:14
152
+ |
153
+ LL | trait Trait2<A> {}
154
+ | ^ required by the implicit `Sized` requirement on this type parameter in `Trait2`
123
155
help: consider removing the `?Sized` bound to make the type parameter `Sized`
124
156
|
125
157
LL - impl<A: ?Sized, B: ?Sized> Trait2<(A, B)> for (A, B) {}
126
- LL + impl<A, B: ?Sized> Trait2<(A, B)> for (A, B) {}
158
+ LL + impl<A: ?Sized, B> Trait2<(A, B)> for (A, B) {}
159
+ |
160
+ help: consider relaxing the implicit `Sized` restriction
127
161
|
162
+ LL | trait Trait2<A: ?Sized> {}
163
+ | ++++++++
128
164
129
165
error[E0277]: the size for values of type `A` cannot be known at compilation time
130
166
--> $DIR/unsized-bound.rs:14:23
0 commit comments