summaryrefslogtreecommitdiffstats
path: root/src/test/ui/dyn-star/method.rs
blob: 5a77640f0d932f108bada3be5cf9dfb21bc36913 (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
26
27
// run-pass

#![feature(dyn_star)]
#![allow(incomplete_features)]

trait Foo {
    fn get(&self) -> usize;
}

impl Foo for usize {
    fn get(&self) -> usize {
        *self
    }
}

fn invoke_dyn_star(i: dyn* Foo) -> usize {
    i.get()
}

fn make_and_invoke_dyn_star(i: usize) -> usize {
    let dyn_i: dyn* Foo = i;
    invoke_dyn_star(dyn_i)
}

fn main() {
    println!("{}", make_and_invoke_dyn_star(42));
}