2018-07-23 09:30:59 -05:00
|
|
|
// Test that the NLL `relate_tys` code correctly deduces that a
|
|
|
|
// function returning always its first argument can be upcast to one
|
|
|
|
// that returns either first or second argument.
|
|
|
|
//
|
2020-01-22 18:00:00 -06:00
|
|
|
// check-pass
|
2018-07-23 09:30:59 -05:00
|
|
|
// compile-flags:-Zno-leak-check
|
|
|
|
|
2023-05-19 04:14:55 -05:00
|
|
|
#![allow(dropping_copy_types)]
|
2023-03-29 15:18:20 -05:00
|
|
|
|
2018-07-23 09:30:59 -05:00
|
|
|
fn make_it() -> for<'a, 'b> fn(&'a u32, &'b u32) -> &'a u32 {
|
|
|
|
panic!()
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let a: for<'a> fn(&'a u32, &'a u32) -> &'a u32 = make_it();
|
|
|
|
drop(a);
|
|
|
|
}
|