@@ -161,6 +161,7 @@ impl<'a> Resolver<'a> {
161
161
found_use,
162
162
DiagnosticMode :: Normal ,
163
163
path,
164
+ None ,
164
165
) ;
165
166
err. emit ( ) ;
166
167
} else if let Some ( ( span, msg, sugg, appl) ) = suggestion {
@@ -690,6 +691,7 @@ impl<'a> Resolver<'a> {
690
691
FoundUse :: Yes ,
691
692
DiagnosticMode :: Pattern ,
692
693
vec ! [ ] ,
694
+ None ,
693
695
) ;
694
696
}
695
697
err
@@ -1344,6 +1346,7 @@ impl<'a> Resolver<'a> {
1344
1346
FoundUse :: Yes ,
1345
1347
DiagnosticMode :: Normal ,
1346
1348
vec ! [ ] ,
1349
+ None ,
1347
1350
) ;
1348
1351
1349
1352
if macro_kind == MacroKind :: Derive && ( ident. name == sym:: Send || ident. name == sym:: Sync ) {
@@ -2325,6 +2328,7 @@ pub(crate) fn import_candidates(
2325
2328
use_placement_span : Option < Span > ,
2326
2329
candidates : & [ ImportSuggestion ] ,
2327
2330
mode : DiagnosticMode ,
2331
+ append : Option < & str > ,
2328
2332
) {
2329
2333
show_candidates (
2330
2334
session,
@@ -2336,6 +2340,7 @@ pub(crate) fn import_candidates(
2336
2340
FoundUse :: Yes ,
2337
2341
mode,
2338
2342
vec ! [ ] ,
2343
+ append,
2339
2344
) ;
2340
2345
}
2341
2346
@@ -2353,10 +2358,12 @@ fn show_candidates(
2353
2358
found_use : FoundUse ,
2354
2359
mode : DiagnosticMode ,
2355
2360
path : Vec < Segment > ,
2361
+ append : Option < & str > ,
2356
2362
) {
2357
2363
if candidates. is_empty ( ) {
2358
2364
return ;
2359
2365
}
2366
+ let append = append. unwrap_or ( "" ) ;
2360
2367
2361
2368
let mut accessible_path_strings: Vec < ( String , & str , Option < DefId > , & Option < String > ) > =
2362
2369
Vec :: new ( ) ;
@@ -2417,7 +2424,7 @@ fn show_candidates(
2417
2424
// produce an additional newline to separate the new use statement
2418
2425
// from the directly following item.
2419
2426
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 ) ;
2421
2428
}
2422
2429
2423
2430
err. span_suggestions (
0 commit comments