@@ -333,7 +333,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
333333 let local_decl = & self . body . local_decls [ local] ;
334334 assert_eq ! ( local_decl. mutability, Mutability :: Not ) ;
335335
336- err. span_label ( span, format ! ( "cannot {ACT}" , ACT = act ) ) ;
336+ err. span_label ( span, format ! ( "cannot {act}" ) ) ;
337337 err. span_suggestion (
338338 local_decl. source_info . span ,
339339 "consider changing this to be mutable" ,
@@ -357,7 +357,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
357357
358358 let captured_place = & self . upvars [ upvar_index. index ( ) ] . place ;
359359
360- err. span_label ( span, format ! ( "cannot {ACT}" , ACT = act ) ) ;
360+ err. span_label ( span, format ! ( "cannot {act}" ) ) ;
361361
362362 let upvar_hir_id = captured_place. get_root_variable ( ) ;
363363
@@ -397,7 +397,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
397397 . span_to_snippet ( span)
398398 . map_or ( false , |snippet| snippet. starts_with ( "&mut " ) ) =>
399399 {
400- err. span_label ( span, format ! ( "cannot {ACT}" , ACT = act ) ) ;
400+ err. span_label ( span, format ! ( "cannot {act}" ) ) ;
401401 err. span_suggestion (
402402 span,
403403 "try removing `&mut` here" ,
@@ -409,7 +409,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
409409 PlaceRef { local, projection : [ ProjectionElem :: Deref ] }
410410 if self . body . local_decls [ local] . is_ref_for_guard ( ) =>
411411 {
412- err. span_label ( span, format ! ( "cannot {ACT}" , ACT = act ) ) ;
412+ err. span_label ( span, format ! ( "cannot {act}" ) ) ;
413413 err. note (
414414 "variables bound in patterns are immutable until the end of the pattern guard" ,
415415 ) ;
@@ -537,7 +537,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
537537 Some ( ( true , err_help_span, suggested_code) ) => {
538538 let ( is_trait_sig, local_trait) = self . is_error_in_trait ( local) ;
539539 if !is_trait_sig {
540- err. span_suggestion (
540+ err. span_suggestion_verbose (
541541 err_help_span,
542542 & format ! (
543543 "consider changing this to be a mutable {pointer_desc}"
@@ -546,7 +546,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
546546 Applicability :: MachineApplicable ,
547547 ) ;
548548 } else if let Some ( x) = local_trait {
549- err. span_suggestion (
549+ err. span_suggestion_verbose (
550550 x,
551551 & format ! (
552552 "consider changing that to be a mutable {pointer_desc}"
@@ -569,24 +569,15 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
569569 err. span_label (
570570 span,
571571 format ! (
572- "`{NAME}` is a `{SIGIL}` {DESC}, \
573- so the data it refers to cannot be {ACTED_ON}",
574- NAME = name,
575- SIGIL = pointer_sigil,
576- DESC = pointer_desc,
577- ACTED_ON = acted_on
572+ "`{name}` is a `{pointer_sigil}` {pointer_desc}, \
573+ so the data it refers to cannot be {acted_on}",
578574 ) ,
579575 ) ;
580576 }
581577 _ => {
582578 err. span_label (
583579 span,
584- format ! (
585- "cannot {ACT} through `{SIGIL}` {DESC}" ,
586- ACT = act,
587- SIGIL = pointer_sigil,
588- DESC = pointer_desc
589- ) ,
580+ format ! ( "cannot {act} through `{pointer_sigil}` {pointer_desc}" ) ,
590581 ) ;
591582 }
592583 }
@@ -605,13 +596,13 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
605596 Some ( BorrowedContentSource :: OverloadedDeref ( ty) ) => {
606597 err. help ( & format ! (
607598 "trait `DerefMut` is required to modify through a dereference, \
608- but it is not implemented for `{ty}`",
599+ but it is not implemented for `{ty}`",
609600 ) ) ;
610601 }
611602 Some ( BorrowedContentSource :: OverloadedIndex ( ty) ) => {
612603 err. help ( & format ! (
613604 "trait `IndexMut` is required to modify indexed content, \
614- but it is not implemented for `{ty}`",
605+ but it is not implemented for `{ty}`",
615606 ) ) ;
616607 self . suggest_map_index_mut_alternatives ( ty, & mut err, span) ;
617608 }
@@ -620,7 +611,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
620611 }
621612
622613 _ => {
623- err. span_label ( span, format ! ( "cannot {ACT}" , ACT = act ) ) ;
614+ err. span_label ( span, format ! ( "cannot {act}" ) ) ;
624615 }
625616 }
626617
0 commit comments