2018-08-30 12:18:55 +00:00
|
|
|
// run-pass
|
2019-03-12 00:49:17 +00:00
|
|
|
// aux-build:issue-39823.rs
|
2017-02-23 17:03:30 +00:00
|
|
|
|
|
|
|
extern crate issue_39823;
|
|
|
|
use issue_39823::{RemoteC, RemoteG};
|
|
|
|
|
|
|
|
#[derive(Debug, PartialEq)]
|
|
|
|
struct LocalC(u32);
|
|
|
|
|
|
|
|
#[derive(Debug, PartialEq)]
|
|
|
|
struct LocalG<T>(T);
|
|
|
|
|
|
|
|
fn main() {
|
2019-05-28 18:47:21 +00:00
|
|
|
let virtual_localc : &dyn Fn(_) -> LocalC = &LocalC;
|
2017-02-23 17:03:30 +00:00
|
|
|
assert_eq!(virtual_localc(1), LocalC(1));
|
|
|
|
|
2019-05-28 18:47:21 +00:00
|
|
|
let virtual_localg : &dyn Fn(_) -> LocalG<u32> = &LocalG;
|
2017-02-23 17:03:30 +00:00
|
|
|
assert_eq!(virtual_localg(1), LocalG(1));
|
|
|
|
|
2019-05-28 18:47:21 +00:00
|
|
|
let virtual_remotec : &dyn Fn(_) -> RemoteC = &RemoteC;
|
2017-02-23 17:03:30 +00:00
|
|
|
assert_eq!(virtual_remotec(1), RemoteC(1));
|
|
|
|
|
2019-05-28 18:47:21 +00:00
|
|
|
let virtual_remoteg : &dyn Fn(_) -> RemoteG<u32> = &RemoteG;
|
2017-02-23 17:03:30 +00:00
|
|
|
assert_eq!(virtual_remoteg(1), RemoteG(1));
|
|
|
|
}
|