diff --git a/src/librustc/ty/maps.rs b/src/librustc/ty/maps.rs index f2659e88afb..51fc0aa895c 100644 --- a/src/librustc/ty/maps.rs +++ b/src/librustc/ty/maps.rs @@ -553,8 +553,8 @@ define_maps! { <'tcx> pub def_symbol_name: SymbolName(DefId) -> ty::SymbolName, pub symbol_name: symbol_name_dep_node(ty::Instance<'tcx>) -> ty::SymbolName, - pub describe_def: meta_data_node(DefId) -> Option, - pub def_span: meta_data_node(DefId) -> Span + pub describe_def: MetaData(DefId) -> Option, + pub def_span: MetaData(DefId) -> Span } fn coherent_trait_dep_node((_, def_id): (CrateNum, DefId)) -> DepNode { @@ -585,8 +585,4 @@ fn typeck_item_bodies_dep_node(_: CrateNum) -> DepNode { fn const_eval_dep_node((def_id, _): (DefId, &Substs)) -> DepNode { DepNode::ConstEval(def_id) -} - -fn meta_data_node(def_id: DefId) -> DepNode { - DepNode::MetaData(def_id) } \ No newline at end of file diff --git a/src/librustc/ty/mod.rs b/src/librustc/ty/mod.rs index 2c3871cec8d..11bc5ce9187 100644 --- a/src/librustc/ty/mod.rs +++ b/src/librustc/ty/mod.rs @@ -2668,13 +2668,7 @@ fn associated_item_def_ids<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, } fn def_span<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> Span { - match tcx.hir.span_if_local(def_id) { - Some(span) => span, - None => { - let node_id = tcx.sess.cstore.item_body(tcx, def_id).id().node_id; - tcx.hir.span(node_id) - }, - } + tcx.hir.span_if_local(def_id).unwrap() } pub fn provide(providers: &mut ty::maps::Providers) {