]> git.proxmox.com Git - rustc.git/blame - 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
CommitLineData
8faf50e0
XL
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//
dfeec247 5// check-pass
8faf50e0 6// compile-flags:-Zno-leak-check
ea8adc8c 7
8faf50e0
XL
8fn make_it() -> for<'a, 'b> fn(&'a u32, &'b u32) -> &'a u32 {
9 panic!()
223e47cc 10}
2c00a5a8 11
8faf50e0
XL
12fn main() {
13 let a: for<'a> fn(&'a u32, &'a u32) -> &'a u32 = make_it();
14 drop(a);
15}