@@ -48,45 +48,58 @@ fn main() {
4848
4949 let o_closure = Obj { closure : || 42 , not_closure : 42 } ;
5050 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
5253
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(...)`?
5558
5659 let o_func = Obj { closure : func, not_closure : 5 } ;
5760 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
5963
6064 let boxed_fn = BoxedObj { boxed_closure : Box :: new ( func) } ;
6165 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
6368
6469 let boxed_closure = BoxedObj { boxed_closure : Box :: new ( || 42_u32 ) as Box < FnBox ( ) -> u32 > } ;
6570 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
6773
6874 // test expression writing in the notes
6975
7076 let w = Wrapper { wrap : o_func } ;
7177 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
7380
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(...)`?
7685
7786 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
7989}
8090
8191impl FuncContainerOuter {
8292 fn run ( & self ) {
8393 unsafe {
8494 ( * 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
8697 ( * 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
88100 ( * 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
90103 }
91104 }
92105}
0 commit comments