@@ -1475,7 +1475,7 @@ crate fn show_candidates(
1475
1475
// This is `None` if all placement locations are inside expansions
1476
1476
use_placement_span : Option < Span > ,
1477
1477
candidates : & [ ImportSuggestion ] ,
1478
- better : bool ,
1478
+ instead : bool ,
1479
1479
found_use : bool ,
1480
1480
) {
1481
1481
if candidates. is_empty ( ) {
@@ -1486,6 +1486,7 @@ crate fn show_candidates(
1486
1486
// by iterating through a hash map, so make sure they are ordered:
1487
1487
let mut path_strings: Vec < _ > =
1488
1488
candidates. iter ( ) . map ( |c| path_names_to_string ( & c. path ) ) . collect ( ) ;
1489
+
1489
1490
path_strings. sort ( ) ;
1490
1491
path_strings. dedup ( ) ;
1491
1492
@@ -1494,8 +1495,9 @@ crate fn show_candidates(
1494
1495
} else {
1495
1496
( "one of these" , "items" )
1496
1497
} ;
1497
- let instead = if better { " instead" } else { "" } ;
1498
- let msg = format ! ( "consider importing {} {}{}" , determiner, kind, instead) ;
1498
+
1499
+ let instead = if instead { " instead" } else { "" } ;
1500
+ let mut msg = format ! ( "consider importing {} {}{}" , determiner, kind, instead) ;
1499
1501
1500
1502
if let Some ( span) = use_placement_span {
1501
1503
for candidate in & mut path_strings {
@@ -1507,12 +1509,13 @@ crate fn show_candidates(
1507
1509
1508
1510
err. span_suggestions ( span, & msg, path_strings. into_iter ( ) , Applicability :: Unspecified ) ;
1509
1511
} else {
1510
- let mut msg = msg;
1511
1512
msg. push ( ':' ) ;
1513
+
1512
1514
for candidate in path_strings {
1513
1515
msg. push ( '\n' ) ;
1514
1516
msg. push_str ( & candidate) ;
1515
1517
}
1518
+
1516
1519
err. note ( & msg) ;
1517
1520
}
1518
1521
}
0 commit comments