rust/tests/ui/delegation/generics/inherent-impl-to-trait-method-pass.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
344 B
Rust
Raw Normal View History

//@ 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));
}