Skip to content

Commit

Permalink
Lints pub methods in impl non-pub T
Browse files Browse the repository at this point in the history
  • Loading branch information
mu001999 committed Nov 25, 2023
1 parent 3d0eaf7 commit c8bc78f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions compiler/rustc_passes/src/dead.rs
Original file line number Diff line number Diff line change
Expand Up @@ -669,8 +669,9 @@ fn check_item<'tcx>(

// And we access the Map here to get HirId from LocalDefId
for id in local_def_ids {
if tcx.local_visibility(id) == Visibility::Public
|| of_trait && !matches!(tcx.def_kind(id), DefKind::AssocFn)
if of_trait
&& (!matches!(tcx.def_kind(id), DefKind::AssocFn)
|| tcx.local_visibility(id) == Visibility::Public)
{
worklist.push((id, ComesFromAllowExpect::No));
} else if let Some(comes_from_allow) = has_allow_dead_code_or_lang_attr(tcx, id) {
Expand Down

0 comments on commit c8bc78f

Please sign in to comment.