summaryrefslogtreecommitdiffstats
path: root/src/test/ui/type-alias-impl-trait/issue-53092-2.rs
blob: 438ac35fdea515276a4d7bfb41028aa21fd9ea21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#![feature(type_alias_impl_trait)]
#![allow(dead_code)]

type Bug<T, U> = impl Fn(T) -> U + Copy; //~ ERROR cycle detected

const CONST_BUG: Bug<u8, ()> = unsafe { std::mem::transmute(|_: u8| ()) };
//~^ ERROR: cannot transmute

fn make_bug<T, U: From<T>>() -> Bug<T, U> {
    |x| x.into() //~ ERROR the trait bound `U: From<T>` is not satisfied
}

fn main() {
    CONST_BUG(0);
}