]> git.proxmox.com Git - rustc.git/blob - src/test/ui/nll/relate_tys/universe-violation.rs
New upstream version 1.30.0~beta.7+dfsg1
[rustc.git] / src / test / ui / nll / relate_tys / universe-violation.rs
1 // Test that the NLL `relate_tys` code correctly deduces that a
2 // function returning either argument CANNOT be upcast to one
3 // that returns always its first argument.
4 //
5 // compile-flags:-Zno-leak-check
6
7 #![feature(nll)]
8
9 fn make_it() -> fn(&'static u32) -> &'static u32 {
10 panic!()
11 }
12
13 fn main() {
14 let a: fn(_) -> _ = make_it();
15 let b: fn(&u32) -> &u32 = a;
16 drop(a);
17 }