mirror of https://github.com/rust-lang/rust
33 lines
1.1 KiB
Plaintext
33 lines
1.1 KiB
Plaintext
error[E0792]: non-defining opaque type use in defining scope
|
|
--> $DIR/issue-53092.rs:11:18
|
|
|
|
|
LL | const CONST_BUG: Bug<u8, ()> = unsafe { Moo { y: () }.x };
|
|
| ^^^^^^^^^^^ argument `u8` is not a generic parameter
|
|
|
|
|
note: for this opaque type
|
|
--> $DIR/issue-53092.rs:4:18
|
|
|
|
|
LL | type Bug<T, U> = impl Fn(T) -> U + Copy;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error[E0277]: the trait bound `U: From<T>` is not satisfied
|
|
--> $DIR/issue-53092.rs:15:5
|
|
|
|
|
LL | |x| x.into()
|
|
| ^^^^^^^^^^^^ the trait `From<T>` is not implemented for `U`
|
|
|
|
|
note: required by a bound in `make_bug`
|
|
--> $DIR/issue-53092.rs:14:19
|
|
|
|
|
LL | fn make_bug<T, U: From<T>>() -> Bug<T, U> {
|
|
| ^^^^^^^ required by this bound in `make_bug`
|
|
help: consider restricting type parameter `U`
|
|
|
|
|
LL | type Bug<T, U: std::convert::From<T>> = impl Fn(T) -> U + Copy;
|
|
| +++++++++++++++++++++++
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
Some errors have detailed explanations: E0277, E0792.
|
|
For more information about an error, try `rustc --explain E0277`.
|