Skip to content

Commit 8388772

Browse files
committed
kill a bunch of one off tasks
1 parent 810e015 commit 8388772

File tree

13 files changed

+1
-49
lines changed

13 files changed

+1
-49
lines changed

src/librustc/dep_graph/dep_node.rs

-20
Original file line numberDiff line numberDiff line change
@@ -56,21 +56,14 @@ pub enum DepNode<D: Clone + Debug> {
5656
WorkProduct(Arc<WorkProductId>),
5757

5858
// Represents different phases in the compiler.
59-
CollectLanguageItems,
60-
ResolveLifetimes,
6159
RegionResolveCrate,
62-
PluginRegistrar,
63-
StabilityIndex,
6460
Coherence,
6561
Resolve,
66-
EntryPoint,
67-
CheckEntryFn,
6862
CoherenceCheckTrait(D),
6963
CoherenceCheckImpl(D),
7064
CoherenceOverlapCheck(D),
7165
CoherenceOverlapCheckSpecial(D),
7266
Variance,
73-
UnusedTraitCheck,
7467
PrivacyAccessLevels(CrateNum),
7568

7669
// Represents the MIR for a fn; also used as the task node for
@@ -83,13 +76,10 @@ pub enum DepNode<D: Clone + Debug> {
8376
BorrowCheck(D),
8477
RvalueCheck(D),
8578
Reachability,
86-
DeadCheck,
8779
LateLintCheck,
88-
TransCrate,
8980
TransCrateItem(D),
9081
TransInlinedItem(D),
9182
TransWriteMetadata,
92-
LinkBinary,
9383

9484
// Nodes representing bits of computed IR in the tcx. Each shared
9585
// table in the tcx (or elsewhere) maps to one of these
@@ -200,24 +190,14 @@ impl<D: Clone + Debug> DepNode<D> {
200190
BorrowCheckKrate => Some(BorrowCheckKrate),
201191
MirKrate => Some(MirKrate),
202192
TypeckBodiesKrate => Some(TypeckBodiesKrate),
203-
CollectLanguageItems => Some(CollectLanguageItems),
204-
ResolveLifetimes => Some(ResolveLifetimes),
205193
RegionResolveCrate => Some(RegionResolveCrate),
206-
PluginRegistrar => Some(PluginRegistrar),
207-
StabilityIndex => Some(StabilityIndex),
208194
Coherence => Some(Coherence),
209195
Resolve => Some(Resolve),
210-
EntryPoint => Some(EntryPoint),
211-
CheckEntryFn => Some(CheckEntryFn),
212196
Variance => Some(Variance),
213-
UnusedTraitCheck => Some(UnusedTraitCheck),
214197
PrivacyAccessLevels(k) => Some(PrivacyAccessLevels(k)),
215198
Reachability => Some(Reachability),
216-
DeadCheck => Some(DeadCheck),
217199
LateLintCheck => Some(LateLintCheck),
218-
TransCrate => Some(TransCrate),
219200
TransWriteMetadata => Some(TransWriteMetadata),
220-
LinkBinary => Some(LinkBinary),
221201

222202
// work product names do not need to be mapped, because
223203
// they are always absolute.

src/librustc/middle/dead.rs

-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
// closely. The idea is that all reachable symbols are live, codes called
1313
// from live codes are live, and everything else is dead.
1414

15-
use dep_graph::DepNode;
1615
use hir::map as hir_map;
1716
use hir::{self, PatKind};
1817
use hir::intravisit::{self, Visitor, NestedVisitorMap};
@@ -594,7 +593,6 @@ impl<'a, 'tcx> Visitor<'tcx> for DeadVisitor<'a, 'tcx> {
594593
}
595594

596595
pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
597-
let _task = tcx.dep_graph.in_task(DepNode::DeadCheck);
598596
let access_levels = &ty::queries::privacy_access_levels::get(tcx, DUMMY_SP, LOCAL_CRATE);
599597
let krate = tcx.hir.krate();
600598
let live_symbols = find_live(tcx, access_levels, krate);

src/librustc/middle/entry.rs

-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
// except according to those terms.
1010

1111

12-
use dep_graph::DepNode;
1312
use hir::map as hir_map;
1413
use hir::def_id::{CRATE_DEF_INDEX};
1514
use session::{config, Session};
@@ -57,8 +56,6 @@ impl<'a, 'tcx> ItemLikeVisitor<'tcx> for EntryContext<'a, 'tcx> {
5756
}
5857

5958
pub fn find_entry_point(session: &Session, hir_map: &hir_map::Map) {
60-
let _task = hir_map.dep_graph.in_task(DepNode::EntryPoint);
61-
6259
let any_exe = session.crate_types.borrow().iter().any(|ty| {
6360
*ty == config::CrateTypeExecutable
6461
});

src/librustc/middle/lang_items.rs

-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
pub use self::LangItem::*;
2323

24-
use dep_graph::DepNode;
2524
use hir::map as hir_map;
2625
use session::Session;
2726
use hir::def_id::DefId;
@@ -236,7 +235,6 @@ pub fn extract(attrs: &[ast::Attribute]) -> Option<Symbol> {
236235
pub fn collect_language_items(session: &Session,
237236
map: &hir_map::Map)
238237
-> LanguageItems {
239-
let _task = map.dep_graph.in_task(DepNode::CollectLanguageItems);
240238
let krate: &hir::Crate = map.krate();
241239
let mut collector = LanguageItemCollector::new(session, map);
242240
collector.collect(krate);

src/librustc/middle/resolve_lifetime.rs

-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
//! used between functions, and they operate in a purely top-down
1616
//! way. Therefore we break lifetime name resolution into a separate pass.
1717
18-
use dep_graph::DepNode;
1918
use hir::map::Map;
2019
use session::Session;
2120
use hir::def::Def;
@@ -259,7 +258,6 @@ const ROOT_SCOPE: ScopeRef<'static> = &Scope::Root;
259258
pub fn krate(sess: &Session,
260259
hir_map: &Map)
261260
-> Result<NamedRegionMap, usize> {
262-
let _task = hir_map.dep_graph.in_task(DepNode::ResolveLifetimes);
263261
let krate = hir_map.krate();
264262
let mut map = NamedRegionMap {
265263
defs: NodeMap(),

src/librustc/middle/stability.rs

-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
1414
pub use self::StabilityLevel::*;
1515

16-
use dep_graph::DepNode;
1716
use hir::map as hir_map;
1817
use lint;
1918
use hir::def::Def;
@@ -383,7 +382,6 @@ impl<'a, 'tcx> Index<'tcx> {
383382
// Put the active features into a map for quick lookup
384383
self.active_features = active_lib_features.iter().map(|&(ref s, _)| s.clone()).collect();
385384

386-
let _task = tcx.dep_graph.in_task(DepNode::StabilityIndex);
387385
let krate = tcx.hir.krate();
388386
let mut annotator = Annotator {
389387
tcx: tcx,
@@ -397,7 +395,6 @@ impl<'a, 'tcx> Index<'tcx> {
397395
}
398396

399397
pub fn new(hir_map: &hir_map::Map) -> Index<'tcx> {
400-
let _task = hir_map.dep_graph.in_task(DepNode::StabilityIndex);
401398
let krate = hir_map.krate();
402399

403400
let mut is_staged_api = false;
@@ -662,7 +659,6 @@ pub fn check_unused_or_stable_features<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
662659
let access_levels = &ty::queries::privacy_access_levels::get(tcx, DUMMY_SP, LOCAL_CRATE);
663660

664661
if tcx.stability.borrow().staged_api[&LOCAL_CRATE] && tcx.sess.features.borrow().staged_api {
665-
let _task = tcx.dep_graph.in_task(DepNode::StabilityIndex);
666662
let krate = tcx.hir.krate();
667663
let mut missing = MissingStabilityAnnotations {
668664
tcx: tcx,

src/librustc_driver/derive_registrar.rs

-2
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,13 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use rustc::dep_graph::DepNode;
1211
use rustc::hir::itemlikevisit::ItemLikeVisitor;
1312
use rustc::hir::map::Map;
1413
use rustc::hir;
1514
use syntax::ast;
1615
use syntax::attr;
1716

1817
pub fn find(hir_map: &Map) -> Option<ast::NodeId> {
19-
let _task = hir_map.dep_graph.in_task(DepNode::PluginRegistrar);
2018
let krate = hir_map.krate();
2119

2220
let mut finder = Finder { registrar: None };

src/librustc_plugin/build.rs

-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ use syntax::ast;
1414
use syntax::attr;
1515
use errors;
1616
use syntax_pos::Span;
17-
use rustc::dep_graph::DepNode;
1817
use rustc::hir::map::Map;
1918
use rustc::hir::itemlikevisit::ItemLikeVisitor;
2019
use rustc::hir;
@@ -44,7 +43,6 @@ impl<'v> ItemLikeVisitor<'v> for RegistrarFinder {
4443
pub fn find_plugin_registrar(diagnostic: &errors::Handler,
4544
hir_map: &Map)
4645
-> Option<ast::NodeId> {
47-
let _task = hir_map.dep_graph.in_task(DepNode::PluginRegistrar);
4846
let krate = hir_map.krate();
4947

5048
let mut finder = RegistrarFinder { registrars: Vec::new() };

src/librustc_trans/back/link.rs

-2
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,6 @@ pub fn link_binary(sess: &Session,
192192
trans: &CrateTranslation,
193193
outputs: &OutputFilenames,
194194
crate_name: &str) -> Vec<PathBuf> {
195-
let _task = sess.dep_graph.in_task(DepNode::LinkBinary);
196-
197195
let mut out_filenames = Vec::new();
198196
for &crate_type in sess.crate_types.borrow().iter() {
199197
// Ignore executable crates if we have -Z no-trans, as they will error.

src/librustc_trans/base.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ use rustc::hir::def_id::LOCAL_CRATE;
3838
use middle::lang_items::StartFnLangItem;
3939
use middle::cstore::EncodedMetadata;
4040
use rustc::ty::{self, Ty, TyCtxt};
41-
use rustc::dep_graph::{AssertDepGraphSafe, DepNode};
41+
use rustc::dep_graph::AssertDepGraphSafe;
4242
use rustc::middle::cstore::LinkMeta;
4343
use rustc::hir::map as hir_map;
4444
use rustc::util::common::time;
@@ -1057,8 +1057,6 @@ pub fn trans_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
10571057
analysis: ty::CrateAnalysis,
10581058
incremental_hashes_map: &IncrementalHashesMap)
10591059
-> CrateTranslation {
1060-
let _task = tcx.dep_graph.in_task(DepNode::TransCrate);
1061-
10621060
// Be careful with this krate: obviously it gives access to the
10631061
// entire contents of the krate. So if you push any subtasks of
10641062
// `TransCrate`, you need to be careful to register "reads" of the

src/librustc_typeck/check_unused.rs

-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
// except according to those terms.
1010

1111
use lint;
12-
use rustc::dep_graph::DepNode;
1312
use rustc::ty::TyCtxt;
1413

1514
use syntax::ast;
@@ -62,8 +61,6 @@ impl<'a, 'tcx, 'v> ItemLikeVisitor<'v> for CheckVisitor<'a, 'tcx> {
6261
}
6362

6463
pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
65-
let _task = tcx.dep_graph.in_task(DepNode::UnusedTraitCheck);
66-
6764
let mut used_trait_imports = DefIdSet();
6865
for &body_id in tcx.hir.krate().bodies.keys() {
6966
let item_id = tcx.hir.body_owner(body_id);

src/librustc_typeck/coherence/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
use hir::def_id::{CrateNum, DefId, LOCAL_CRATE};
1919
use rustc::ty::{self, TyCtxt, TypeFoldable};
2020
use rustc::ty::maps::Providers;
21-
use rustc::dep_graph::DepNode;
2221

2322
use syntax::ast;
2423
use syntax_pos::DUMMY_SP;
@@ -132,7 +131,6 @@ fn coherent_trait<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
132131
}
133132

134133
pub fn check_coherence<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
135-
let _task = tcx.dep_graph.in_task(DepNode::Coherence);
136134
for &trait_def_id in tcx.hir.krate().trait_impls.keys() {
137135
ty::queries::coherent_trait::get(tcx, DUMMY_SP, (LOCAL_CRATE, trait_def_id));
138136
}

src/librustc_typeck/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ pub use rustc::middle;
104104
pub use rustc::session;
105105
pub use rustc::util;
106106

107-
use dep_graph::DepNode;
108107
use hir::map as hir_map;
109108
use rustc::infer::InferOk;
110109
use rustc::ty::subst::Substs;
@@ -273,7 +272,6 @@ fn check_start_fn_ty<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
273272
}
274273

275274
fn check_for_entry_fn<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
276-
let _task = tcx.dep_graph.in_task(DepNode::CheckEntryFn);
277275
if let Some((id, sp)) = *tcx.sess.entry_fn.borrow() {
278276
match tcx.sess.entry_type.get() {
279277
Some(config::EntryMain) => check_main_fn_ty(tcx, id, sp),

0 commit comments

Comments
 (0)