You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 28, 2025. It is now read-only.
Rollup merge of rust-lang#117241 - compiler-errors:auto-trait-leak-cycle, r=oli-obk
Stash and cancel cycle errors for auto trait leakage in opaques
We don't need to emit a traditional cycle error when we have a selection error that explains what's going on but in more detail.
We may want to augment this error to actually point out the cycle, now that the cycle error is not being emitted. We could do that by storing the set of opaques that was in the `CyclePlaceholder` that gets returned from `type_of_opaque`.
r? `@oli-obk` cc `@estebank` rust-lang#117235
note: ...which requires computing type of opaque `cycle2::{opaque#0}`...
45
-
--> $DIR/auto-trait-leak.rs:19:16
46
-
|
47
-
LL | fn cycle2() -> impl Clone {
48
-
| ^^^^^^^^^^
49
-
note: ...which requires type-checking `cycle2`...
50
-
--> $DIR/auto-trait-leak.rs:19:1
51
-
|
52
-
LL | fn cycle2() -> impl Clone {
53
-
| ^^^^^^^^^^^^^^^^^^^^^^^^^
54
-
= note: ...which again requires computing type of opaque `cycle1::{opaque#0}`, completing the cycle
55
-
note: cycle used when computing type of `cycle1::{opaque#0}`
56
-
--> $DIR/auto-trait-leak.rs:11:16
57
-
|
58
-
LL | fn cycle1() -> impl Clone {
59
-
| ^^^^^^^^^^
60
-
= note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
61
-
62
1
error: cannot check whether the hidden type of opaque type satisfies auto traits
63
-
--> $DIR/auto-trait-leak.rs:20:10
2
+
--> $DIR/auto-trait-leak.rs:18:10
64
3
|
65
4
LL | send(cycle1().clone());
66
5
| ---- ^^^^^^^^^^^^^^^^
@@ -73,7 +12,7 @@ note: opaque type is declared here
73
12
LL | fn cycle1() -> impl Clone {
74
13
| ^^^^^^^^^^
75
14
note: this item depends on auto traits of the hidden type, but may also be registering the hidden type. This is not supported right now. You can try moving the opaque type and the item that actually registers a hidden type into a new submodule
76
-
--> $DIR/auto-trait-leak.rs:19:4
15
+
--> $DIR/auto-trait-leak.rs:17:4
77
16
|
78
17
LL | fn cycle2() -> impl Clone {
79
18
| ^^^^^^
@@ -83,6 +22,5 @@ note: required by a bound in `send`
83
22
LL | fn send<T: Send>(_: T) {}
84
23
| ^^^^ required by this bound in `send`
85
24
86
-
error: aborting due to 3 previous errors
25
+
error: aborting due to previous error
87
26
88
-
For more information about this error, try `rustc --explain E0391`.
0 commit comments