@@ -48,45 +48,58 @@ fn main() {
48
48
49
49
let o_closure = Obj { closure : || 42 , not_closure : 42 } ;
50
50
o_closure. closure ( ) ; //~ ERROR no method named `closure` found
51
- //~^ NOTE use `(o_closure.closure)(...)` if you meant to call the function stored
51
+ //~^ HELP use `(o_closure.closure)(...)` if you meant to call the function stored
52
+ //~| NOTE `closure` is a field storing a function, not a method
52
53
53
- o_closure. not_closure ( ) ; //~ ERROR no method named `not_closure` found
54
- //~^ NOTE did you mean to write `o_closure.not_closure`?
54
+ o_closure. not_closure ( ) ;
55
+ //~^ ERROR no method named `not_closure` found
56
+ //~| NOTE `not_closure` is a field, not a method
57
+ //~| HELP did you mean to write `o_closure.not_closure` instead of `o_closure.not_closure(...)`?
55
58
56
59
let o_func = Obj { closure : func, not_closure : 5 } ;
57
60
o_func. closure ( ) ; //~ ERROR no method named `closure` found
58
- //~^ NOTE use `(o_func.closure)(...)` if you meant to call the function stored
61
+ //~^ HELP use `(o_func.closure)(...)` if you meant to call the function stored
62
+ //~| NOTE `closure` is a field storing a function, not a method
59
63
60
64
let boxed_fn = BoxedObj { boxed_closure : Box :: new ( func) } ;
61
65
boxed_fn. boxed_closure ( ) ; //~ ERROR no method named `boxed_closure` found
62
- //~^ NOTE use `(boxed_fn.boxed_closure)(...)` if you meant to call the function stored
66
+ //~^ HELP use `(boxed_fn.boxed_closure)(...)` if you meant to call the function stored
67
+ //~| NOTE `boxed_closure` is a field storing a function, not a method
63
68
64
69
let boxed_closure = BoxedObj { boxed_closure : Box :: new ( || 42_u32 ) as Box < FnBox ( ) -> u32 > } ;
65
70
boxed_closure. boxed_closure ( ) ; //~ ERROR no method named `boxed_closure` found
66
- //~^ NOTE use `(boxed_closure.boxed_closure)(...)` if you meant to call the function stored
71
+ //~^ HELP use `(boxed_closure.boxed_closure)(...)` if you meant to call the function stored
72
+ //~| NOTE `boxed_closure` is a field storing a function, not a method
67
73
68
74
// test expression writing in the notes
69
75
70
76
let w = Wrapper { wrap : o_func } ;
71
77
w. wrap . closure ( ) ; //~ ERROR no method named `closure` found
72
- //~^ NOTE use `(w.wrap.closure)(...)` if you meant to call the function stored
78
+ //~^ HELP use `(w.wrap.closure)(...)` if you meant to call the function stored
79
+ //~| NOTE `closure` is a field storing a function, not a method
73
80
74
- w. wrap . not_closure ( ) ; //~ ERROR no method named `not_closure` found
75
- //~^ NOTE did you mean to write `w.wrap.not_closure`?
81
+ w. wrap . not_closure ( ) ;
82
+ //~^ ERROR no method named `not_closure` found
83
+ //~| NOTE `not_closure` is a field, not a method
84
+ //~| HELP did you mean to write `w.wrap.not_closure` instead of `w.wrap.not_closure(...)`?
76
85
77
86
check_expression ( ) . closure ( ) ; //~ ERROR no method named `closure` found
78
- //~^ NOTE use `(check_expression().closure)(...)` if you meant to call the function stored
87
+ //~^ HELP use `(check_expression().closure)(...)` if you meant to call the function stored
88
+ //~| NOTE `closure` is a field storing a function, not a method
79
89
}
80
90
81
91
impl FuncContainerOuter {
82
92
fn run ( & self ) {
83
93
unsafe {
84
94
( * self . container ) . f1 ( 1 ) ; //~ ERROR no method named `f1` found
85
- //~^ NOTE use `((*self.container).f1)(...)`
95
+ //~^ HELP use `((*self.container).f1)(...)`
96
+ //~| NOTE `f1` is a field storing a function, not a method
86
97
( * self . container ) . f2 ( 1 ) ; //~ ERROR no method named `f2` found
87
- //~^ NOTE use `((*self.container).f2)(...)`
98
+ //~^ HELP use `((*self.container).f2)(...)`
99
+ //~| NOTE `f2` is a field storing a function, not a method
88
100
( * self . container ) . f3 ( 1 ) ; //~ ERROR no method named `f3` found
89
- //~^ NOTE use `((*self.container).f3)(...)`
101
+ //~^ HELP use `((*self.container).f3)(...)`
102
+ //~| NOTE `f3` is a field storing a function, not a method
90
103
}
91
104
}
92
105
}
0 commit comments