Skip to content

Commit 93ac5df

Browse files
committed
review updateds
1 parent 932d251 commit 93ac5df

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

src/librustc/ty/maps.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -553,8 +553,8 @@ define_maps! { <'tcx>
553553
pub def_symbol_name: SymbolName(DefId) -> ty::SymbolName,
554554
pub symbol_name: symbol_name_dep_node(ty::Instance<'tcx>) -> ty::SymbolName,
555555

556-
pub describe_def: meta_data_node(DefId) -> Option<Def>,
557-
pub def_span: meta_data_node(DefId) -> Span
556+
pub describe_def: MetaData(DefId) -> Option<Def>,
557+
pub def_span: MetaData(DefId) -> Span
558558
}
559559

560560
fn coherent_trait_dep_node((_, def_id): (CrateNum, DefId)) -> DepNode<DefId> {
@@ -585,8 +585,4 @@ fn typeck_item_bodies_dep_node(_: CrateNum) -> DepNode<DefId> {
585585

586586
fn const_eval_dep_node((def_id, _): (DefId, &Substs)) -> DepNode<DefId> {
587587
DepNode::ConstEval(def_id)
588-
}
589-
590-
fn meta_data_node(def_id: DefId) -> DepNode<DefId> {
591-
DepNode::MetaData(def_id)
592588
}

src/librustc/ty/mod.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -2668,13 +2668,7 @@ fn associated_item_def_ids<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
26682668
}
26692669

26702670
fn def_span<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> Span {
2671-
match tcx.hir.span_if_local(def_id) {
2672-
Some(span) => span,
2673-
None => {
2674-
let node_id = tcx.sess.cstore.item_body(tcx, def_id).id().node_id;
2675-
tcx.hir.span(node_id)
2676-
},
2677-
}
2671+
tcx.hir.span_if_local(def_id).unwrap()
26782672
}
26792673

26802674
pub fn provide(providers: &mut ty::maps::Providers) {

0 commit comments

Comments
 (0)