Skip to content

Commit af68f71

Browse files
committed
Auto merge of #96016 - Aaron1011:hash-name-cleanup, r=cjgillot
Remove last vestiges of skippng ident span hashing This removes a comment that no longer applies, and properly hashes the full ident for path segments.
2 parents edba282 + 002a4e1 commit af68f71

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

compiler/rustc_ast/src/ast.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,11 @@ impl PartialEq<Symbol> for Path {
107107
}
108108
}
109109

110-
impl<CTX> HashStable<CTX> for Path {
110+
impl<CTX: rustc_span::HashStableContext> HashStable<CTX> for Path {
111111
fn hash_stable(&self, hcx: &mut CTX, hasher: &mut StableHasher) {
112112
self.segments.len().hash_stable(hcx, hasher);
113113
for segment in &self.segments {
114-
segment.ident.name.hash_stable(hcx, hasher);
114+
segment.ident.hash_stable(hcx, hasher);
115115
}
116116
}
117117
}

compiler/rustc_span/src/hygiene.rs

-10
Original file line numberDiff line numberDiff line change
@@ -103,16 +103,6 @@ impl !PartialOrd for LocalExpnId {}
103103
/// of `HashingControls` settings.
104104
fn assert_default_hashing_controls<CTX: HashStableContext>(ctx: &CTX, msg: &str) {
105105
match ctx.hashing_controls() {
106-
// Ideally, we would also check that `node_id_hashing_mode` was always
107-
// `NodeIdHashingMode::HashDefPath`. However, we currently end up hashing
108-
// `Span`s in this mode, and there's not an easy way to change that.
109-
// All of the span-related data that we hash is pretty self-contained
110-
// (in particular, we don't hash any `HirId`s), so this shouldn't result
111-
// in any caching problems.
112-
// FIXME: Enforce that we don't end up transitively hashing any `HirId`s,
113-
// or ensure that this method is always invoked with the same
114-
// `NodeIdHashingMode`
115-
//
116106
// Note that we require that `hash_spans` be set according to the global
117107
// `-Z incremental-ignore-spans` option. Normally, this option is disabled,
118108
// which will cause us to require that this method always be called with `Span` hashing

0 commit comments

Comments
 (0)