@@ -1021,17 +1021,11 @@ impl<'a> Resolver<'a> {
10211021 ( "" , "" )
10221022 } ;
10231023
1024- let article = if built_in. is_empty ( ) { res. article ( ) } else { "a" } ;
1025- format ! (
1026- "{a}{built_in} {thing}{from}" ,
1027- a = article,
1028- thing = res. descr( ) ,
1029- built_in = built_in,
1030- from = from
1031- )
1024+ let a = if built_in. is_empty ( ) { res. article ( ) } else { "a" } ;
1025+ format ! ( "{a}{built_in} {thing}{from}" , thing = res. descr( ) )
10321026 } else {
10331027 let introduced = if b. is_import ( ) { "imported" } else { "defined" } ;
1034- format ! ( "the {thing} {introduced} here" , thing = res. descr( ) , introduced = introduced )
1028+ format ! ( "the {thing} {introduced} here" , thing = res. descr( ) )
10351029 }
10361030 }
10371031
@@ -1049,19 +1043,13 @@ impl<'a> Resolver<'a> {
10491043 ident. span,
10501044 E0659 ,
10511045 "`{ident}` is ambiguous ({why})" ,
1052- ident = ident,
10531046 why = kind. descr( )
10541047 ) ;
10551048 err. span_label ( ident. span , "ambiguous name" ) ;
10561049
10571050 let mut could_refer_to = |b : & NameBinding < ' _ > , misc : AmbiguityErrorMisc , also : & str | {
10581051 let what = self . binding_description ( b, ident, misc == AmbiguityErrorMisc :: FromPrelude ) ;
1059- let note_msg = format ! (
1060- "`{ident}` could{also} refer to {what}" ,
1061- ident = ident,
1062- also = also,
1063- what = what
1064- ) ;
1052+ let note_msg = format ! ( "`{ident}` could{also} refer to {what}" ) ;
10651053
10661054 let thing = b. res ( ) . descr ( ) ;
10671055 let mut help_msgs = Vec :: new ( ) ;
@@ -1071,30 +1059,18 @@ impl<'a> Resolver<'a> {
10711059 || kind == AmbiguityKind :: GlobVsOuter && swapped != also. is_empty ( ) )
10721060 {
10731061 help_msgs. push ( format ! (
1074- "consider adding an explicit import of \
1075- `{ident}` to disambiguate",
1076- ident = ident
1062+ "consider adding an explicit import of `{ident}` to disambiguate"
10771063 ) )
10781064 }
10791065 if b. is_extern_crate ( ) && ident. span . rust_2018 ( ) {
1080- help_msgs. push ( format ! (
1081- "use `::{ident}` to refer to this {thing} unambiguously" ,
1082- ident = ident,
1083- thing = thing,
1084- ) )
1066+ help_msgs. push ( format ! ( "use `::{ident}` to refer to this {thing} unambiguously" ) )
10851067 }
10861068 if misc == AmbiguityErrorMisc :: SuggestCrate {
1087- help_msgs. push ( format ! (
1088- "use `crate::{ident}` to refer to this {thing} unambiguously" ,
1089- ident = ident,
1090- thing = thing,
1091- ) )
1069+ help_msgs
1070+ . push ( format ! ( "use `crate::{ident}` to refer to this {thing} unambiguously" ) )
10921071 } else if misc == AmbiguityErrorMisc :: SuggestSelf {
1093- help_msgs. push ( format ! (
1094- "use `self::{ident}` to refer to this {thing} unambiguously" ,
1095- ident = ident,
1096- thing = thing,
1097- ) )
1072+ help_msgs
1073+ . push ( format ! ( "use `self::{ident}` to refer to this {thing} unambiguously" ) )
10981074 }
10991075
11001076 err. span_note ( b. span , & note_msg) ;
@@ -1167,12 +1143,10 @@ impl<'a> Resolver<'a> {
11671143 } ;
11681144
11691145 let first = ptr:: eq ( binding, first_binding) ;
1170- let descr = get_descr ( binding) ;
11711146 let msg = format ! (
11721147 "{and_refers_to}the {item} `{name}`{which} is defined here{dots}" ,
11731148 and_refers_to = if first { "" } else { "...and refers to " } ,
1174- item = descr,
1175- name = name,
1149+ item = get_descr( binding) ,
11761150 which = if first { "" } else { " which" } ,
11771151 dots = if next_binding. is_some( ) { "..." } else { "" } ,
11781152 ) ;
0 commit comments