fn maybe_record_as_seed<'tcx>(
tcx: TyCtxt<'tcx>,
owner_id: OwnerId,
worklist: &mut Vec<(LocalDefId, ComesFromAllowExpect)>,
unsolved_items: &mut Vec<LocalDefId>,
)Expand description
Examine the given definition and record it in the worklist if it should be considered live.
We want to explicitly consider as live:
-
Item annotated with #[allow(dead_code)] This is done so that if we want to suppress warnings for a group of dead functions, we only have to annotate the “root”. For example, if both
fandgare dead andfcallsg, then annotatingfwith#[allow(dead_code)]will suppress warning for bothfandg. -
Item annotated with #[lang=“..”] Lang items are always callable from elsewhere.
For trait methods and implementations of traits, we are not certain that the definitions are
live at this stage. We record them in unsolved_items for later examination.