From 584d61a2bee9af2af572103899fc3e485e0a1fa8 Mon Sep 17 00:00:00 2001 From: ljedrz Date: Sun, 10 Mar 2019 13:56:58 +0100 Subject: [PATCH] hir: remove trait_auto_impl --- src/librustc/hir/lowering.rs | 3 --- src/librustc/hir/map/collector.rs | 1 - src/librustc/hir/map/mod.rs | 12 ------------ src/librustc/hir/mod.rs | 1 - 4 files changed, 17 deletions(-) diff --git a/src/librustc/hir/lowering.rs b/src/librustc/hir/lowering.rs index d3fa7ce283d12..7715e926aa1f5 100644 --- a/src/librustc/hir/lowering.rs +++ b/src/librustc/hir/lowering.rs @@ -90,7 +90,6 @@ pub struct LoweringContext<'a> { exported_macros: Vec, trait_impls: BTreeMap>, - trait_auto_impl: BTreeMap, modules: BTreeMap, @@ -233,7 +232,6 @@ pub fn lower_crate( impl_items: BTreeMap::new(), bodies: BTreeMap::new(), trait_impls: BTreeMap::new(), - trait_auto_impl: BTreeMap::new(), modules: BTreeMap::new(), exported_macros: Vec::new(), catch_scopes: Vec::new(), @@ -514,7 +512,6 @@ impl<'a> LoweringContext<'a> { bodies: self.bodies, body_ids, trait_impls: self.trait_impls, - trait_auto_impl: self.trait_auto_impl, modules: self.modules, } } diff --git a/src/librustc/hir/map/collector.rs b/src/librustc/hir/map/collector.rs index 9f39d648df1bf..e88f9e60702f7 100644 --- a/src/librustc/hir/map/collector.rs +++ b/src/librustc/hir/map/collector.rs @@ -121,7 +121,6 @@ impl<'a, 'hir> NodeCollector<'a, 'hir> { impl_items: _, bodies: _, trait_impls: _, - trait_auto_impl: _, body_ids: _, modules: _, } = *krate; diff --git a/src/librustc/hir/map/mod.rs b/src/librustc/hir/map/mod.rs index 44091eb4395be..19b9c78be4c38 100644 --- a/src/librustc/hir/map/mod.rs +++ b/src/librustc/hir/map/mod.rs @@ -563,18 +563,6 @@ impl<'hir> Map<'hir> { self.forest.krate.trait_impls.get(&trait_did).map_or(&[], |xs| &xs[..]) } - pub fn trait_auto_impl(&self, trait_did: DefId) -> Option { - self.dep_graph.read(DepNode::new_no_params(DepKind::AllLocalTraitImpls)); - - // N.B., intentionally bypass `self.forest.krate()` so that we - // do not trigger a read of the whole krate here - self.forest.krate.trait_auto_impl.get(&trait_did).cloned() - } - - pub fn trait_is_auto(&self, trait_did: DefId) -> bool { - self.trait_auto_impl(trait_did).is_some() - } - /// Gets the attributes on the crate. This is preferable to /// invoking `krate.attrs` because it registers a tighter /// dep-graph access. diff --git a/src/librustc/hir/mod.rs b/src/librustc/hir/mod.rs index ef72d0187b6b6..a099811b748b1 100644 --- a/src/librustc/hir/mod.rs +++ b/src/librustc/hir/mod.rs @@ -724,7 +724,6 @@ pub struct Crate { pub impl_items: BTreeMap, pub bodies: BTreeMap, pub trait_impls: BTreeMap>, - pub trait_auto_impl: BTreeMap, /// A list of the body ids written out in the order in which they /// appear in the crate. If you're going to process all the bodies