rust/tests/ui/higher-ranked/subtyping-fn-ptr-coercion.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

11 lines
192 B
Rust
Raw Normal View History

//@ check-pass
// Check that we use subtyping when reifying a closure into a function pointer.
fn foo(x: &str) {}
fn main() {
let c = |_: &str| {};
let x = c as fn(&'static str);
}