1- error[E0391]: cycle detected when processing `cycle1`
1+ error[E0391]: cycle detected when processing `cycle1::{{impl-Trait}}`
2+ --> $DIR/auto-trait-leak.rs:24:16
3+ |
4+ LL | fn cycle1() -> impl Clone {
5+ | ^^^^^^^^^^
6+ |
7+ note: ...which requires processing `cycle1`...
28 --> $DIR/auto-trait-leak.rs:24:1
39 |
410LL | fn cycle1() -> impl Clone {
511 | ^^^^^^^^^^^^^^^^^^^^^^^^^
612 |
713note: ...which requires evaluating trait selection obligation `impl std::clone::Clone: std::marker::Send`...
8- note: ...which requires processing `cycle2::{{exist- impl-Trait}}`...
9- --> $DIR/auto-trait-leak.rs:31 :16
14+ note: ...which requires processing `cycle2::{{impl-Trait}}`...
15+ --> $DIR/auto-trait-leak.rs:33 :16
1016 |
1117LL | fn cycle2() -> impl Clone {
1218 | ^^^^^^^^^^
@@ -16,13 +22,45 @@ note: ...which requires processing `cycle2`...
1622LL | fn cycle2() -> impl Clone {
1723 | ^^^^^^^^^^^^^^^^^^^^^^^^^
1824note: ...which requires evaluating trait selection obligation `impl std::clone::Clone: std::marker::Send`...
19- note: ...which requires processing `cycle1::{{exist-impl-Trait}}`...
25+ = note: ...which again requires processing `cycle1::{{impl-Trait}}`, completing the cycle
26+
27+ error[E0391]: cycle detected when processing `cycle1::{{impl-Trait}}`
2028 --> $DIR/auto-trait-leak.rs:24:16
2129 |
2230LL | fn cycle1() -> impl Clone {
2331 | ^^^^^^^^^^
24- = note: ...which again requires processing `cycle1`, completing the cycle
25- note: cycle used when type-checking all item bodies
32+ |
33+ note: ...which requires processing `cycle1`...
34+ --> $DIR/auto-trait-leak.rs:24:1
35+ |
36+ LL | fn cycle1() -> impl Clone {
37+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
38+ note: ...which requires evaluating trait selection obligation `impl std::clone::Clone: std::marker::Send`...
39+ note: ...which requires processing `cycle2::{{impl-Trait}}`...
40+ --> $DIR/auto-trait-leak.rs:33:16
41+ |
42+ LL | fn cycle2() -> impl Clone {
43+ | ^^^^^^^^^^
44+ note: ...which requires processing `cycle2`...
45+ --> $DIR/auto-trait-leak.rs:33:1
46+ |
47+ LL | fn cycle2() -> impl Clone {
48+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
49+ = note: ...which again requires processing `cycle1::{{impl-Trait}}`, completing the cycle
50+
51+ error[E0277]: `std::rc::Rc<std::string::String>` cannot be sent between threads safely
52+ --> $DIR/auto-trait-leak.rs:27:5
53+ |
54+ LL | send(cycle2().clone());
55+ | ^^^^ `std::rc::Rc<std::string::String>` cannot be sent between threads safely
56+ |
57+ = help: within `impl std::clone::Clone`, the trait `std::marker::Send` is not implemented for `std::rc::Rc<std::string::String>`
58+ = note: required because it appears within the type `impl std::clone::Clone`
59+ note: required by `send`
60+ --> $DIR/auto-trait-leak.rs:16:1
61+ |
62+ LL | fn send<T: Send>(_: T) {}
63+ | ^^^^^^^^^^^^^^^^^^^^^^
2664
2765error: aborting due to previous error
2866
0 commit comments