Skip to content

Commit

Permalink
hir: remove trait_auto_impl
Browse files Browse the repository at this point in the history
  • Loading branch information
ljedrz committed Mar 10, 2019
1 parent 9151eab commit 584d61a
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 17 deletions.
3 changes: 0 additions & 3 deletions src/librustc/hir/lowering.rs
Expand Up @@ -90,7 +90,6 @@ pub struct LoweringContext<'a> {
exported_macros: Vec<hir::MacroDef>,

trait_impls: BTreeMap<DefId, Vec<hir::HirId>>,
trait_auto_impl: BTreeMap<DefId, NodeId>,

modules: BTreeMap<NodeId, hir::ModuleItems>,

Expand Down Expand Up @@ -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(),
Expand Down Expand Up @@ -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,
}
}
Expand Down
1 change: 0 additions & 1 deletion src/librustc/hir/map/collector.rs
Expand Up @@ -121,7 +121,6 @@ impl<'a, 'hir> NodeCollector<'a, 'hir> {
impl_items: _,
bodies: _,
trait_impls: _,
trait_auto_impl: _,
body_ids: _,
modules: _,
} = *krate;
Expand Down
12 changes: 0 additions & 12 deletions src/librustc/hir/map/mod.rs
Expand Up @@ -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<NodeId> {
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.
Expand Down
1 change: 0 additions & 1 deletion src/librustc/hir/mod.rs
Expand Up @@ -724,7 +724,6 @@ pub struct Crate {
pub impl_items: BTreeMap<ImplItemId, ImplItem>,
pub bodies: BTreeMap<BodyId, Body>,
pub trait_impls: BTreeMap<DefId, Vec<HirId>>,
pub trait_auto_impl: BTreeMap<DefId, NodeId>,

/// 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
Expand Down

0 comments on commit 584d61a

Please sign in to comment.