Skip to content

Commit ec7c026

Browse files
committed
Auto merge of #144863 - cjgillot:live-or-dead, r=Urgau
Simplify dead code lint This PR scratches a few itches I had when looking at that code. The perf improvement comes from keeping the `scanned` set through several marking phases. This pretty much divides by 2 the number of HIR traversals.
2 parents 213d946 + d0da6ca commit ec7c026

File tree

3 files changed

+199
-274
lines changed

3 files changed

+199
-274
lines changed

compiler/rustc_middle/src/query/mod.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,11 +1178,10 @@ rustc_queries! {
11781178

11791179
/// Return the live symbols in the crate for dead code check.
11801180
///
1181-
/// The second return value maps from ADTs to ignored derived traits (e.g. Debug and Clone) and
1182-
/// their respective impl (i.e., part of the derive macro)
1181+
/// The second return value maps from ADTs to ignored derived traits (e.g. Debug and Clone).
11831182
query live_symbols_and_ignored_derived_traits(_: ()) -> &'tcx (
11841183
LocalDefIdSet,
1185-
LocalDefIdMap<FxIndexSet<(DefId, DefId)>>
1184+
LocalDefIdMap<FxIndexSet<DefId>>,
11861185
) {
11871186
arena_cache
11881187
desc { "finding live symbols in crate" }

0 commit comments

Comments
 (0)