1 error[E0391]: cycle detected when computing type of `Bug::{opaque#0}`
2 --> $DIR/issue-53092-2.rs:4:18
4 LL | type Bug<T, U> = impl Fn(T) -> U + Copy;
5 | ^^^^^^^^^^^^^^^^^^^^^^
7 note: ...which requires type-checking `CONST_BUG`...
8 --> $DIR/issue-53092-2.rs:6:1
10 LL | const CONST_BUG: Bug<u8, ()> = unsafe { std::mem::transmute(|_: u8| ()) };
11 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12 = note: ...which requires computing layout of `Bug<u8, ()>`...
13 = note: ...which requires normalizing `Bug<u8, ()>`...
14 = note: ...which again requires computing type of `Bug::{opaque#0}`, completing the cycle
15 note: cycle used when checking item types in top-level module
16 --> $DIR/issue-53092-2.rs:1:1
18 LL | / #![feature(type_alias_impl_trait)]
19 LL | | #![allow(dead_code)]
21 LL | | type Bug<T, U> = impl Fn(T) -> U + Copy;
27 error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
28 --> $DIR/issue-53092-2.rs:6:41
30 LL | const CONST_BUG: Bug<u8, ()> = unsafe { std::mem::transmute(|_: u8| ()) };
33 = note: source type: `[closure@$DIR/issue-53092-2.rs:6:61: 6:68]` (0 bits)
34 = note: target type: `Bug<u8, ()>` (size can vary because of [type error])
36 error[E0277]: the trait bound `U: From<T>` is not satisfied
37 --> $DIR/issue-53092-2.rs:10:5
40 | ^^^^^^^^^^^^ the trait `From<T>` is not implemented for `U`
42 note: required by a bound in `make_bug`
43 --> $DIR/issue-53092-2.rs:9:19
45 LL | fn make_bug<T, U: From<T>>() -> Bug<T, U> {
46 | ^^^^^^^ required by this bound in `make_bug`
47 help: consider restricting type parameter `U`
49 LL | type Bug<T, U: std::convert::From<T>> = impl Fn(T) -> U + Copy;
50 | +++++++++++++++++++++++
52 error: aborting due to 3 previous errors
54 Some errors have detailed explanations: E0277, E0391, E0512.
55 For more information about an error, try `rustc --explain E0277`.