Skip to content

Commit 6025fc8

Browse files
committed
Remove hashing impls for LocalInternedString.
1 parent 224daa6 commit 6025fc8

File tree

3 files changed

+3
-24
lines changed

3 files changed

+3
-24
lines changed

src/librustc/hir/map/collector.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ impl<'a, 'hir> NodeCollector<'a, 'hir> {
186186
});
187187

188188
let mut upstream_crates: Vec<_> = cstore.crates_untracked().iter().map(|&cnum| {
189-
let name = cstore.crate_name_untracked(cnum).as_str();
189+
let name = cstore.crate_name_untracked(cnum).as_interned_str();
190190
let disambiguator = cstore.crate_disambiguator_untracked(cnum).to_fingerprint();
191191
let hash = cstore.crate_hash_untracked(cnum);
192192
(name, disambiguator, hash)

src/librustc/ich/impls_syntax.rs

+1-22
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use std::mem;
99
use syntax::ast;
1010
use syntax::feature_gate;
1111
use syntax::parse::token;
12-
use syntax::symbol::{InternedString, LocalInternedString};
12+
use syntax::symbol::InternedString;
1313
use syntax::tokenstream;
1414
use syntax_pos::SourceFile;
1515

@@ -39,27 +39,6 @@ impl<'a> ToStableHashKey<StableHashingContext<'a>> for InternedString {
3939
}
4040
}
4141

42-
impl<'a> HashStable<StableHashingContext<'a>> for LocalInternedString {
43-
#[inline]
44-
fn hash_stable<W: StableHasherResult>(&self,
45-
hcx: &mut StableHashingContext<'a>,
46-
hasher: &mut StableHasher<W>) {
47-
let s: &str = &**self;
48-
s.hash_stable(hcx, hasher);
49-
}
50-
}
51-
52-
impl<'a> ToStableHashKey<StableHashingContext<'a>> for LocalInternedString {
53-
type KeyType = LocalInternedString;
54-
55-
#[inline]
56-
fn to_stable_hash_key(&self,
57-
_: &StableHashingContext<'a>)
58-
-> LocalInternedString {
59-
self.clone()
60-
}
61-
}
62-
6342
impl<'a> HashStable<StableHashingContext<'a>> for ast::Name {
6443
#[inline]
6544
fn hash_stable<W: StableHasherResult>(&self,

src/libsyntax_pos/symbol.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1152,7 +1152,7 @@ fn with_interner<T, F: FnOnce(&mut Interner) -> T>(f: F) -> T {
11521152
// FIXME: ensure that the interner outlives any thread which uses
11531153
// `LocalInternedString`, by creating a new thread right after constructing the
11541154
// interner.
1155-
#[derive(Clone, Copy, Hash, PartialOrd, Eq, Ord)]
1155+
#[derive(Clone, Copy, Eq, PartialOrd, Ord)]
11561156
pub struct LocalInternedString {
11571157
string: &'static str,
11581158
}

0 commit comments

Comments
 (0)