Re-exportsΒ§
use std::mem;πuse std::ops::ControlFlow;πuse std::sync::atomic::Ordering;πuse hir::def_id::LocalDefIdSet;πuse rustc_abi::FieldIdx;πuse rustc_attr_ir::find_attr;πuse rustc_data_structures::fx::FxHashMap;πuse rustc_data_structures::fx::FxHashSet;πuse rustc_errors::ErrorGuaranteed;πuse rustc_errors::MultiSpan;πuse rustc_hir::def::CtorOf;πuse rustc_hir::def::DefKind;πuse rustc_hir::def::Res;πuse rustc_hir::def_id::DefId;πuse rustc_hir::def_id::LocalDefId;πuse rustc_hir::def_id::LocalDefIdMap;πuse rustc_hir::def_id::LocalModId;πuse rustc_hir::intravisit;πuse rustc_hir::intravisit::Visitor;πuse rustc_hir as hir;πuse rustc_hir::ForeignItemId;πuse rustc_hir::ItemId;πuse rustc_hir::Node;πuse rustc_hir::PatKind;πuse rustc_hir::QPath;πuse rustc_lint_defs::builtin::DEAD_CODE;πuse rustc_lint_defs::builtin::DEAD_CODE_PUB_IN_BINARY;πuse rustc_lint_defs as lint;πuse rustc_lint_defs::Lint;πuse rustc_lint_defs::StableLintExpectationId;πuse rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags;πuse rustc_middle::middle::dead_code::DeadCodeLivenessSnapshot;πuse rustc_middle::middle::dead_code::DeadCodeLivenessSummary;πuse rustc_middle::middle::privacy::Level;πuse rustc_middle::query::Providers;πuse rustc_middle::ty;πuse rustc_middle::ty::AssocTag;πuse rustc_middle::ty::TyCtxt;πuse rustc_span::ExpnKind;πuse rustc_span::MacroKind;πuse rustc_span::Span;πuse rustc_span::Symbol;πuse rustc_span::bug;πuse rustc_span::kw;πuse rustc_span::span_bug;πuse rustc_structures::CrateType;πuse crate::diagnostics::ChangeFields;πuse crate::diagnostics::DeadCodePubInBinaryNote;πuse crate::diagnostics::MultipleDeadCodes;πuse crate::diagnostics::ParentInfo;πuse crate::diagnostics::UselessAssignment;π
StructsΒ§
- Dead
Item π - Dead
Visitor π - Deferred
Seeds π - Live
Symbols π - Mark
Symbol πVisitor - Scanned
Item π - Seed
Worklists π - Work
Item π - Carries both the propagated
allow/expectcontext and the current itemβs ownallow/expectstatus.
EnumsΒ§
- Comes
From πAllow Expect - Determine if a work from the worklist is coming from a
#[allow]or a#[expect]ofdead_code - Impl
Item πCheck Result - Report
On π - Should
Warn πAbout Field
FunctionsΒ§
- check_
mod_ πdeathness - create_
and_ πseed_ worklist - has_
allow_ πdead_ code_ or_ lang_ attr - lint_
dead_ πcodes - live_
symbols_ πand_ trivial_ usage_ sites - maybe_
record_ πas_ seed - Examine the given definition and record it in the worklist if it should be considered live.
- provide π
- should_
explore π - Any local definition that may call something in its body block should be explored. For example, if itβs a live function, then we should explore its block to check for codes that may need to be marked as live.