@@ -161,6 +161,7 @@ impl<'a> Resolver<'a> {
161161 found_use,
162162 DiagnosticMode :: Normal ,
163163 path,
164+ None ,
164165 ) ;
165166 err. emit ( ) ;
166167 } else if let Some ( ( span, msg, sugg, appl) ) = suggestion {
@@ -690,6 +691,7 @@ impl<'a> Resolver<'a> {
690691 FoundUse :: Yes ,
691692 DiagnosticMode :: Pattern ,
692693 vec ! [ ] ,
694+ None ,
693695 ) ;
694696 }
695697 err
@@ -1344,6 +1346,7 @@ impl<'a> Resolver<'a> {
13441346 FoundUse :: Yes ,
13451347 DiagnosticMode :: Normal ,
13461348 vec ! [ ] ,
1349+ None ,
13471350 ) ;
13481351
13491352 if macro_kind == MacroKind :: Derive && ( ident. name == sym:: Send || ident. name == sym:: Sync ) {
@@ -2325,6 +2328,7 @@ pub(crate) fn import_candidates(
23252328 use_placement_span : Option < Span > ,
23262329 candidates : & [ ImportSuggestion ] ,
23272330 mode : DiagnosticMode ,
2331+ append : Option < & str > ,
23282332) {
23292333 show_candidates (
23302334 session,
@@ -2336,6 +2340,7 @@ pub(crate) fn import_candidates(
23362340 FoundUse :: Yes ,
23372341 mode,
23382342 vec ! [ ] ,
2343+ append,
23392344 ) ;
23402345}
23412346
@@ -2353,10 +2358,12 @@ fn show_candidates(
23532358 found_use : FoundUse ,
23542359 mode : DiagnosticMode ,
23552360 path : Vec < Segment > ,
2361+ append : Option < & str > ,
23562362) {
23572363 if candidates. is_empty ( ) {
23582364 return ;
23592365 }
2366+ let append = append. unwrap_or ( "" ) ;
23602367
23612368 let mut accessible_path_strings: Vec < ( String , & str , Option < DefId > , & Option < String > ) > =
23622369 Vec :: new ( ) ;
@@ -2417,7 +2424,7 @@ fn show_candidates(
24172424 // produce an additional newline to separate the new use statement
24182425 // from the directly following item.
24192426 let additional_newline = if let FoundUse :: Yes = found_use { "" } else { "\n " } ;
2420- candidate. 0 = format ! ( "{}{};\n {}" , add_use , & candidate. 0 , additional_newline ) ;
2427+ candidate. 0 = format ! ( "{add_use }{}{append} ;\n {additional_newline }" , & candidate. 0 ) ;
24212428 }
24222429
24232430 err. span_suggestions (
0 commit comments