Skip to content

Commit c8bc78f

Browse files
committed
Lints pub methods in impl non-pub T
1 parent 3d0eaf7 commit c8bc78f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

compiler/rustc_passes/src/dead.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -669,8 +669,9 @@ fn check_item<'tcx>(
669669

670670
// And we access the Map here to get HirId from LocalDefId
671671
for id in local_def_ids {
672-
if tcx.local_visibility(id) == Visibility::Public
673-
|| of_trait && !matches!(tcx.def_kind(id), DefKind::AssocFn)
672+
if of_trait
673+
&& (!matches!(tcx.def_kind(id), DefKind::AssocFn)
674+
|| tcx.local_visibility(id) == Visibility::Public)
674675
{
675676
worklist.push((id, ComesFromAllowExpect::No));
676677
} else if let Some(comes_from_allow) = has_allow_dead_code_or_lang_attr(tcx, id) {

0 commit comments

Comments
 (0)