@@ -30,129 +30,47 @@ note: ...which requires building MIR for `cycle1`...
30
30
LL | fn cycle1() -> impl Clone {
31
31
| ^^^^^^^^^^^^^^^^^^^^^^^^^
32
32
note: ...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
87
34
|
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`...
121
38
note: ...which requires computing type of `cycle2::{opaque#0}`...
122
- --> $DIR/auto-trait-leak.rs:20 :16
39
+ --> $DIR/auto-trait-leak.rs:19 :16
123
40
|
124
41
LL | fn cycle2() -> impl Clone {
125
42
| ^^^^^^^^^^
126
43
note: ...which requires borrow-checking `cycle2`...
127
- --> $DIR/auto-trait-leak.rs:20 :1
44
+ --> $DIR/auto-trait-leak.rs:19 :1
128
45
|
129
46
LL | fn cycle2() -> impl Clone {
130
47
| ^^^^^^^^^^^^^^^^^^^^^^^^^
131
48
note: ...which requires processing `cycle2`...
132
- --> $DIR/auto-trait-leak.rs:20 :1
49
+ --> $DIR/auto-trait-leak.rs:19 :1
133
50
|
134
51
LL | fn cycle2() -> impl Clone {
135
52
| ^^^^^^^^^^^^^^^^^^^^^^^^^
136
53
note: ...which requires processing MIR for `cycle2`...
137
- --> $DIR/auto-trait-leak.rs:20 :1
54
+ --> $DIR/auto-trait-leak.rs:19 :1
138
55
|
139
56
LL | fn cycle2() -> impl Clone {
140
57
| ^^^^^^^^^^^^^^^^^^^^^^^^^
141
58
note: ...which requires unsafety-checking `cycle2`...
142
- --> $DIR/auto-trait-leak.rs:20 :1
59
+ --> $DIR/auto-trait-leak.rs:19 :1
143
60
|
144
61
LL | fn cycle2() -> impl Clone {
145
62
| ^^^^^^^^^^^^^^^^^^^^^^^^^
146
63
note: ...which requires building MIR for `cycle2`...
147
- --> $DIR/auto-trait-leak.rs:20 :1
64
+ --> $DIR/auto-trait-leak.rs:19 :1
148
65
|
149
66
LL | fn cycle2() -> impl Clone {
150
67
| ^^^^^^^^^^^^^^^^^^^^^^^^^
151
68
note: ...which requires type-checking `cycle2`...
152
- --> $DIR/auto-trait-leak.rs:20:1
69
+ --> $DIR/auto-trait-leak.rs:20:5
153
70
|
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`...
156
74
= note: ...which again requires computing type of `cycle1::{opaque#0}`, completing the cycle
157
75
note: cycle used when checking item types in top-level module
158
76
--> $DIR/auto-trait-leak.rs:1:1
@@ -166,6 +84,6 @@ LL | | Rc::new(String::from("foo"))
166
84
LL | | }
167
85
| |_^
168
86
169
- error: aborting due to 2 previous errors
87
+ error: aborting due to previous error
170
88
171
89
For more information about this error, try `rustc --explain E0391`.
0 commit comments