about summary refs log tree commit diff
path: root/tests/ui/higher-ranked/subtyping-fn-ptr-coercion.rs
blob: 0cecf6808f2293f607a89d83d8b6d5a61566911a (plain)
1
2
3
4
5
6
7
8
9
10
//@ 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);
}