@@ -1725,7 +1725,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
1725
1725
if unsatisfied_predicates. is_empty ( )
1726
1726
// ...or if we already suggested that name because of `rustc_confusable` annotation
1727
1727
&& 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.
1729
1729
&& !span. from_expansion ( )
1730
1730
{
1731
1731
self . find_likely_intended_associated_item (
@@ -3481,9 +3481,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
3481
3481
& self ,
3482
3482
err : & mut Diag < ' _ > ,
3483
3483
item_name : Ident ,
3484
- valid_out_of_scope_traits : Vec < DefId > ,
3484
+ mut valid_out_of_scope_traits : Vec < DefId > ,
3485
3485
explain : bool ,
3486
3486
) -> bool {
3487
+ valid_out_of_scope_traits. retain ( |id| self . tcx . is_user_visible_dep ( id. krate ) ) ;
3487
3488
if !valid_out_of_scope_traits. is_empty ( ) {
3488
3489
let mut candidates = valid_out_of_scope_traits;
3489
3490
candidates. sort_by_key ( |id| self . tcx . def_path_str ( id) ) ;
@@ -4388,7 +4389,7 @@ pub(crate) struct TraitInfo {
4388
4389
/// Retrieves all traits in this crate and any dependent crates,
4389
4390
/// and wraps them into `TraitInfo` for custom sorting.
4390
4391
pub ( 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 ( )
4392
4393
}
4393
4394
4394
4395
fn print_disambiguation_help < ' tcx > (
0 commit comments