We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3d0eaf7 commit c8bc78fCopy full SHA for c8bc78f
compiler/rustc_passes/src/dead.rs
@@ -669,8 +669,9 @@ fn check_item<'tcx>(
669
670
// And we access the Map here to get HirId from LocalDefId
671
for id in local_def_ids {
672
- if tcx.local_visibility(id) == Visibility::Public
673
- || of_trait && !matches!(tcx.def_kind(id), DefKind::AssocFn)
+ if of_trait
+ && (!matches!(tcx.def_kind(id), DefKind::AssocFn)
674
+ || tcx.local_visibility(id) == Visibility::Public)
675
{
676
worklist.push((id, ComesFromAllowExpect::No));
677
} else if let Some(comes_from_allow) = has_allow_dead_code_or_lang_attr(tcx, id) {
0 commit comments