]> git.lizzy.rs Git - rust.git/blob - tests/ui/type-alias-impl-trait/issue-53092-2.rs
Make stage2 rustdoc and proc-macro-srv disableable in x.py install
[rust.git] / tests / ui / type-alias-impl-trait / issue-53092-2.rs
1 #![feature(type_alias_impl_trait)]
2 #![allow(dead_code)]
3
4 type Bug<T, U> = impl Fn(T) -> U + Copy; //~ ERROR cycle detected
5
6 const CONST_BUG: Bug<u8, ()> = unsafe { std::mem::transmute(|_: u8| ()) };
7 //~^ ERROR: cannot transmute
8
9 fn make_bug<T, U: From<T>>() -> Bug<T, U> {
10     |x| x.into() //~ ERROR the trait bound `U: From<T>` is not satisfied
11 }
12
13 fn main() {
14     CONST_BUG(0);
15 }