Skip to content

Commit 249e162

Browse files
author
Ariel Ben-Yehuda
authored
Rollup merge of rust-lang#46368 - michaelwoerister:incr-comp-type-debuginfo-spans, r=eddyb
incr.comp.: Remove an unnecessary HIR access which enables hashing spans for type definitions. r? @nikomatsakis
2 parents 434ebc2 + 89dc8ae commit 249e162

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

src/librustc/ich/impls_hir.rs

+9-11
Original file line numberDiff line numberDiff line change
@@ -884,13 +884,13 @@ impl<'gcx> HashStable<StableHashingContext<'gcx>> for hir::Item {
884884
fn hash_stable<W: StableHasherResult>(&self,
885885
hcx: &mut StableHashingContext<'gcx>,
886886
hasher: &mut StableHasher<W>) {
887-
let (is_const, hash_spans) = match self.node {
887+
let is_const = match self.node {
888888
hir::ItemStatic(..) |
889889
hir::ItemConst(..) => {
890-
(true, hcx.hash_spans())
890+
true
891891
}
892892
hir::ItemFn(_, _, constness, ..) => {
893-
(constness == hir::Constness::Const, hcx.hash_spans())
893+
constness == hir::Constness::Const
894894
}
895895
hir::ItemUse(..) |
896896
hir::ItemExternCrate(..) |
@@ -904,7 +904,7 @@ impl<'gcx> HashStable<StableHashingContext<'gcx>> for hir::Item {
904904
hir::ItemEnum(..) |
905905
hir::ItemStruct(..) |
906906
hir::ItemUnion(..) => {
907-
(false, false)
907+
false
908908
}
909909
};
910910

@@ -919,13 +919,11 @@ impl<'gcx> HashStable<StableHashingContext<'gcx>> for hir::Item {
919919
} = *self;
920920

921921
hcx.hash_hir_item_like(attrs, is_const, |hcx| {
922-
hcx.while_hashing_spans(hash_spans, |hcx| {
923-
name.hash_stable(hcx, hasher);
924-
attrs.hash_stable(hcx, hasher);
925-
node.hash_stable(hcx, hasher);
926-
vis.hash_stable(hcx, hasher);
927-
span.hash_stable(hcx, hasher);
928-
});
922+
name.hash_stable(hcx, hasher);
923+
attrs.hash_stable(hcx, hasher);
924+
node.hash_stable(hcx, hasher);
925+
vis.hash_stable(hcx, hasher);
926+
span.hash_stable(hcx, hasher);
929927
});
930928
}
931929
}

src/librustc/ty/mod.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -2302,9 +2302,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
23022302
}
23032303

23042304
pub fn item_name(self, id: DefId) -> InternedString {
2305-
if let Some(id) = self.hir.as_local_node_id(id) {
2306-
self.hir.name(id).as_str()
2307-
} else if id.index == CRATE_DEF_INDEX {
2305+
if id.index == CRATE_DEF_INDEX {
23082306
self.original_crate_name(id.krate).as_str()
23092307
} else {
23102308
let def_key = self.def_key(id);

0 commit comments

Comments
 (0)