@@ -904,7 +904,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
904
904
if let Some ( ref expr) = local. init {
905
905
if let hir:: ExprKind :: Index ( _, _) = expr. node {
906
906
if let Ok ( snippet) = self . tcx . sess . source_map ( ) . span_to_snippet ( expr. span ) {
907
- err. span_suggestion_with_applicability (
907
+ err. span_suggestion (
908
908
expr. span ,
909
909
"consider borrowing here" ,
910
910
format ! ( "&{}" , snippet) ,
@@ -952,7 +952,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
952
952
let format_str = format ! ( "consider removing {} leading `&`-references" ,
953
953
remove_refs) ;
954
954
955
- err. span_suggestion_short_with_applicability (
955
+ err. span_suggestion_short (
956
956
sp, & format_str, String :: new ( ) , Applicability :: MachineApplicable
957
957
) ;
958
958
break ;
@@ -1109,7 +1109,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
1109
1109
// For example, if `expected_args_length` is 2, suggest `|_, _|`.
1110
1110
if found_args. is_empty ( ) && is_closure {
1111
1111
let underscores = vec ! [ "_" ; expected_args. len( ) ] . join ( ", " ) ;
1112
- err. span_suggestion_with_applicability (
1112
+ err. span_suggestion (
1113
1113
pipe_span,
1114
1114
& format ! (
1115
1115
"consider changing the closure to take and ignore the expected argument{}" ,
@@ -1130,11 +1130,12 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
1130
1130
. map ( |( name, _) | name. to_owned ( ) )
1131
1131
. collect :: < Vec < String > > ( )
1132
1132
. join ( ", " ) ;
1133
- err. span_suggestion_with_applicability ( found_span,
1134
- "change the closure to take multiple \
1135
- arguments instead of a single tuple",
1136
- format ! ( "|{}|" , sugg) ,
1137
- Applicability :: MachineApplicable ) ;
1133
+ err. span_suggestion (
1134
+ found_span,
1135
+ "change the closure to take multiple arguments instead of a single tuple" ,
1136
+ format ! ( "|{}|" , sugg) ,
1137
+ Applicability :: MachineApplicable ,
1138
+ ) ;
1138
1139
}
1139
1140
}
1140
1141
if let & [ ArgKind :: Tuple ( _, ref fields) ] = & expected_args[ ..] {
@@ -1162,12 +1163,11 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
1162
1163
String :: new( )
1163
1164
} ,
1164
1165
) ;
1165
- err. span_suggestion_with_applicability (
1166
+ err. span_suggestion (
1166
1167
found_span,
1167
- "change the closure to accept a tuple instead of \
1168
- individual arguments",
1168
+ "change the closure to accept a tuple instead of individual arguments" ,
1169
1169
sugg,
1170
- Applicability :: MachineApplicable
1170
+ Applicability :: MachineApplicable ,
1171
1171
) ;
1172
1172
}
1173
1173
}
0 commit comments