mirror of https://github.com/rust-lang/rust
24 lines
344 B
Rust
24 lines
344 B
Rust
//@ 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));
|
|
}
|