From 4e7d47bb6c91f6db5d043a152d11ab7528266d25 Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Sat, 29 Jan 2022 21:10:41 +0100 Subject: Make dead code check a query. --- compiler/rustc_middle/src/query/mod.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'compiler/rustc_middle/src/query') diff --git a/compiler/rustc_middle/src/query/mod.rs b/compiler/rustc_middle/src/query/mod.rs index 715a1fa25a1..73128de9848 100644 --- a/compiler/rustc_middle/src/query/mod.rs +++ b/compiler/rustc_middle/src/query/mod.rs @@ -750,6 +750,22 @@ rustc_queries! { desc { |tcx| "checking liveness of variables in {}", describe_as_module(key, tcx) } } + /// Return the live symbols in the crate for dead code check. + /// + /// The second return value maps from ADTs to ignored derived traits (e.g. Debug and Clone) and + /// their respective impl (i.e., part of the derive macro) + query live_symbols_and_ignored_derived_traits(_: ()) -> ( + FxHashSet, + FxHashMap> + ) { + storage(ArenaCacheSelector<'tcx>) + desc { "find live symbols in crate" } + } + + query check_mod_deathness(key: LocalDefId) -> () { + desc { |tcx| "checking deathness of variables in {}", describe_as_module(key, tcx) } + } + query check_mod_impl_wf(key: LocalDefId) -> () { desc { |tcx| "checking that impls are well-formed in {}", describe_as_module(key, tcx) } } -- cgit 1.4.1-3-g733a5