@@ -73,20 +73,16 @@ pub fn report_error<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
73
73
// snippet
74
74
} ;
75
75
76
- macro_rules! span_stored_function {
77
- ( ) => {
78
- cx. sess. span_note( span,
79
- & format!( "use `({0}.{1})(...)` if you meant to call \
80
- the function stored in the `{1}` field",
81
- expr_string, item_name) ) ;
82
- }
76
+ let span_stored_function = || {
77
+ cx. sess . span_note ( span,
78
+ & format ! ( "use `({0}.{1})(...)` if you meant to call \
79
+ the function stored in the `{1}` field",
80
+ expr_string, item_name) ) ;
83
81
} ;
84
82
85
- macro_rules! span_did_you_mean {
86
- ( ) => {
87
- cx. sess. span_note( span, & format!( "did you mean to write `{0}.{1}`?" ,
88
- expr_string, item_name) ) ;
89
- }
83
+ let span_did_you_mean = || {
84
+ cx. sess . span_note ( span, & format ! ( "did you mean to write `{0}.{1}`?" ,
85
+ expr_string, item_name) ) ;
90
86
} ;
91
87
92
88
// Determine if the field can be used as a function in some way
@@ -106,16 +102,16 @@ pub fn report_error<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
106
102
let mut selcx = SelectionContext :: new ( infcx, fcx) ;
107
103
108
104
if selcx. evaluate_obligation ( & obligation) {
109
- span_stored_function ! ( ) ;
105
+ span_stored_function ( ) ;
110
106
} else {
111
- span_did_you_mean ! ( ) ;
107
+ span_did_you_mean ( ) ;
112
108
}
113
109
} ) ;
114
110
} else {
115
111
match field_ty. sty {
116
112
// fallback to matching a closure or function pointer
117
- ty:: TyClosure ( _ , _ ) | ty:: TyBareFn ( None , _ ) => span_stored_function ! ( ) ,
118
- _ => span_did_you_mean ! ( ) ,
113
+ ty:: TyClosure ( .. ) | ty:: TyBareFn ( .. ) => span_stored_function ( ) ,
114
+ _ => span_did_you_mean ( ) ,
119
115
}
120
116
}
121
117
}
0 commit comments