3 struct GenericAssocMethod<T>(T);
5 impl<T> GenericAssocMethod<T> {
7 fn self_ty_hello(_: Self) {}
8 fn self_ty_ref_hello(_: &Self) {}
12 // Test for inferred types
13 let x = GenericAssocMethod(33);
14 GenericAssocMethod::<_>::self_ty_ref_hello(&x);
15 //~^ ERROR no method named `self_ty_ref_hello` found
16 GenericAssocMethod::<_>::self_ty_hello(x);
17 //~^ ERROR no method named `self_ty_hello` found
18 // Test for known types
19 let y = GenericAssocMethod(33i32);
20 GenericAssocMethod::<i32>::default_hello();
21 //~^ ERROR no method named `default_hello` found
22 GenericAssocMethod::<i32>::self_ty_ref_hello(&y);
23 //~^ ERROR no method named `self_ty_ref_hello` found
24 GenericAssocMethod::<i32>::self_ty_hello(y);
25 //~^ ERROR no method named `self_ty_hello` found