//@ run-pass #![feature(fn_delegation)] #![allow(incomplete_features)] mod to_reuse { pub fn foo(_: T, y: U) -> U { y } } trait Trait { fn foo(&self, x: T) -> T { x } } struct F; impl Trait for F {} struct S(F, T); impl Trait for S { reuse to_reuse::foo { &self.0 } } impl S { reuse to_reuse::foo; } fn main() { let s = S(F, 42); assert_eq!(S::::foo(F, 1), 1); assert_eq!( as Trait<_>>::foo(&s, 1), 1); }