@@ -36,37 +36,37 @@ LL | fn cycle1() -> impl Clone {
3636 | ^^^^^^^^^^^^^^^^^^^^^^^^^
3737 = note: ...which requires evaluating trait selection obligation `impl std::clone::Clone: std::marker::Send`...
3838note: ...which requires computing type of `cycle2::{{opaque}}#0`...
39- --> $DIR/auto-trait-leak.rs:22 :16
39+ --> $DIR/auto-trait-leak.rs:20 :16
4040 |
4141LL | fn cycle2() -> impl Clone {
4242 | ^^^^^^^^^^
4343note: ...which requires borrow-checking `cycle2`...
44- --> $DIR/auto-trait-leak.rs:22 :1
44+ --> $DIR/auto-trait-leak.rs:20 :1
4545 |
4646LL | fn cycle2() -> impl Clone {
4747 | ^^^^^^^^^^^^^^^^^^^^^^^^^
4848note: ...which requires processing `cycle2`...
49- --> $DIR/auto-trait-leak.rs:22 :1
49+ --> $DIR/auto-trait-leak.rs:20 :1
5050 |
5151LL | fn cycle2() -> impl Clone {
5252 | ^^^^^^^^^^^^^^^^^^^^^^^^^
5353note: ...which requires processing MIR for `cycle2`...
54- --> $DIR/auto-trait-leak.rs:22 :1
54+ --> $DIR/auto-trait-leak.rs:20 :1
5555 |
5656LL | fn cycle2() -> impl Clone {
5757 | ^^^^^^^^^^^^^^^^^^^^^^^^^
5858note: ...which requires unsafety-checking `cycle2`...
59- --> $DIR/auto-trait-leak.rs:22 :1
59+ --> $DIR/auto-trait-leak.rs:20 :1
6060 |
6161LL | fn cycle2() -> impl Clone {
6262 | ^^^^^^^^^^^^^^^^^^^^^^^^^
6363note: ...which requires building MIR for `cycle2`...
64- --> $DIR/auto-trait-leak.rs:22 :1
64+ --> $DIR/auto-trait-leak.rs:20 :1
6565 |
6666LL | fn cycle2() -> impl Clone {
6767 | ^^^^^^^^^^^^^^^^^^^^^^^^^
6868note: ...which requires type-checking `cycle2`...
69- --> $DIR/auto-trait-leak.rs:22 :1
69+ --> $DIR/auto-trait-leak.rs:20 :1
7070 |
7171LL | fn cycle2() -> impl Clone {
7272 | ^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -84,178 +84,8 @@ LL | | Rc::new(String::from("foo"))
8484LL | | }
8585 | |_^
8686
87- error[E0391]: cycle detected when computing type of `cycle1::{{opaque}}#0`
88- --> $DIR/auto-trait-leak.rs:12:16
89- |
90- LL | fn cycle1() -> impl Clone {
91- | ^^^^^^^^^^
92- |
93- note: ...which requires borrow-checking `cycle1`...
94- --> $DIR/auto-trait-leak.rs:12:1
95- |
96- LL | fn cycle1() -> impl Clone {
97- | ^^^^^^^^^^^^^^^^^^^^^^^^^
98- note: ...which requires processing `cycle1`...
99- --> $DIR/auto-trait-leak.rs:12:1
100- |
101- LL | fn cycle1() -> impl Clone {
102- | ^^^^^^^^^^^^^^^^^^^^^^^^^
103- note: ...which requires processing MIR for `cycle1`...
104- --> $DIR/auto-trait-leak.rs:12:1
105- |
106- LL | fn cycle1() -> impl Clone {
107- | ^^^^^^^^^^^^^^^^^^^^^^^^^
108- note: ...which requires unsafety-checking `cycle1`...
109- --> $DIR/auto-trait-leak.rs:12:1
110- |
111- LL | fn cycle1() -> impl Clone {
112- | ^^^^^^^^^^^^^^^^^^^^^^^^^
113- note: ...which requires building MIR for `cycle1`...
114- --> $DIR/auto-trait-leak.rs:12:1
115- |
116- LL | fn cycle1() -> impl Clone {
117- | ^^^^^^^^^^^^^^^^^^^^^^^^^
118- note: ...which requires type-checking `cycle1`...
119- --> $DIR/auto-trait-leak.rs:12:1
120- |
121- LL | fn cycle1() -> impl Clone {
122- | ^^^^^^^^^^^^^^^^^^^^^^^^^
123- = note: ...which requires evaluating trait selection obligation `impl std::clone::Clone: std::marker::Send`...
124- note: ...which requires computing type of `cycle2::{{opaque}}#0`...
125- --> $DIR/auto-trait-leak.rs:22:16
126- |
127- LL | fn cycle2() -> impl Clone {
128- | ^^^^^^^^^^
129- note: ...which requires borrow-checking `cycle2`...
130- --> $DIR/auto-trait-leak.rs:22:1
131- |
132- LL | fn cycle2() -> impl Clone {
133- | ^^^^^^^^^^^^^^^^^^^^^^^^^
134- note: ...which requires processing `cycle2`...
135- --> $DIR/auto-trait-leak.rs:22:1
136- |
137- LL | fn cycle2() -> impl Clone {
138- | ^^^^^^^^^^^^^^^^^^^^^^^^^
139- note: ...which requires processing MIR for `cycle2`...
140- --> $DIR/auto-trait-leak.rs:22:1
141- |
142- LL | fn cycle2() -> impl Clone {
143- | ^^^^^^^^^^^^^^^^^^^^^^^^^
144- note: ...which requires unsafety-checking `cycle2`...
145- --> $DIR/auto-trait-leak.rs:22:1
146- |
147- LL | fn cycle2() -> impl Clone {
148- | ^^^^^^^^^^^^^^^^^^^^^^^^^
149- note: ...which requires building MIR for `cycle2`...
150- --> $DIR/auto-trait-leak.rs:22:1
151- |
152- LL | fn cycle2() -> impl Clone {
153- | ^^^^^^^^^^^^^^^^^^^^^^^^^
154- note: ...which requires type-checking `cycle2`...
155- --> $DIR/auto-trait-leak.rs:22:1
156- |
157- LL | fn cycle2() -> impl Clone {
158- | ^^^^^^^^^^^^^^^^^^^^^^^^^
159- = note: ...which again requires computing type of `cycle1::{{opaque}}#0`, completing the cycle
160- note: cycle used when checking item types in top-level module
161- --> $DIR/auto-trait-leak.rs:1:1
162- |
163- LL | / use std::cell::Cell;
164- LL | | use std::rc::Rc;
165- LL | |
166- LL | | fn send<T: Send>(_: T) {}
167- ... |
168- LL | | Rc::new(String::from("foo"))
169- LL | | }
170- | |_^
171-
172- error[E0391]: cycle detected when computing type of `cycle1::{{opaque}}#0`
173- --> $DIR/auto-trait-leak.rs:12:16
174- |
175- LL | fn cycle1() -> impl Clone {
176- | ^^^^^^^^^^
177- |
178- note: ...which requires borrow-checking `cycle1`...
179- --> $DIR/auto-trait-leak.rs:12:1
180- |
181- LL | fn cycle1() -> impl Clone {
182- | ^^^^^^^^^^^^^^^^^^^^^^^^^
183- note: ...which requires processing `cycle1`...
184- --> $DIR/auto-trait-leak.rs:12:1
185- |
186- LL | fn cycle1() -> impl Clone {
187- | ^^^^^^^^^^^^^^^^^^^^^^^^^
188- note: ...which requires processing MIR for `cycle1`...
189- --> $DIR/auto-trait-leak.rs:12:1
190- |
191- LL | fn cycle1() -> impl Clone {
192- | ^^^^^^^^^^^^^^^^^^^^^^^^^
193- note: ...which requires unsafety-checking `cycle1`...
194- --> $DIR/auto-trait-leak.rs:12:1
195- |
196- LL | fn cycle1() -> impl Clone {
197- | ^^^^^^^^^^^^^^^^^^^^^^^^^
198- note: ...which requires building MIR for `cycle1`...
199- --> $DIR/auto-trait-leak.rs:12:1
200- |
201- LL | fn cycle1() -> impl Clone {
202- | ^^^^^^^^^^^^^^^^^^^^^^^^^
203- note: ...which requires type-checking `cycle1`...
204- --> $DIR/auto-trait-leak.rs:12:1
205- |
206- LL | fn cycle1() -> impl Clone {
207- | ^^^^^^^^^^^^^^^^^^^^^^^^^
208- = note: ...which requires evaluating trait selection obligation `impl std::clone::Clone: std::marker::Send`...
209- note: ...which requires computing type of `cycle2::{{opaque}}#0`...
210- --> $DIR/auto-trait-leak.rs:22:16
211- |
212- LL | fn cycle2() -> impl Clone {
213- | ^^^^^^^^^^
214- note: ...which requires borrow-checking `cycle2`...
215- --> $DIR/auto-trait-leak.rs:22:1
216- |
217- LL | fn cycle2() -> impl Clone {
218- | ^^^^^^^^^^^^^^^^^^^^^^^^^
219- note: ...which requires processing `cycle2`...
220- --> $DIR/auto-trait-leak.rs:22:1
221- |
222- LL | fn cycle2() -> impl Clone {
223- | ^^^^^^^^^^^^^^^^^^^^^^^^^
224- note: ...which requires processing MIR for `cycle2`...
225- --> $DIR/auto-trait-leak.rs:22:1
226- |
227- LL | fn cycle2() -> impl Clone {
228- | ^^^^^^^^^^^^^^^^^^^^^^^^^
229- note: ...which requires unsafety-checking `cycle2`...
230- --> $DIR/auto-trait-leak.rs:22:1
231- |
232- LL | fn cycle2() -> impl Clone {
233- | ^^^^^^^^^^^^^^^^^^^^^^^^^
234- note: ...which requires building MIR for `cycle2`...
235- --> $DIR/auto-trait-leak.rs:22:1
236- |
237- LL | fn cycle2() -> impl Clone {
238- | ^^^^^^^^^^^^^^^^^^^^^^^^^
239- note: ...which requires type-checking `cycle2`...
240- --> $DIR/auto-trait-leak.rs:22:1
241- |
242- LL | fn cycle2() -> impl Clone {
243- | ^^^^^^^^^^^^^^^^^^^^^^^^^
244- = note: ...which again requires computing type of `cycle1::{{opaque}}#0`, completing the cycle
245- note: cycle used when checking item types in top-level module
246- --> $DIR/auto-trait-leak.rs:1:1
247- |
248- LL | / use std::cell::Cell;
249- LL | | use std::rc::Rc;
250- LL | |
251- LL | | fn send<T: Send>(_: T) {}
252- ... |
253- LL | | Rc::new(String::from("foo"))
254- LL | | }
255- | |_^
256-
25787error[E0277]: `std::rc::Rc<std::string::String>` cannot be sent between threads safely
258- --> $DIR/auto-trait-leak.rs:16 :5
88+ --> $DIR/auto-trait-leak.rs:14 :5
25989 |
26090LL | fn send<T: Send>(_: T) {}
26191 | ---- required by this bound in `send`
@@ -269,7 +99,7 @@ LL | fn cycle2() -> impl Clone {
26999 = help: within `impl std::clone::Clone`, the trait `std::marker::Send` is not implemented for `std::rc::Rc<std::string::String>`
270100 = note: required because it appears within the type `impl std::clone::Clone`
271101
272- error: aborting due to 4 previous errors
102+ error: aborting due to 2 previous errors
273103
274104Some errors have detailed explanations: E0277, E0391.
275105For more information about an error, try `rustc --explain E0277`.
0 commit comments