summaryrefslogtreecommitdiffstats
path: root/third_party/rust/inherent/tests/test.rs
blob: 801b1c11658dec6b737204ccc1c212a508f1281c (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
mod types {
    use inherent::inherent;

    trait Trait {
        fn f<T: ?Sized>(self);
        // A default method
        fn g(&self) {}
    }

    pub struct Struct;

    #[inherent]
    impl Trait for Struct {
        pub fn f<T: ?Sized>(self) {}
        pub fn g(&self);
    }
}

#[test]
fn test() {
    // types::Trait is not in scope.
    let s = types::Struct;
    s.g();
    s.f::<str>();
}