Skip to content

Commit da6070d

Browse files
committed
Add a few more derivings to AST types
1 parent 26a39f2 commit da6070d

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/libsyntax/ast.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ pub struct Crate {
261261

262262
pub type MetaItem = Spanned<MetaItem_>;
263263

264-
#[deriving(Clone, Encodable, Decodable, Eq, Hash, Show)]
264+
#[deriving(Clone, Eq, Encodable, Decodable, Hash, Show)]
265265
pub enum MetaItem_ {
266266
MetaWord(InternedString),
267267
MetaList(InternedString, Vec<Gc<MetaItem>>),
@@ -423,7 +423,7 @@ pub enum LocalSource {
423423
// FIXME (pending discussion of #1697, #2178...): local should really be
424424
// a refinement on pat.
425425
/// Local represents a `let` statement, e.g., `let <pat>:<ty> = <expr>;`
426-
#[deriving(PartialEq, Eq, Encodable, Decodable, Hash, Show)]
426+
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
427427
pub struct Local {
428428
pub ty: P<Ty>,
429429
pub pat: Gc<Pat>,
@@ -435,7 +435,7 @@ pub struct Local {
435435

436436
pub type Decl = Spanned<Decl_>;
437437

438-
#[deriving(PartialEq, Eq, Encodable, Decodable, Hash, Show)]
438+
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
439439
pub enum Decl_ {
440440
/// A local (let) binding:
441441
DeclLocal(Gc<Local>),
@@ -677,7 +677,7 @@ pub struct MutTy {
677677
pub mutbl: Mutability,
678678
}
679679

680-
#[deriving(PartialEq, Eq, Encodable, Decodable, Hash, Show)]
680+
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
681681
pub struct TypeField {
682682
pub ident: Ident,
683683
pub mt: MutTy,
@@ -1048,7 +1048,7 @@ pub type PathListItem = Spanned<PathListItem_>;
10481048

10491049
pub type ViewPath = Spanned<ViewPath_>;
10501050

1051-
#[deriving(PartialEq, Eq, Encodable, Decodable, Hash, Show)]
1051+
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
10521052
pub enum ViewPath_ {
10531053

10541054
/// `quux = foo::bar::baz`
@@ -1113,7 +1113,7 @@ pub struct Attribute_ {
11131113
/// that the ref_id is for. The impl_id maps to the "self type" of this impl.
11141114
/// If this impl is an ItemImpl, the impl_id is redundant (it could be the
11151115
/// same as the impl's node id).
1116-
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
1116+
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
11171117
pub struct TraitRef {
11181118
pub path: Path,
11191119
pub ref_id: NodeId,
@@ -1169,7 +1169,7 @@ impl StructFieldKind {
11691169
}
11701170
}
11711171

1172-
#[deriving(PartialEq, Eq, Encodable, Decodable, Hash, Show)]
1172+
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
11731173
pub struct StructDef {
11741174
/// Fields, not including ctor
11751175
pub fields: Vec<StructField>,
@@ -1219,7 +1219,7 @@ pub enum Item_ {
12191219
ItemMac(Mac),
12201220
}
12211221

1222-
#[deriving(PartialEq, Eq, Encodable, Decodable, Hash, Show)]
1222+
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
12231223
pub struct ForeignItem {
12241224
pub ident: Ident,
12251225
pub attrs: Vec<Attribute>,
@@ -1229,7 +1229,7 @@ pub struct ForeignItem {
12291229
pub vis: Visibility,
12301230
}
12311231

1232-
#[deriving(PartialEq, Eq, Encodable, Decodable, Hash, Show)]
1232+
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
12331233
pub enum ForeignItem_ {
12341234
ForeignItemFn(P<FnDecl>, Generics),
12351235
ForeignItemStatic(P<Ty>, /* is_mutbl */ bool),
@@ -1238,7 +1238,7 @@ pub enum ForeignItem_ {
12381238
/// The data we save and restore about an inlined item or method. This is not
12391239
/// part of the AST that we parse from a file, but it becomes part of the tree
12401240
/// that we trans.
1241-
#[deriving(PartialEq, Eq, Encodable, Decodable, Hash, Show)]
1241+
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
12421242
pub enum InlinedItem {
12431243
IIItem(Gc<Item>),
12441244
IIMethod(DefId /* impl id */, bool /* is provided */, Gc<Method>),

0 commit comments

Comments
 (0)