about summary refs log tree commit diff
path: root/tests/ui/delegation/generics/inherent-impl-to-trait-method-pass.rs
blob: 6f3bb178971690aa34bea10fe8f9074e87dc3b03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//@ run-pass

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

trait Trait<T> {
    fn foo<U>(&self, x: T, y: U) -> (T, U) {
        (x, y)
    }
}

impl<T> Trait<T> for () {}
struct S<T>(T, ());

impl<T> S<T> {
    reuse Trait::foo { self.1 }
}


fn main() {
    let s = S((), ());
    assert_eq!(s.foo(1u32, 2i32), (1u32, 2i32));
}