@@ -30,129 +30,47 @@ note: ...which requires building MIR for `cycle1`...
3030LL | fn cycle1() -> impl Clone {
3131 | ^^^^^^^^^^^^^^^^^^^^^^^^^
3232note: ...which requires type-checking `cycle1`...
33- --> $DIR/auto-trait-leak.rs:12:1
34- |
35- LL | fn cycle1() -> impl Clone {
36- | ^^^^^^^^^^^^^^^^^^^^^^^^^
37- note: ...which requires computing type of `cycle2::{opaque#0}`...
38- --> $DIR/auto-trait-leak.rs:20:16
39- |
40- LL | fn cycle2() -> impl Clone {
41- | ^^^^^^^^^^
42- note: ...which requires borrow-checking `cycle2`...
43- --> $DIR/auto-trait-leak.rs:20:1
44- |
45- LL | fn cycle2() -> impl Clone {
46- | ^^^^^^^^^^^^^^^^^^^^^^^^^
47- note: ...which requires processing `cycle2`...
48- --> $DIR/auto-trait-leak.rs:20:1
49- |
50- LL | fn cycle2() -> impl Clone {
51- | ^^^^^^^^^^^^^^^^^^^^^^^^^
52- note: ...which requires processing MIR for `cycle2`...
53- --> $DIR/auto-trait-leak.rs:20:1
54- |
55- LL | fn cycle2() -> impl Clone {
56- | ^^^^^^^^^^^^^^^^^^^^^^^^^
57- note: ...which requires unsafety-checking `cycle2`...
58- --> $DIR/auto-trait-leak.rs:20:1
59- |
60- LL | fn cycle2() -> impl Clone {
61- | ^^^^^^^^^^^^^^^^^^^^^^^^^
62- note: ...which requires building MIR for `cycle2`...
63- --> $DIR/auto-trait-leak.rs:20:1
64- |
65- LL | fn cycle2() -> impl Clone {
66- | ^^^^^^^^^^^^^^^^^^^^^^^^^
67- note: ...which requires type-checking `cycle2`...
68- --> $DIR/auto-trait-leak.rs:20:1
69- |
70- LL | fn cycle2() -> impl Clone {
71- | ^^^^^^^^^^^^^^^^^^^^^^^^^
72- = note: ...which again requires computing type of `cycle1::{opaque#0}`, completing the cycle
73- note: cycle used when checking item types in top-level module
74- --> $DIR/auto-trait-leak.rs:1:1
75- |
76- LL | / use std::cell::Cell;
77- LL | | use std::rc::Rc;
78- LL | |
79- LL | | fn send<T: Send>(_: T) {}
80- ... |
81- LL | | Rc::new(String::from("foo"))
82- LL | | }
83- | |_^
84-
85- error[E0391]: cycle detected when computing type of `cycle1::{opaque#0}`
86- --> $DIR/auto-trait-leak.rs:12:16
33+ --> $DIR/auto-trait-leak.rs:14:5
8734 |
88- LL | fn cycle1() -> impl Clone {
89- | ^^^^^^^^^^
90- |
91- note: ...which requires borrow-checking `cycle1`...
92- --> $DIR/auto-trait-leak.rs:12:1
93- |
94- LL | fn cycle1() -> impl Clone {
95- | ^^^^^^^^^^^^^^^^^^^^^^^^^
96- note: ...which requires processing `cycle1`...
97- --> $DIR/auto-trait-leak.rs:12:1
98- |
99- LL | fn cycle1() -> impl Clone {
100- | ^^^^^^^^^^^^^^^^^^^^^^^^^
101- note: ...which requires processing MIR for `cycle1`...
102- --> $DIR/auto-trait-leak.rs:12:1
103- |
104- LL | fn cycle1() -> impl Clone {
105- | ^^^^^^^^^^^^^^^^^^^^^^^^^
106- note: ...which requires unsafety-checking `cycle1`...
107- --> $DIR/auto-trait-leak.rs:12:1
108- |
109- LL | fn cycle1() -> impl Clone {
110- | ^^^^^^^^^^^^^^^^^^^^^^^^^
111- note: ...which requires building MIR for `cycle1`...
112- --> $DIR/auto-trait-leak.rs:12:1
113- |
114- LL | fn cycle1() -> impl Clone {
115- | ^^^^^^^^^^^^^^^^^^^^^^^^^
116- note: ...which requires type-checking `cycle1`...
117- --> $DIR/auto-trait-leak.rs:12:1
118- |
119- LL | fn cycle1() -> impl Clone {
120- | ^^^^^^^^^^^^^^^^^^^^^^^^^
35+ LL | send(cycle2().clone());
36+ | ^^^^
37+ = note: ...which requires evaluating trait selection obligation `impl core::clone::Clone: core::marker::Send`...
12138note: ...which requires computing type of `cycle2::{opaque#0}`...
122- --> $DIR/auto-trait-leak.rs:20 :16
39+ --> $DIR/auto-trait-leak.rs:19 :16
12340 |
12441LL | fn cycle2() -> impl Clone {
12542 | ^^^^^^^^^^
12643note: ...which requires borrow-checking `cycle2`...
127- --> $DIR/auto-trait-leak.rs:20 :1
44+ --> $DIR/auto-trait-leak.rs:19 :1
12845 |
12946LL | fn cycle2() -> impl Clone {
13047 | ^^^^^^^^^^^^^^^^^^^^^^^^^
13148note: ...which requires processing `cycle2`...
132- --> $DIR/auto-trait-leak.rs:20 :1
49+ --> $DIR/auto-trait-leak.rs:19 :1
13350 |
13451LL | fn cycle2() -> impl Clone {
13552 | ^^^^^^^^^^^^^^^^^^^^^^^^^
13653note: ...which requires processing MIR for `cycle2`...
137- --> $DIR/auto-trait-leak.rs:20 :1
54+ --> $DIR/auto-trait-leak.rs:19 :1
13855 |
13956LL | fn cycle2() -> impl Clone {
14057 | ^^^^^^^^^^^^^^^^^^^^^^^^^
14158note: ...which requires unsafety-checking `cycle2`...
142- --> $DIR/auto-trait-leak.rs:20 :1
59+ --> $DIR/auto-trait-leak.rs:19 :1
14360 |
14461LL | fn cycle2() -> impl Clone {
14562 | ^^^^^^^^^^^^^^^^^^^^^^^^^
14663note: ...which requires building MIR for `cycle2`...
147- --> $DIR/auto-trait-leak.rs:20 :1
64+ --> $DIR/auto-trait-leak.rs:19 :1
14865 |
14966LL | fn cycle2() -> impl Clone {
15067 | ^^^^^^^^^^^^^^^^^^^^^^^^^
15168note: ...which requires type-checking `cycle2`...
152- --> $DIR/auto-trait-leak.rs:20:1
69+ --> $DIR/auto-trait-leak.rs:20:5
15370 |
154- LL | fn cycle2() -> impl Clone {
155- | ^^^^^^^^^^^^^^^^^^^^^^^^^
71+ LL | send(cycle1().clone());
72+ | ^^^^
73+ = note: ...which requires evaluating trait selection obligation `impl core::clone::Clone: core::marker::Send`...
15674 = note: ...which again requires computing type of `cycle1::{opaque#0}`, completing the cycle
15775note: cycle used when checking item types in top-level module
15876 --> $DIR/auto-trait-leak.rs:1:1
@@ -166,6 +84,6 @@ LL | | Rc::new(String::from("foo"))
16684LL | | }
16785 | |_^
16886
169- error: aborting due to 2 previous errors
87+ error: aborting due to previous error
17088
17189For more information about this error, try `rustc --explain E0391`.
0 commit comments