summaryrefslogtreecommitdiffstats
path: root/tests/ui/type-alias-impl-trait/issue-53092-2.rs
blob: 057930f0c1ce759a4d12c4ebff64c43076ab3714 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#![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| ()) };

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);
}