@@ -1725,7 +1725,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
17251725 if unsatisfied_predicates. is_empty ( )
17261726 // ...or if we already suggested that name because of `rustc_confusable` annotation
17271727 && Some ( similar_candidate. name ( ) ) != confusable_suggested
1728- // and if the we aren't in an expansion.
1728+ // and if we aren't in an expansion.
17291729 && !span. from_expansion ( )
17301730 {
17311731 self . find_likely_intended_associated_item (
@@ -3481,9 +3481,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
34813481 & self ,
34823482 err : & mut Diag < ' _ > ,
34833483 item_name : Ident ,
3484- valid_out_of_scope_traits : Vec < DefId > ,
3484+ mut valid_out_of_scope_traits : Vec < DefId > ,
34853485 explain : bool ,
34863486 ) -> bool {
3487+ valid_out_of_scope_traits. retain ( |id| self . tcx . is_user_visible_dep ( id. krate ) ) ;
34873488 if !valid_out_of_scope_traits. is_empty ( ) {
34883489 let mut candidates = valid_out_of_scope_traits;
34893490 candidates. sort_by_key ( |id| self . tcx . def_path_str ( id) ) ;
@@ -4388,7 +4389,7 @@ pub(crate) struct TraitInfo {
43884389/// Retrieves all traits in this crate and any dependent crates,
43894390/// and wraps them into `TraitInfo` for custom sorting.
43904391pub ( crate ) fn all_traits ( tcx : TyCtxt < ' _ > ) -> Vec < TraitInfo > {
4391- tcx. all_traits ( ) . map ( |def_id| TraitInfo { def_id } ) . collect ( )
4392+ tcx. all_traits_including_private ( ) . map ( |def_id| TraitInfo { def_id } ) . collect ( )
43924393}
43934394
43944395fn print_disambiguation_help < ' tcx > (
0 commit comments