diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2022-01-29 21:10:41 +0100 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2022-02-01 13:11:03 +0100 |
| commit | 4e7d47bb6c91f6db5d043a152d11ab7528266d25 (patch) | |
| tree | 6b2e6ee3b86790ba76e3c98fceb366e91c5dc4f6 /compiler/rustc_middle/src/query | |
| parent | 312a7995e73e390646bc61920ffead7a640addc6 (diff) | |
| download | rust-4e7d47bb6c91f6db5d043a152d11ab7528266d25.tar.gz rust-4e7d47bb6c91f6db5d043a152d11ab7528266d25.zip | |
Make dead code check a query.
Diffstat (limited to 'compiler/rustc_middle/src/query')
| -rw-r--r-- | compiler/rustc_middle/src/query/mod.rs | 16 |
1 files changed, 16 insertions, 0 deletions
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<LocalDefId>, + FxHashMap<LocalDefId, Vec<(DefId, DefId)>> + ) { + 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) } } |
