@@ -34,32 +34,35 @@ fn check_expression() -> Obj<Box<FnBox() -> u32>> {
34
34
35
35
fn main ( ) {
36
36
// test variations of function
37
+
37
38
let o_closure = Obj { closure : || 42 , not_closure : 42 } ;
38
39
o_closure. closure ( ) ; //~ ERROR no method named `closure` found
39
- //~^ NOTE use `(o_closure.closure)(...)` if you meant to call the function stored in the `closure` field
40
+ //~^ NOTE use `(o_closure.closure)(...)` if you meant to call the function stored
40
41
41
42
o_closure. not_closure ( ) ; //~ ERROR no method named `not_closure` found
42
43
//~^ NOTE did you mean to write `o_closure.not_closure`?
43
44
44
45
let o_func = Obj { closure : func, not_closure : 5 } ;
45
46
o_func. closure ( ) ; //~ ERROR no method named `closure` found
46
- //~^ NOTE use `(o_func.closure)(...)` if you meant to call the function stored in the `closure` field
47
+ //~^ NOTE use `(o_func.closure)(...)` if you meant to call the function stored
47
48
48
49
let boxed_fn = BoxedObj { boxed_closure : Box :: new ( func) } ;
49
50
boxed_fn. boxed_closure ( ) ; //~ ERROR no method named `boxed_closure` found
50
- //~^ NOTE use `(boxed_fn.boxed_closure)(...)` if you meant to call the function stored in the `boxed_closure` field
51
+ //~^ NOTE use `(boxed_fn.boxed_closure)(...)` if you meant to call the function stored
51
52
52
53
let boxed_closure = BoxedObj { boxed_closure : Box :: new ( || 42_u32 ) as Box < FnBox ( ) -> u32 > } ;
53
54
boxed_closure. boxed_closure ( ) ; //~ ERROR no method named `boxed_closure` found
54
- //~^ NOTE use `(boxed_closure.boxed_closure)(...)` if you meant to call the function stored in the `boxed_closure` field
55
+ //~^ NOTE use `(boxed_closure.boxed_closure)(...)` if you meant to call the function stored
55
56
56
57
// test expression writing in the notes
58
+
57
59
let w = Wrapper { wrap : o_func } ;
58
60
w. wrap . closure ( ) ; //~ ERROR no method named `closure` found
59
- //~^ NOTE use `(w.wrap.closure)(...)` if you meant to call the function stored in the `closure` field
61
+ //~^ NOTE use `(w.wrap.closure)(...)` if you meant to call the function stored
62
+
60
63
w. wrap . not_closure ( ) ; //~ ERROR no method named `not_closure` found
61
64
//~^ NOTE did you mean to write `w.wrap.not_closure`?
62
65
63
66
check_expression ( ) . closure ( ) ; //~ ERROR no method named `closure` found
64
- //~^ NOTE use `(check_expression().closure)(...)` if you meant to call the function stored in the `closure` field
67
+ //~^ NOTE use `(check_expression().closure)(...)` if you meant to call the function stored
65
68
}
0 commit comments