11error[E0792]: non-defining opaque type use in defining scope
2-   --> $DIR/issue-53092-2.rs:6 :18
2+   --> $DIR/issue-53092-2.rs:7 :18
33   |
44LL | const CONST_BUG: Bug<u8, ()> = unsafe { std::mem::transmute(|_: u8| ()) };
55   |                  ^^^^^^^^^^^ argument `u8` is not a generic parameter
@@ -10,33 +10,59 @@ note: for this opaque type
1010LL | type Bug<T, U> = impl Fn(T) -> U + Copy;
1111   |                  ^^^^^^^^^^^^^^^^^^^^^^
1212
13- error[E0391]: cycle detected when type-checking `CONST_BUG`
14-   --> $DIR/issue-53092-2.rs:6:1
13+ error[E0391]: cycle detected when computing type of `Bug::{opaque#0}`
14+   --> $DIR/issue-53092-2.rs:4:18
15+    |
16+ LL | type Bug<T, U> = impl Fn(T) -> U + Copy;
17+    |                  ^^^^^^^^^^^^^^^^^^^^^^
18+    |
19+ note: ...which requires computing type of opaque `Bug::{opaque#0}`...
20+   --> $DIR/issue-53092-2.rs:4:18
21+    |
22+ LL | type Bug<T, U> = impl Fn(T) -> U + Copy;
23+    |                  ^^^^^^^^^^^^^^^^^^^^^^
24+ note: ...which requires type-checking `CONST_BUG`...
25+   --> $DIR/issue-53092-2.rs:7:1
1526   |
1627LL | const CONST_BUG: Bug<u8, ()> = unsafe { std::mem::transmute(|_: u8| ()) };
1728   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18-    |
1929   = note: ...which requires computing layout of `Bug<u8, ()>`...
2030   = note: ...which requires normalizing `Bug<u8, ()>`...
21- note: ...which requires computing type of `Bug::{opaque#0}`...
31+    = note: ...which again requires computing type of `Bug::{opaque#0}`, completing the cycle
32+ note: cycle used when checking that `Bug::{opaque#0}` is well-formed
2233  --> $DIR/issue-53092-2.rs:4:18
2334   |
2435LL | type Bug<T, U> = impl Fn(T) -> U + Copy;
2536   |                  ^^^^^^^^^^^^^^^^^^^^^^
26- note: ...which requires computing type of opaque `Bug::{opaque#0}`...
37+    = 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
38+ 
39+ error: item does not constrain `Bug::{opaque#0}`, but has it in its signature
40+   --> $DIR/issue-53092-2.rs:7:7
41+    |
42+ LL | const CONST_BUG: Bug<u8, ()> = unsafe { std::mem::transmute(|_: u8| ()) };
43+    |       ^^^^^^^^^
44+    |
45+    = note: consider moving the opaque type's declaration and defining uses into a separate module
46+ note: this opaque type is in the signature
2747  --> $DIR/issue-53092-2.rs:4:18
2848   |
2949LL | type Bug<T, U> = impl Fn(T) -> U + Copy;
3050   |                  ^^^^^^^^^^^^^^^^^^^^^^
31-    = note: ...which again requires type-checking `CONST_BUG`, completing the cycle 
32- note: cycle used when checking that `CONST_BUG` is well-formed 
33-   --> $DIR/issue-53092-2.rs:6:1 
51+ 
52+ error: item does not constrain `Bug::{opaque#0}`, but has it in its signature 
53+   --> $DIR/issue-53092-2.rs:7:61 
3454   |
3555LL | const CONST_BUG: Bug<u8, ()> = unsafe { std::mem::transmute(|_: u8| ()) };
36-    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
37-    = 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
56+    |                                                             ^^^^^^^
57+    |
58+    = note: consider moving the opaque type's declaration and defining uses into a separate module
59+ note: this opaque type is in the signature
60+   --> $DIR/issue-53092-2.rs:4:18
61+    |
62+ LL | type Bug<T, U> = impl Fn(T) -> U + Copy;
63+    |                  ^^^^^^^^^^^^^^^^^^^^^^
3864
39- error: aborting due to 2  previous errors
65+ error: aborting due to 4  previous errors
4066
4167Some errors have detailed explanations: E0391, E0792.
4268For more information about an error, try `rustc --explain E0391`.
0 commit comments