@@ -6,38 +6,158 @@ LL | nested: &'static Bar<dyn std::fmt::Debug>,
66 |
77 = help: the trait `Sized` is not implemented for `(dyn Debug + 'static)`
88note: 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
1010 |
1111LL | struct Bar<T>(T);
1212 | ^ required by the implicit `Sized` requirement on this type parameter in `Bar`
1313help: 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
1515 |
1616LL | struct Bar<T>(T);
1717 | ^ - ...if indirection were used here: `Box<T>`
1818 | |
1919 | this could be changed to `T: ?Sized`...
2020
2121error[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
2323 |
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
2626 |
2727 = help: the trait `Sized` is not implemented for `(dyn Debug + 'static)`
2828note: 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
3030 |
3131LL | struct Bar<T>(T);
3232 | ^ required by the implicit `Sized` requirement on this type parameter in `Bar`
3333help: 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
3535 |
3636LL | struct Bar<T>(T);
3737 | ^ - ...if indirection were used here: `Box<T>`
3838 | |
3939 | this could be changed to `T: ?Sized`...
4040
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
42162
43163For more information about this error, try `rustc --explain E0277`.
0 commit comments