@@ -1475,7 +1475,7 @@ crate fn show_candidates(
14751475 // This is `None` if all placement locations are inside expansions
14761476 use_placement_span : Option < Span > ,
14771477 candidates : & [ ImportSuggestion ] ,
1478- better : bool ,
1478+ instead : bool ,
14791479 found_use : bool ,
14801480) {
14811481 if candidates. is_empty ( ) {
@@ -1486,6 +1486,7 @@ crate fn show_candidates(
14861486 // by iterating through a hash map, so make sure they are ordered:
14871487 let mut path_strings: Vec < _ > =
14881488 candidates. iter ( ) . map ( |c| path_names_to_string ( & c. path ) ) . collect ( ) ;
1489+
14891490 path_strings. sort ( ) ;
14901491 path_strings. dedup ( ) ;
14911492
@@ -1494,8 +1495,9 @@ crate fn show_candidates(
14941495 } else {
14951496 ( "one of these" , "items" )
14961497 } ;
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) ;
14991501
15001502 if let Some ( span) = use_placement_span {
15011503 for candidate in & mut path_strings {
@@ -1507,12 +1509,13 @@ crate fn show_candidates(
15071509
15081510 err. span_suggestions ( span, & msg, path_strings. into_iter ( ) , Applicability :: Unspecified ) ;
15091511 } else {
1510- let mut msg = msg;
15111512 msg. push ( ':' ) ;
1513+
15121514 for candidate in path_strings {
15131515 msg. push ( '\n' ) ;
15141516 msg. push_str ( & candidate) ;
15151517 }
1518+
15161519 err. note ( & msg) ;
15171520 }
15181521}
0 commit comments