summaryrefslogtreecommitdiffstats
path: root/tests/ui/suggestions/call-on-missing.stderr
blob: ca9abc7e906891513b16bc1d9e8a94eb0d5d41d2 (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
error[E0599]: no method named `bar` found for fn item `fn() -> Foo {foo}` in the current scope
  --> $DIR/call-on-missing.rs:12:9
   |
LL |     foo.bar();
   |         ^^^ method not found in `fn() -> Foo {foo}`
   |
help: use parentheses to call this function
   |
LL |     foo().bar();
   |        ++

error[E0609]: no field `i` on type `fn() -> Foo {foo}`
  --> $DIR/call-on-missing.rs:16:9
   |
LL |     foo.i;
   |         ^
   |
help: use parentheses to call this function
   |
LL |     foo().i;
   |        ++

error[E0599]: no method named `bar` found for struct `Box<dyn Fn() -> Foo>` in the current scope
  --> $DIR/call-on-missing.rs:22:14
   |
LL |     callable.bar();
   |              ^^^ method not found in `Box<dyn Fn() -> Foo>`
   |
help: use parentheses to call this trait object
   |
LL |     callable().bar();
   |             ++

error[E0609]: no field `i` on type `Box<dyn Fn() -> Foo>`
  --> $DIR/call-on-missing.rs:26:14
   |
LL |     callable.i;
   |              ^ unknown field
   |
help: use parentheses to call this trait object
   |
LL |     callable().i;
   |             ++

error[E0599]: no method named `bar` found for type parameter `T` in the current scope
  --> $DIR/call-on-missing.rs:32:7
   |
LL | fn type_param<T: Fn() -> Foo>(t: T) {
   |               - method `bar` not found for this type parameter
LL |     t.bar();
   |       ^^^ method not found in `T`
   |
help: use parentheses to call this type parameter
   |
LL |     t().bar();
   |      ++

error[E0609]: no field `i` on type `T`
  --> $DIR/call-on-missing.rs:36:7
   |
LL | fn type_param<T: Fn() -> Foo>(t: T) {
   |               - type parameter 'T' declared here
...
LL |     t.i;
   |       ^
   |
help: use parentheses to call this type parameter
   |
LL |     t().i;
   |      ++

error: aborting due to 6 previous errors

Some errors have detailed explanations: E0599, E0609.
For more information about an error, try `rustc --explain E0599`.