]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/suggest-assoc-fn-call-with-turbofish.fixed
Rollup merge of #105795 - nicholasbishop:bishop-stabilize-efiapi, r=joshtriplett
[rust.git] / tests / ui / suggestions / suggest-assoc-fn-call-with-turbofish.fixed
1 // run-rustfix
2
3 struct GenericAssocMethod<T>(T);
4
5 impl<T> GenericAssocMethod<T> {
6     fn default_hello() {}
7     fn self_ty_hello(_: Self) {}
8     fn self_ty_ref_hello(_: &Self) {}
9 }
10
11 fn main() {
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
26 }