Skip to content

Commit ce30107

Browse files
committed
Rename StableHashingContextLike to HashStableContext.
1 parent 9efd320 commit ce30107

File tree

8 files changed

+11
-11
lines changed

8 files changed

+11
-11
lines changed

src/librustc/ich/hcx.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ impl<'a> ToStableHashKey<StableHashingContext<'a>> for ast::NodeId {
280280
}
281281
}
282282

283-
impl<'a> syntax_pos::StableHashingContextLike for StableHashingContext<'a> {
283+
impl<'a> syntax_pos::HashStableContext for StableHashingContext<'a> {
284284
/// Hashes a span in a stable way. We can't directly hash the span's `BytePos`
285285
/// fields (that would be similar to hashing pointers, since those are just
286286
/// offsets into the `SourceMap`). Instead, we hash the (file name, line, column)

src/librustc/ich/impls_syntax.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use crate::hir::def_id::{DefId, CrateNum, CRATE_DEF_INDEX};
1616
use smallvec::SmallVec;
1717
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
1818

19-
impl<'ctx> rustc_target::StableHashingContextLike for StableHashingContext<'ctx> {}
19+
impl<'ctx> rustc_target::HashStableContext for StableHashingContext<'ctx> {}
2020

2121
impl<'a> HashStable<StableHashingContext<'a>> for ast::Lifetime {
2222
fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher) {
@@ -65,7 +65,7 @@ impl<'a> HashStable<StableHashingContext<'a>> for ast::Attribute {
6565
}
6666
}
6767

68-
impl<'ctx> syntax::StableHashingContextLike for StableHashingContext<'ctx> {
68+
impl<'ctx> syntax::HashStableContext for StableHashingContext<'ctx> {
6969
fn hash_stable_tokenkind(&mut self, tokenkind: &token::TokenKind, hasher: &mut StableHasher) {
7070
mem::discriminant(tokenkind).hash_stable(self, hasher);
7171
match *tokenkind {

src/librustc_macros/src/hash_stable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ pub fn hash_stable_generic_derive(mut s: synstructure::Structure<'_>) -> proc_ma
5151
let generic: syn::GenericParam = parse_quote!(__CTX);
5252
s.add_bounds(synstructure::AddBounds::Generics);
5353
s.add_impl_generic(generic);
54-
s.add_where_predicate(parse_quote!{ __CTX: crate::StableHashingContextLike });
54+
s.add_where_predicate(parse_quote!{ __CTX: crate::HashStableContext });
5555
let body = s.each(|bi| {
5656
let attrs = parse_attributes(bi.ast());
5757
if attrs.ignore {

src/librustc_target/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ pub mod spec;
2121
/// Requirements for a `StableHashingContext` to be used in this crate.
2222
/// This is a hack to allow using the `HashStable_Generic` derive macro
2323
/// instead of implementing everything in librustc.
24-
pub trait StableHashingContextLike {}
24+
pub trait HashStableContext {}

src/libsyntax/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,6 @@ pub mod early_buffered_lints;
115115
/// Requirements for a `StableHashingContext` to be used in this crate.
116116
/// This is a hack to allow using the `HashStable_Generic` derive macro
117117
/// instead of implementing everything in librustc.
118-
pub trait StableHashingContextLike: syntax_pos::StableHashingContextLike {
118+
pub trait HashStableContext: syntax_pos::HashStableContext {
119119
fn hash_stable_tokenkind(&mut self, tokenkind: &token::TokenKind, hasher: &mut StableHasher);
120120
}

src/libsyntax/token.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ pub enum TokenKind {
264264
rustc_data_structures::static_assert_size!(TokenKind, 16);
265265

266266
impl<CTX> HashStable<CTX> for TokenKind
267-
where CTX: crate::StableHashingContextLike
267+
where CTX: crate::HashStableContext
268268
{
269269
fn hash_stable(&self, hcx: &mut CTX, hasher: &mut StableHasher) {
270270
hcx.hash_stable_tokenkind(self, hasher)

src/libsyntax/tokenstream.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ where
5454
{}
5555

5656
impl<CTX> HashStable<CTX> for TokenTree
57-
where CTX: crate::StableHashingContextLike
57+
where CTX: crate::HashStableContext
5858
{
5959
fn hash_stable(&self, hcx: &mut CTX, hasher: &mut StableHasher) {
6060
mem::discriminant(self).hash_stable(hcx, hasher);
@@ -138,7 +138,7 @@ impl TokenTree {
138138
}
139139

140140
impl<CTX> HashStable<CTX> for TokenStream
141-
where CTX: crate::StableHashingContextLike
141+
where CTX: crate::HashStableContext
142142
{
143143
fn hash_stable(&self, hcx: &mut CTX, hasher: &mut StableHasher) {
144144
for sub_tt in self.trees() {

src/libsyntax_pos/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ impl Ord for Span {
246246
}
247247

248248
impl<CTX> HashStable<CTX> for Span
249-
where CTX: StableHashingContextLike
249+
where CTX: HashStableContext
250250
{
251251
fn hash_stable(&self, ctx: &mut CTX, hasher: &mut StableHasher) {
252252
ctx.hash_stable_span(self, hasher)
@@ -1574,6 +1574,6 @@ fn lookup_line(lines: &[BytePos], pos: BytePos) -> isize {
15741574
/// Requirements for a `StableHashingContext` to be used in this crate.
15751575
/// This is a hack to allow using the `HashStable_Generic` derive macro
15761576
/// instead of implementing everything in librustc.
1577-
pub trait StableHashingContextLike {
1577+
pub trait HashStableContext {
15781578
fn hash_stable_span(&mut self, span: &Span, hasher: &mut StableHasher);
15791579
}

0 commit comments

Comments
 (0)