1
1
error[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
3
3
|
4
4
LL | const CONST_BUG: Bug<u8, ()> = unsafe { std::mem::transmute(|_: u8| ()) };
5
5
| ^^^^^^^^^^^ argument `u8` is not a generic parameter
@@ -10,33 +10,59 @@ note: for this opaque type
10
10
LL | type Bug<T, U> = impl Fn(T) -> U + Copy;
11
11
| ^^^^^^^^^^^^^^^^^^^^^^
12
12
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
15
26
|
16
27
LL | const CONST_BUG: Bug<u8, ()> = unsafe { std::mem::transmute(|_: u8| ()) };
17
28
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18
- |
19
29
= note: ...which requires computing layout of `Bug<u8, ()>`...
20
30
= 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
22
33
--> $DIR/issue-53092-2.rs:4:18
23
34
|
24
35
LL | type Bug<T, U> = impl Fn(T) -> U + Copy;
25
36
| ^^^^^^^^^^^^^^^^^^^^^^
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
27
47
--> $DIR/issue-53092-2.rs:4:18
28
48
|
29
49
LL | type Bug<T, U> = impl Fn(T) -> U + Copy;
30
50
| ^^^^^^^^^^^^^^^^^^^^^^
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
34
54
|
35
55
LL | 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
+ | ^^^^^^^^^^^^^^^^^^^^^^
38
64
39
- error: aborting due to 2 previous errors
65
+ error: aborting due to 4 previous errors
40
66
41
67
Some errors have detailed explanations: E0391, E0792.
42
68
For more information about an error, try `rustc --explain E0391`.
0 commit comments