This is a sub-issue of #40746. The follow list of tasks are all executed for side-effects. I believe they can all be straight-up removed (that is, we just don't create a task at all). The idea is to remove the call to with_task or in_task as well as the associated DepNode variant and see what happens -- if you get assertion failures, it may mean that they are writing to shared state, in which case we'll want to keep the task and refactor it in some other way.
An example PR is #41063. See e.g. the first commit which removed the CheckLoops stuff.
This is a sub-issue of #40746. The follow list of tasks are all executed for side-effects. I believe they can all be straight-up removed (that is, we just don't create a task at all). The idea is to remove the call to
with_taskorin_taskas well as the associatedDepNodevariant and see what happens -- if you get assertion failures, it may mean that they are writing to shared state, in which case we'll want to keep the task and refactor it in some other way.An example PR is #41063. See e.g. the first commit which removed the
CheckLoopsstuff.src/librustc_passes/loops.rs:53: let _task = map.dep_graph.in_task(DepNode::CheckLoops);src/librustc_passes/static_recursion.rs:91: let _task = hir_map.dep_graph.in_task(DepNode::CheckStaticRecursion);src/librustc_borrowck/borrowck/mod.rs:64: tcx.dep_graph.with_task(DepNode::BorrowCheckKrate, tcx, (), check_crate_task);src/librustc/middle/effect.rs:244: let _task = tcx.dep_graph.in_task(DepNode::EffectCheck);src/librustc/middle/liveness.rs:199: let _task = tcx.dep_graph.in_task(DepNode::Liveness);src/librustc_typeck/check_unused.rs:65: let _task = tcx.dep_graph.in_task(DepNode::UnusedTraitCheck);src/librustc/middle/dead.rs:597: let _task = tcx.dep_graph.in_task(DepNode::DeadCheck);AccessLevelsquery described elsewheresrc/librustc_typeck/coherence/mod.rs:135: let _task = tcx.dep_graph.in_task(DepNode::Coherence);src/librustc_typeck/coherence/overlap.rs:42: tcx.dep_graph.in_task(DepNode::CoherenceOverlapCheck(trait_def_id));src/librustc_typeck/collect.rs:171: self.tcx.dep_graph.with_task(DepNode::CollectItemSig(def_id), self.tcx, id, op);