]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/suggest-assoc-fn-call-with-turbofish.rs
Rollup merge of #106751 - clubby789:const-intrinsic, r=GuillaumeGomez
[rust.git] / tests / ui / suggestions / suggest-assoc-fn-call-with-turbofish.rs
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     x.self_ty_ref_hello();
15     //~^ ERROR no method named `self_ty_ref_hello` found
16     x.self_ty_hello();
17     //~^ ERROR no method named `self_ty_hello` found
18     // Test for known types
19     let y = GenericAssocMethod(33i32);
20     y.default_hello();
21     //~^ ERROR no method named `default_hello` found
22     y.self_ty_ref_hello();
23     //~^ ERROR no method named `self_ty_ref_hello` found
24     y.self_ty_hello();
25     //~^ ERROR no method named `self_ty_hello` found
26 }