@@ -257,7 +257,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, '_, 'infcx, 'tcx> {
257
257
if is_loop_move & !in_pattern && !matches ! ( use_spans, UseSpans :: ClosureUse { .. } ) {
258
258
if let ty:: Ref ( _, _, hir:: Mutability :: Mut ) = ty. kind ( ) {
259
259
// We have a `&mut` ref, we need to reborrow on each iteration (#62112).
260
- err. span_suggestion_verbose (
260
+ err. span_suggestion (
261
261
span. shrink_to_lo ( ) ,
262
262
format ! (
263
263
"consider creating a fresh reborrow of {} here" ,
@@ -500,7 +500,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, '_, 'infcx, 'tcx> {
500
500
if let Some ( pat) = finder. parent_pat {
501
501
sugg. insert ( 0 , ( pat. span . shrink_to_lo ( ) , "ref " . to_string ( ) ) ) ;
502
502
}
503
- err. multipart_suggestion_verbose (
503
+ err. multipart_suggestion (
504
504
"borrow this binding in the pattern to avoid moving the value" ,
505
505
sugg,
506
506
Applicability :: MachineApplicable ,
@@ -680,7 +680,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, '_, 'infcx, 'tcx> {
680
680
return ;
681
681
} ;
682
682
683
- err. span_suggestion_verbose (
683
+ err. span_suggestion (
684
684
sugg_span. shrink_to_hi ( ) ,
685
685
"consider assigning a value" ,
686
686
format ! ( " = {assign_value}" ) ,
@@ -748,7 +748,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, '_, 'infcx, 'tcx> {
748
748
( move_span. shrink_to_lo ( ) , suggestion)
749
749
} )
750
750
. collect ( ) ;
751
- err. multipart_suggestion_verbose (
751
+ err. multipart_suggestion (
752
752
format ! ( "consider {}borrowing {value_name}" , borrow_level. mutably_str( ) ) ,
753
753
sugg,
754
754
Applicability :: MaybeIncorrect ,
@@ -1071,7 +1071,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, '_, 'infcx, 'tcx> {
1071
1071
"{prefix}clone the value from the field instead of using the functional record update \
1072
1072
syntax",
1073
1073
) ;
1074
- err. span_suggestion_verbose ( span, msg, sugg, Applicability :: MachineApplicable ) ;
1074
+ err. span_suggestion ( span, msg, sugg, Applicability :: MachineApplicable ) ;
1075
1075
}
1076
1076
1077
1077
pub ( crate ) fn suggest_cloning (
@@ -1345,7 +1345,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, '_, 'infcx, 'tcx> {
1345
1345
} else {
1346
1346
"consider cloning the value if the performance cost is acceptable"
1347
1347
} ;
1348
- err. multipart_suggestion_verbose ( msg, sugg, Applicability :: MachineApplicable ) ;
1348
+ err. multipart_suggestion ( msg, sugg, Applicability :: MachineApplicable ) ;
1349
1349
true
1350
1350
}
1351
1351
@@ -2604,7 +2604,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, '_, 'infcx, 'tcx> {
2604
2604
sugg. push ( ( span, suggest) ) ;
2605
2605
}
2606
2606
2607
- err. multipart_suggestion_verbose (
2607
+ err. multipart_suggestion (
2608
2608
"try explicitly pass `&Self` into the Closure as an argument" ,
2609
2609
sugg,
2610
2610
Applicability :: MachineApplicable ,
@@ -3164,7 +3164,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, '_, 'infcx, 'tcx> {
3164
3164
&& path. ident . name == sym:: iter
3165
3165
&& let Some ( ty) = expr_ty
3166
3166
{
3167
- err. span_suggestion_verbose (
3167
+ err. span_suggestion (
3168
3168
path. ident . span ,
3169
3169
format ! (
3170
3170
"consider consuming the `{ty}` when turning it into an \
@@ -3176,7 +3176,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, '_, 'infcx, 'tcx> {
3176
3176
}
3177
3177
if !is_format_arguments_item {
3178
3178
let addition = format ! ( "let binding = {};\n {}" , s, " " . repeat( p) ) ;
3179
- err. multipart_suggestion_verbose (
3179
+ err. multipart_suggestion (
3180
3180
msg,
3181
3181
vec ! [
3182
3182
( stmt. span. shrink_to_lo( ) , addition) ,
@@ -3297,7 +3297,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, '_, 'infcx, 'tcx> {
3297
3297
. type_implements_trait ( iter_trait, [ return_ty] , self . param_env )
3298
3298
. must_apply_modulo_regions ( )
3299
3299
{
3300
- err. span_suggestion_hidden (
3300
+ err. span_suggestion (
3301
3301
return_span. shrink_to_hi ( ) ,
3302
3302
"use `.collect()` to allocate the iterator" ,
3303
3303
".collect::<Vec<_>>()" ,
@@ -3384,7 +3384,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, '_, 'infcx, 'tcx> {
3384
3384
var_span,
3385
3385
scope,
3386
3386
) ;
3387
- err. span_suggestion_verbose (
3387
+ err. span_suggestion (
3388
3388
sugg_span,
3389
3389
format ! (
3390
3390
"to force the {kind} to take ownership of {captured_var} (and any \
@@ -3795,7 +3795,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, '_, 'infcx, 'tcx> {
3795
3795
if let Some ( decl) = local_decl
3796
3796
&& decl. can_be_made_mutable ( )
3797
3797
{
3798
- err. span_suggestion_verbose (
3798
+ err. span_suggestion (
3799
3799
decl. source_info . span . shrink_to_lo ( ) ,
3800
3800
"consider making this binding mutable" ,
3801
3801
"mut " . to_string ( ) ,
@@ -3810,7 +3810,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, '_, 'infcx, 'tcx> {
3810
3810
} ) )
3811
3811
)
3812
3812
{
3813
- err. span_suggestion_verbose (
3813
+ err. span_suggestion (
3814
3814
decl. source_info . span . shrink_to_lo ( ) ,
3815
3815
"to modify the original value, take a borrow instead" ,
3816
3816
"ref mut " . to_string ( ) ,
0 commit comments