summaryrefslogtreecommitdiffstats
path: root/tests/ui/coercion/issue-39823.rs
blob: 148cf527e7cb7799dd2b5de6b6827bb113048130 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// run-pass
// aux-build:issue-39823.rs

extern crate issue_39823;
use issue_39823::{RemoteC, RemoteG};

#[derive(Debug, PartialEq)]
struct LocalC(u32);

#[derive(Debug, PartialEq)]
struct LocalG<T>(T);

fn main() {
    let virtual_localc : &dyn Fn(_) -> LocalC = &LocalC;
    assert_eq!(virtual_localc(1), LocalC(1));

    let virtual_localg : &dyn Fn(_) -> LocalG<u32> = &LocalG;
    assert_eq!(virtual_localg(1), LocalG(1));

    let virtual_remotec : &dyn Fn(_) -> RemoteC = &RemoteC;
    assert_eq!(virtual_remotec(1), RemoteC(1));

    let virtual_remoteg : &dyn Fn(_) -> RemoteG<u32> = &RemoteG;
    assert_eq!(virtual_remoteg(1), RemoteG(1));
}