]> git.proxmox.com Git - rustc.git/blob - src/test/ui/nll/relate_tys/hr-fn-aba-as-aaa.rs
New upstream version 1.63.0+dfsg1
[rustc.git] / src / test / ui / nll / relate_tys / hr-fn-aba-as-aaa.rs
1 // Test that the NLL `relate_tys` code correctly deduces that a
2 // function returning always its first argument can be upcast to one
3 // that returns either first or second argument.
4 //
5 // check-pass
6 // compile-flags:-Zno-leak-check
7
8 fn make_it() -> for<'a, 'b> fn(&'a u32, &'b u32) -> &'a u32 {
9 panic!()
10 }
11
12 fn main() {
13 let a: for<'a> fn(&'a u32, &'a u32) -> &'a u32 = make_it();
14 drop(a);
15 }