summaryrefslogtreecommitdiffstats
path: root/tests/ui/suggestions/suggest-assoc-fn-call-without-receiver.stderr
blob: 793595784d9372cb78cae49384fdfc389cc62a58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
error[E0599]: no method named `hello` found for struct `A` in the current scope
  --> $DIR/suggest-assoc-fn-call-without-receiver.rs:20:8
   |
LL | struct A {}
   | -------- method `hello` not found for this struct
...
LL |     _a.hello(1);
   |     ---^^^^^---
   |     |  |
   |     |  this is an associated function, not a method
   |     help: use associated function syntax instead: `A::hello(1)`
   |
   = note: found the following associated functions; to be used as methods, functions must have a `self` parameter
note: the candidate is defined in an impl for the type `A`
  --> $DIR/suggest-assoc-fn-call-without-receiver.rs:6:5
   |
LL |     fn hello(_a: i32) {}
   |     ^^^^^^^^^^^^^^^^^

error[E0599]: no method named `test` found for struct `A` in the current scope
  --> $DIR/suggest-assoc-fn-call-without-receiver.rs:22:8
   |
LL | struct A {}
   | -------- method `test` not found for this struct
...
LL |     _a.test(1);
   |     ---^^^^---
   |     |  |
   |     |  this is an associated function, not a method
   |     help: use associated function syntax instead: `A::test(_a, 1)`
   |
   = note: found the following associated functions; to be used as methods, functions must have a `self` parameter
note: the candidate is defined in an impl for the type `A`
  --> $DIR/suggest-assoc-fn-call-without-receiver.rs:7:5
   |
LL |     fn test(_a: Self, _b: i32) {}
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0599]: no method named `hello` found for struct `B<&str>` in the current scope
  --> $DIR/suggest-assoc-fn-call-without-receiver.rs:26:8
   |
LL | struct B<T> {
   | ----------- method `hello` not found for this struct
...
LL |     _b.hello(1);
   |     ---^^^^^---
   |     |  |
   |     |  this is an associated function, not a method
   |     help: use associated function syntax instead: `B::<&str>::hello(1)`
   |
   = note: found the following associated functions; to be used as methods, functions must have a `self` parameter
note: the candidate is defined in an impl for the type `B<T>`
  --> $DIR/suggest-assoc-fn-call-without-receiver.rs:14:5
   |
LL |     fn hello(_a: i32) {}
   |     ^^^^^^^^^^^^^^^^^

error[E0599]: no method named `test` found for struct `B<&str>` in the current scope
  --> $DIR/suggest-assoc-fn-call-without-receiver.rs:28:8
   |
LL | struct B<T> {
   | ----------- method `test` not found for this struct
...
LL |     _b.test(1);
   |     ---^^^^---
   |     |  |
   |     |  this is an associated function, not a method
   |     help: use associated function syntax instead: `B::<&str>::test(_b, 1)`
   |
   = note: found the following associated functions; to be used as methods, functions must have a `self` parameter
note: the candidate is defined in an impl for the type `B<T>`
  --> $DIR/suggest-assoc-fn-call-without-receiver.rs:15:5
   |
LL |     fn test(_a: Self, _b: i32) {}
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0599`.