2018-09-05 08:38:06 -05:00
|
|
|
// Test that the NLL `relate_tys` code correctly deduces that a
|
|
|
|
// function returning either argument CANNOT be upcast to one
|
|
|
|
// that returns always its first argument.
|
|
|
|
//
|
|
|
|
// compile-flags:-Zno-leak-check
|
|
|
|
|
|
|
|
#![feature(nll)]
|
|
|
|
|
|
|
|
fn make_it() -> fn(&'static u32) -> &'static u32 {
|
|
|
|
panic!()
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let a: fn(_) -> _ = make_it();
|
2018-11-27 03:56:36 -06:00
|
|
|
let b: fn(&u32) -> &u32 = a; //~ ERROR higher-ranked subtype error
|
2018-09-05 08:38:06 -05:00
|
|
|
drop(a);
|
|
|
|
}
|