1
- error[E0599]: no method named `default_hello` found for struct `GenericAssocMethod<i32 >` in the current scope
2
- --> $DIR/suggest-assoc-fn-call-with-turbofish.rs:9 :7
1
+ error[E0599]: no method named `default_hello` found for struct `GenericAssocMethod<{integer} >` in the current scope
2
+ --> $DIR/suggest-assoc-fn-call-with-turbofish.rs:12 :7
3
3
|
4
4
LL | struct GenericAssocMethod<T>(T);
5
5
| ---------------------------- method `default_hello` not found for this struct
@@ -8,7 +8,7 @@ LL | x.default_hello();
8
8
| --^^^^^^^^^^^^^
9
9
| | |
10
10
| | this is an associated function, not a method
11
- | help: use associated function syntax instead: `GenericAssocMethod::default_hello`
11
+ | help: use associated function syntax instead: `GenericAssocMethod::<_>:: default_hello`
12
12
|
13
13
= note: found the following associated functions; to be used as methods, functions must have a `self` parameter
14
14
note: the candidate is defined in an impl for the type `GenericAssocMethod<T>`
@@ -17,6 +17,101 @@ note: the candidate is defined in an impl for the type `GenericAssocMethod<T>`
17
17
LL | fn default_hello() {}
18
18
| ^^^^^^^^^^^^^^^^^^
19
19
20
- error: aborting due to previous error
20
+ error[E0599]: no method named `self_ty_ref_hello` found for struct `GenericAssocMethod<{integer}>` in the current scope
21
+ --> $DIR/suggest-assoc-fn-call-with-turbofish.rs:14:7
22
+ |
23
+ LL | struct GenericAssocMethod<T>(T);
24
+ | ---------------------------- method `self_ty_ref_hello` not found for this struct
25
+ ...
26
+ LL | x.self_ty_ref_hello();
27
+ | --^^^^^^^^^^^^^^^^^
28
+ | | |
29
+ | | this is an associated function, not a method
30
+ | help: use associated function syntax instead: `GenericAssocMethod::<_>::self_ty_ref_hello`
31
+ |
32
+ = note: found the following associated functions; to be used as methods, functions must have a `self` parameter
33
+ note: the candidate is defined in an impl for the type `GenericAssocMethod<T>`
34
+ --> $DIR/suggest-assoc-fn-call-with-turbofish.rs:6:5
35
+ |
36
+ LL | fn self_ty_ref_hello(_: &T) {}
37
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
38
+
39
+ error[E0599]: no method named `self_ty_hello` found for struct `GenericAssocMethod<{integer}>` in the current scope
40
+ --> $DIR/suggest-assoc-fn-call-with-turbofish.rs:16:7
41
+ |
42
+ LL | struct GenericAssocMethod<T>(T);
43
+ | ---------------------------- method `self_ty_hello` not found for this struct
44
+ ...
45
+ LL | x.self_ty_hello();
46
+ | --^^^^^^^^^^^^^
47
+ | | |
48
+ | | this is an associated function, not a method
49
+ | help: use associated function syntax instead: `GenericAssocMethod::<_>::self_ty_hello`
50
+ |
51
+ = note: found the following associated functions; to be used as methods, functions must have a `self` parameter
52
+ note: the candidate is defined in an impl for the type `GenericAssocMethod<T>`
53
+ --> $DIR/suggest-assoc-fn-call-with-turbofish.rs:5:5
54
+ |
55
+ LL | fn self_ty_hello(_: T) {}
56
+ | ^^^^^^^^^^^^^^^^^^^^^^
57
+
58
+ error[E0599]: no method named `default_hello` found for struct `GenericAssocMethod<i32>` in the current scope
59
+ --> $DIR/suggest-assoc-fn-call-with-turbofish.rs:20:7
60
+ |
61
+ LL | struct GenericAssocMethod<T>(T);
62
+ | ---------------------------- method `default_hello` not found for this struct
63
+ ...
64
+ LL | y.default_hello();
65
+ | --^^^^^^^^^^^^^
66
+ | | |
67
+ | | this is an associated function, not a method
68
+ | help: use associated function syntax instead: `GenericAssocMethod::<i32>::default_hello`
69
+ |
70
+ = note: found the following associated functions; to be used as methods, functions must have a `self` parameter
71
+ note: the candidate is defined in an impl for the type `GenericAssocMethod<T>`
72
+ --> $DIR/suggest-assoc-fn-call-with-turbofish.rs:4:5
73
+ |
74
+ LL | fn default_hello() {}
75
+ | ^^^^^^^^^^^^^^^^^^
76
+
77
+ error[E0599]: no method named `self_ty_ref_hello` found for struct `GenericAssocMethod<i32>` in the current scope
78
+ --> $DIR/suggest-assoc-fn-call-with-turbofish.rs:22:7
79
+ |
80
+ LL | struct GenericAssocMethod<T>(T);
81
+ | ---------------------------- method `self_ty_ref_hello` not found for this struct
82
+ ...
83
+ LL | y.self_ty_ref_hello();
84
+ | --^^^^^^^^^^^^^^^^^
85
+ | | |
86
+ | | this is an associated function, not a method
87
+ | help: use associated function syntax instead: `GenericAssocMethod::<i32>::self_ty_ref_hello`
88
+ |
89
+ = note: found the following associated functions; to be used as methods, functions must have a `self` parameter
90
+ note: the candidate is defined in an impl for the type `GenericAssocMethod<T>`
91
+ --> $DIR/suggest-assoc-fn-call-with-turbofish.rs:6:5
92
+ |
93
+ LL | fn self_ty_ref_hello(_: &T) {}
94
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
95
+
96
+ error[E0599]: no method named `self_ty_hello` found for struct `GenericAssocMethod<i32>` in the current scope
97
+ --> $DIR/suggest-assoc-fn-call-with-turbofish.rs:24:7
98
+ |
99
+ LL | struct GenericAssocMethod<T>(T);
100
+ | ---------------------------- method `self_ty_hello` not found for this struct
101
+ ...
102
+ LL | y.self_ty_hello();
103
+ | --^^^^^^^^^^^^^
104
+ | | |
105
+ | | this is an associated function, not a method
106
+ | help: use associated function syntax instead: `GenericAssocMethod::<i32>::self_ty_hello`
107
+ |
108
+ = note: found the following associated functions; to be used as methods, functions must have a `self` parameter
109
+ note: the candidate is defined in an impl for the type `GenericAssocMethod<T>`
110
+ --> $DIR/suggest-assoc-fn-call-with-turbofish.rs:5:5
111
+ |
112
+ LL | fn self_ty_hello(_: T) {}
113
+ | ^^^^^^^^^^^^^^^^^^^^^^
114
+
115
+ error: aborting due to 6 previous errors
21
116
22
117
For more information about this error, try `rustc --explain E0599`.
0 commit comments