Skip to content

Commit e85c195

Browse files
committed
Derives for ast.
1 parent 31298b4 commit e85c195

File tree

3 files changed

+4
-25
lines changed

3 files changed

+4
-25
lines changed

src/librustc/ich/impls_hir.rs

-4
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,6 @@ impl<'a> HashStable<StableHashingContext<'a>> for hir::ImplItemId {
119119
}
120120
}
121121

122-
impl_stable_hash_for!(struct ast::Label {
123-
ident
124-
});
125-
126122
impl<'a> HashStable<StableHashingContext<'a>> for hir::Ty {
127123
fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher) {
128124
hcx.while_hashing_hir_bodies(true, |hcx| {

src/librustc/ich/impls_syntax.rs

-17
Original file line numberDiff line numberDiff line change
@@ -125,23 +125,6 @@ impl<'ctx> syntax::StableHashingContextLike for StableHashingContext<'ctx> {
125125
}
126126
}
127127

128-
impl_stable_hash_for!(enum ::syntax::ast::NestedMetaItem {
129-
MetaItem(meta_item),
130-
Literal(lit)
131-
});
132-
133-
impl_stable_hash_for!(struct ::syntax::ast::MetaItem {
134-
path,
135-
kind,
136-
span
137-
});
138-
139-
impl_stable_hash_for!(enum ::syntax::ast::MetaItemKind {
140-
Word,
141-
List(nested_items),
142-
NameValue(lit)
143-
});
144-
145128
impl<'a> HashStable<StableHashingContext<'a>> for SourceFile {
146129
fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher) {
147130
let SourceFile {

src/libsyntax/ast.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ mod tests;
5555
/// ```
5656
///
5757
/// `'outer` is a label.
58-
#[derive(Clone, RustcEncodable, RustcDecodable, Copy)]
58+
#[derive(Clone, RustcEncodable, RustcDecodable, Copy, HashStable_Generic)]
5959
pub struct Label {
6060
pub ident: Ident,
6161
}
@@ -483,7 +483,7 @@ pub struct Crate {
483483
/// Possible values inside of compile-time attribute lists.
484484
///
485485
/// E.g., the '..' in `#[name(..)]`.
486-
#[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
486+
#[derive(Clone, RustcEncodable, RustcDecodable, Debug, HashStable_Generic)]
487487
pub enum NestedMetaItem {
488488
/// A full MetaItem, for recursive meta items.
489489
MetaItem(MetaItem),
@@ -496,7 +496,7 @@ pub enum NestedMetaItem {
496496
/// A spanned compile-time attribute item.
497497
///
498498
/// E.g., `#[test]`, `#[derive(..)]`, `#[rustfmt::skip]` or `#[feature = "foo"]`.
499-
#[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
499+
#[derive(Clone, RustcEncodable, RustcDecodable, Debug, HashStable_Generic)]
500500
pub struct MetaItem {
501501
pub path: Path,
502502
pub kind: MetaItemKind,
@@ -506,7 +506,7 @@ pub struct MetaItem {
506506
/// A compile-time attribute item.
507507
///
508508
/// E.g., `#[test]`, `#[derive(..)]` or `#[feature = "foo"]`.
509-
#[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
509+
#[derive(Clone, RustcEncodable, RustcDecodable, Debug, HashStable_Generic)]
510510
pub enum MetaItemKind {
511511
/// Word meta item.
512512
///

0 commit comments

Comments
 (0)