File: issue-53092-2.stderr

package info (click to toggle)
rustc 1.85.0%2Bdfsg3-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental, forky, sid, trixie
  • size: 893,396 kB
  • sloc: xml: 158,127; python: 35,830; javascript: 19,497; cpp: 19,002; sh: 17,245; ansic: 13,127; asm: 4,376; makefile: 1,051; perl: 29; lisp: 29; ruby: 19; sql: 11
file content (42 lines) | stat: -rw-r--r-- 1,756 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
error[E0792]: non-defining opaque type use in defining scope
  --> $DIR/issue-53092-2.rs:6:18
   |
LL | const CONST_BUG: Bug<u8, ()> = unsafe { std::mem::transmute(|_: u8| ()) };
   |                  ^^^^^^^^^^^ argument `u8` is not a generic parameter
   |
note: for this opaque type
  --> $DIR/issue-53092-2.rs:4:18
   |
LL | type Bug<T, U> = impl Fn(T) -> U + Copy;
   |                  ^^^^^^^^^^^^^^^^^^^^^^

error[E0391]: cycle detected when type-checking `CONST_BUG`
  --> $DIR/issue-53092-2.rs:6:1
   |
LL | const CONST_BUG: Bug<u8, ()> = unsafe { std::mem::transmute(|_: u8| ()) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: ...which requires computing layout of `Bug<u8, ()>`...
   = note: ...which requires normalizing `Bug<u8, ()>`...
note: ...which requires computing type of `Bug::{opaque#0}`...
  --> $DIR/issue-53092-2.rs:4:18
   |
LL | type Bug<T, U> = impl Fn(T) -> U + Copy;
   |                  ^^^^^^^^^^^^^^^^^^^^^^
note: ...which requires computing type of opaque `Bug::{opaque#0}`...
  --> $DIR/issue-53092-2.rs:4:18
   |
LL | type Bug<T, U> = impl Fn(T) -> U + Copy;
   |                  ^^^^^^^^^^^^^^^^^^^^^^
   = note: ...which again requires type-checking `CONST_BUG`, completing the cycle
note: cycle used when checking that `CONST_BUG` is well-formed
  --> $DIR/issue-53092-2.rs:6:1
   |
LL | const CONST_BUG: Bug<u8, ()> = unsafe { std::mem::transmute(|_: u8| ()) };
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   = 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

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0391, E0792.
For more information about an error, try `rustc --explain E0391`.