about summary refs log tree commit diff
path: root/tests/ui/delegation/glob-glob.rs
blob: ef7f9a15e19554800f2df2c59f75bfd1e91740cc (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
28
29
30
31
32
33
34
35
36
//@ check-pass

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

mod inner {
    pub trait TraitFoo {
        fn foo(&self) -> u8;
    }
    pub trait TraitBar {
        fn bar(&self) -> u8;
    }

    impl TraitFoo for u8 {
        fn foo(&self) -> u8 { 0 }
    }
    impl TraitBar for u8 {
        fn bar(&self) -> u8 { 1 }
    }
}

trait Trait {
    fn foo(&self) -> u8;
    fn bar(&self) -> u8;
}

impl Trait for u8 {
    reuse inner::TraitFoo::*;
    reuse inner::TraitBar::*;
}

fn main() {
    let u = 0u8;
    u.foo();
    u.bar();
}