blob: a2e6ddc11b601a9ae4e1db977b36d47734a76ba0 [file] [log] [blame]
#![feature(type_alias_impl_trait)]
#![allow(dead_code)]
pub type Bug<T, U> = impl Fn(T) -> U + Copy;
#[define_opaque(Bug)]
fn make_bug<T, U: From<T>>() -> Bug<T, U> {
|x| x.into()
//~^ ERROR the trait bound `U: From<T>` is not satisfied
}
union Moo {
x: Bug<u8, ()>,
y: (),
}
const CONST_BUG: Bug<u8, ()> = unsafe { Moo { y: () }.x };
fn main() {
CONST_BUG(0);
}