@@ -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 (
@@ -3477,9 +3477,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
3477
3477
& self ,
3478
3478
err : & mut Diag < ' _ > ,
3479
3479
item_name : Ident ,
3480
- valid_out_of_scope_traits : Vec < DefId > ,
3480
+ mut valid_out_of_scope_traits : Vec < DefId > ,
3481
3481
explain : bool ,
3482
3482
) -> bool {
3483
+ valid_out_of_scope_traits. retain ( |id| self . tcx . is_user_visible_dep ( id. krate ) ) ;
3483
3484
if !valid_out_of_scope_traits. is_empty ( ) {
3484
3485
let mut candidates = valid_out_of_scope_traits;
3485
3486
candidates. sort_by_key ( |id| self . tcx . def_path_str ( id) ) ;
@@ -4384,7 +4385,7 @@ pub(crate) struct TraitInfo {
4384
4385
/// Retrieves all traits in this crate and any dependent crates,
4385
4386
/// and wraps them into `TraitInfo` for custom sorting.
4386
4387
pub ( crate ) fn all_traits ( tcx : TyCtxt < ' _ > ) -> Vec < TraitInfo > {
4387
- tcx. all_traits ( ) . map ( |def_id| TraitInfo { def_id } ) . collect ( )
4388
+ tcx. all_traits_including_private ( ) . map ( |def_id| TraitInfo { def_id } ) . collect ( )
4388
4389
}
4389
4390
4390
4391
fn print_disambiguation_help < ' tcx > (
0 commit comments