rust/tests/ui/nll/relate_tys/fn-subtype.rs

9 lines
235 B
Rust

// Test that NLL produces correct spans for higher-ranked subtyping errors.
//
//@ compile-flags:-Zno-leak-check
fn main() {
let x: fn(&'static ()) = |_| {};
let y: for<'a> fn(&'a ()) = x; //~ ERROR mismatched types [E0308]
}