@@ -6,38 +6,158 @@ LL | nested: &'static Bar<dyn std::fmt::Debug>,
6
6
|
7
7
= help: the trait `Sized` is not implemented for `(dyn Debug + 'static)`
8
8
note: required by an implicit `Sized` bound in `Bar`
9
- --> $DIR/field-implied-unsizing-wfcheck.rs:6 :12
9
+ --> $DIR/field-implied-unsizing-wfcheck.rs:19 :12
10
10
|
11
11
LL | struct Bar<T>(T);
12
12
| ^ required by the implicit `Sized` requirement on this type parameter in `Bar`
13
13
help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
14
- --> $DIR/field-implied-unsizing-wfcheck.rs:6 :12
14
+ --> $DIR/field-implied-unsizing-wfcheck.rs:19 :12
15
15
|
16
16
LL | struct Bar<T>(T);
17
17
| ^ - ...if indirection were used here: `Box<T>`
18
18
| |
19
19
| this could be changed to `T: ?Sized`...
20
20
21
21
error[E0277]: the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time
22
- --> $DIR/field-implied-unsizing-wfcheck.rs:9:27
22
+ --> $DIR/field-implied-unsizing-wfcheck.rs:6:17
23
23
|
24
- LL | let x = Foo { nested: &Bar(4) } ;
25
- | ^^^^^^^ doesn't have a size known at compile-time
24
+ LL | struct FooTuple(&'static Bar<dyn std::fmt::Debug>) ;
25
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^ doesn't have a size known at compile-time
26
26
|
27
27
= help: the trait `Sized` is not implemented for `(dyn Debug + 'static)`
28
28
note: required by an implicit `Sized` bound in `Bar`
29
- --> $DIR/field-implied-unsizing-wfcheck.rs:6 :12
29
+ --> $DIR/field-implied-unsizing-wfcheck.rs:19 :12
30
30
|
31
31
LL | struct Bar<T>(T);
32
32
| ^ required by the implicit `Sized` requirement on this type parameter in `Bar`
33
33
help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
34
- --> $DIR/field-implied-unsizing-wfcheck.rs:6 :12
34
+ --> $DIR/field-implied-unsizing-wfcheck.rs:19 :12
35
35
|
36
36
LL | struct Bar<T>(T);
37
37
| ^ - ...if indirection were used here: `Box<T>`
38
38
| |
39
39
| this could be changed to `T: ?Sized`...
40
40
41
- error: aborting due to 2 previous errors
41
+ error[E0277]: the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time
42
+ --> $DIR/field-implied-unsizing-wfcheck.rs:10:22
43
+ |
44
+ LL | Struct { nested: &'static Bar<dyn std::fmt::Debug> },
45
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
46
+ |
47
+ = help: the trait `Sized` is not implemented for `(dyn Debug + 'static)`
48
+ note: required by an implicit `Sized` bound in `Bar`
49
+ --> $DIR/field-implied-unsizing-wfcheck.rs:19:12
50
+ |
51
+ LL | struct Bar<T>(T);
52
+ | ^ required by the implicit `Sized` requirement on this type parameter in `Bar`
53
+ help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
54
+ --> $DIR/field-implied-unsizing-wfcheck.rs:19:12
55
+ |
56
+ LL | struct Bar<T>(T);
57
+ | ^ - ...if indirection were used here: `Box<T>`
58
+ | |
59
+ | this could be changed to `T: ?Sized`...
60
+
61
+ error[E0277]: the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time
62
+ --> $DIR/field-implied-unsizing-wfcheck.rs:15:11
63
+ |
64
+ LL | Tuple(&'static Bar<dyn std::fmt::Debug>),
65
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
66
+ |
67
+ = help: the trait `Sized` is not implemented for `(dyn Debug + 'static)`
68
+ note: required by an implicit `Sized` bound in `Bar`
69
+ --> $DIR/field-implied-unsizing-wfcheck.rs:19:12
70
+ |
71
+ LL | struct Bar<T>(T);
72
+ | ^ required by the implicit `Sized` requirement on this type parameter in `Bar`
73
+ help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
74
+ --> $DIR/field-implied-unsizing-wfcheck.rs:19:12
75
+ |
76
+ LL | struct Bar<T>(T);
77
+ | ^ - ...if indirection were used here: `Box<T>`
78
+ | |
79
+ | this could be changed to `T: ?Sized`...
80
+
81
+ error[E0277]: the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time
82
+ --> $DIR/field-implied-unsizing-wfcheck.rs:24:25
83
+ |
84
+ LL | FooStruct { nested: &Bar(4) };
85
+ | ^^^^^^^ doesn't have a size known at compile-time
86
+ |
87
+ = help: the trait `Sized` is not implemented for `(dyn Debug + 'static)`
88
+ note: required by an implicit `Sized` bound in `Bar`
89
+ --> $DIR/field-implied-unsizing-wfcheck.rs:19:12
90
+ |
91
+ LL | struct Bar<T>(T);
92
+ | ^ required by the implicit `Sized` requirement on this type parameter in `Bar`
93
+ help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
94
+ --> $DIR/field-implied-unsizing-wfcheck.rs:19:12
95
+ |
96
+ LL | struct Bar<T>(T);
97
+ | ^ - ...if indirection were used here: `Box<T>`
98
+ | |
99
+ | this could be changed to `T: ?Sized`...
100
+
101
+ error[E0277]: the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time
102
+ --> $DIR/field-implied-unsizing-wfcheck.rs:26:14
103
+ |
104
+ LL | FooTuple(&Bar(4));
105
+ | ^^^^^^^ doesn't have a size known at compile-time
106
+ |
107
+ = help: the trait `Sized` is not implemented for `(dyn Debug + 'static)`
108
+ note: required by an implicit `Sized` bound in `Bar`
109
+ --> $DIR/field-implied-unsizing-wfcheck.rs:19:12
110
+ |
111
+ LL | struct Bar<T>(T);
112
+ | ^ required by the implicit `Sized` requirement on this type parameter in `Bar`
113
+ help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
114
+ --> $DIR/field-implied-unsizing-wfcheck.rs:19:12
115
+ |
116
+ LL | struct Bar<T>(T);
117
+ | ^ - ...if indirection were used here: `Box<T>`
118
+ | |
119
+ | this could be changed to `T: ?Sized`...
120
+
121
+ error[E0277]: the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time
122
+ --> $DIR/field-implied-unsizing-wfcheck.rs:28:32
123
+ |
124
+ LL | FooEnum1::Struct { nested: &Bar(4) };
125
+ | ^^^^^^^ doesn't have a size known at compile-time
126
+ |
127
+ = help: the trait `Sized` is not implemented for `(dyn Debug + 'static)`
128
+ note: required by an implicit `Sized` bound in `Bar`
129
+ --> $DIR/field-implied-unsizing-wfcheck.rs:19:12
130
+ |
131
+ LL | struct Bar<T>(T);
132
+ | ^ required by the implicit `Sized` requirement on this type parameter in `Bar`
133
+ help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
134
+ --> $DIR/field-implied-unsizing-wfcheck.rs:19:12
135
+ |
136
+ LL | struct Bar<T>(T);
137
+ | ^ - ...if indirection were used here: `Box<T>`
138
+ | |
139
+ | this could be changed to `T: ?Sized`...
140
+
141
+ error[E0277]: the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time
142
+ --> $DIR/field-implied-unsizing-wfcheck.rs:30:21
143
+ |
144
+ LL | FooEnum2::Tuple(&Bar(4));
145
+ | ^^^^^^^ doesn't have a size known at compile-time
146
+ |
147
+ = help: the trait `Sized` is not implemented for `(dyn Debug + 'static)`
148
+ note: required by an implicit `Sized` bound in `Bar`
149
+ --> $DIR/field-implied-unsizing-wfcheck.rs:19:12
150
+ |
151
+ LL | struct Bar<T>(T);
152
+ | ^ required by the implicit `Sized` requirement on this type parameter in `Bar`
153
+ help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
154
+ --> $DIR/field-implied-unsizing-wfcheck.rs:19:12
155
+ |
156
+ LL | struct Bar<T>(T);
157
+ | ^ - ...if indirection were used here: `Box<T>`
158
+ | |
159
+ | this could be changed to `T: ?Sized`...
160
+
161
+ error: aborting due to 8 previous errors
42
162
43
163
For more information about this error, try `rustc --explain E0277`.
0 commit comments