Skip to content

Commit 49b76a0

Browse files
committed
Fallout in libsyntax
1 parent d9530c0 commit 49b76a0

File tree

16 files changed

+27
-27
lines changed

16 files changed

+27
-27
lines changed

src/libsyntax/abi.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub use self::AbiArchitecture::*;
1515

1616
use std::fmt;
1717

18-
#[derive(Copy, PartialEq, Eq, Debug)]
18+
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
1919
pub enum Os {
2020
OsWindows,
2121
OsMacos,
@@ -49,7 +49,7 @@ pub enum Abi {
4949
}
5050

5151
#[allow(non_camel_case_types)]
52-
#[derive(Copy, PartialEq, Debug)]
52+
#[derive(Copy, Clone, PartialEq, Debug)]
5353
pub enum Architecture {
5454
X86,
5555
X86_64,
@@ -58,15 +58,15 @@ pub enum Architecture {
5858
Mipsel
5959
}
6060

61-
#[derive(Copy)]
61+
#[derive(Copy, Clone)]
6262
pub struct AbiData {
6363
abi: Abi,
6464

6565
// Name of this ABI as we like it called.
6666
name: &'static str,
6767
}
6868

69-
#[derive(Copy)]
69+
#[derive(Copy, Clone)]
7070
pub enum AbiArchitecture {
7171
/// Not a real ABI (e.g., intrinsic)
7272
RustArch,

src/libsyntax/ast_map/blocks.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ use visit;
4040
/// - The default implementation for a trait method.
4141
///
4242
/// To construct one, use the `Code::from_node` function.
43-
#[derive(Copy)]
43+
#[derive(Copy, Clone)]
4444
pub struct FnLikeNode<'a> { node: ast_map::Node<'a> }
4545

4646
/// MaybeFnLike wraps a method that indicates if an object
@@ -80,7 +80,7 @@ impl MaybeFnLike for ast::Expr {
8080
/// Carries either an FnLikeNode or a Block, as these are the two
8181
/// constructs that correspond to "code" (as in, something from which
8282
/// we can construct a control-flow graph).
83-
#[derive(Copy)]
83+
#[derive(Copy, Clone)]
8484
pub enum Code<'a> {
8585
FnLikeCode(FnLikeNode<'a>),
8686
BlockCode(&'a Block),

src/libsyntax/ast_map/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ pub fn path_to_string<PI: Iterator<Item=PathElem>>(path: PI) -> String {
9090
})
9191
}
9292

93-
#[derive(Copy, Debug)]
93+
#[derive(Copy, Clone, Debug)]
9494
pub enum Node<'ast> {
9595
NodeItem(&'ast Item),
9696
NodeForeignItem(&'ast ForeignItem),

src/libsyntax/ast_util.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ pub fn empty_generics() -> Generics {
291291
// ______________________________________________________________________
292292
// Enumerating the IDs which appear in an AST
293293

294-
#[derive(RustcEncodable, RustcDecodable, Debug, Copy)]
294+
#[derive(Copy, Clone, RustcEncodable, RustcDecodable, Debug)]
295295
pub struct IdRange {
296296
pub min: NodeId,
297297
pub max: NodeId,

src/libsyntax/attr.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ pub fn find_crate_name(attrs: &[Attribute]) -> Option<InternedString> {
282282
first_attr_value_str_by_name(attrs, "crate_name")
283283
}
284284

285-
#[derive(Copy, PartialEq)]
285+
#[derive(Copy, Clone, PartialEq)]
286286
pub enum InlineAttr {
287287
None,
288288
Hint,
@@ -571,7 +571,7 @@ fn int_type_of_word(s: &str) -> Option<IntType> {
571571
}
572572
}
573573

574-
#[derive(PartialEq, Debug, RustcEncodable, RustcDecodable, Copy)]
574+
#[derive(PartialEq, Debug, RustcEncodable, RustcDecodable, Copy, Clone)]
575575
pub enum ReprAttr {
576576
ReprAny,
577577
ReprInt(Span, IntType),
@@ -590,7 +590,7 @@ impl ReprAttr {
590590
}
591591
}
592592

593-
#[derive(Eq, Hash, PartialEq, Debug, RustcEncodable, RustcDecodable, Copy)]
593+
#[derive(Eq, Hash, PartialEq, Debug, RustcEncodable, RustcDecodable, Copy, Clone)]
594594
pub enum IntType {
595595
SignedInt(ast::IntTy),
596596
UnsignedInt(ast::UintTy)

src/libsyntax/codemap.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub struct BytePos(pub u32);
4747
/// A character offset. Because of multibyte utf8 characters, a byte offset
4848
/// is not equivalent to a character offset. The CodeMap will convert BytePos
4949
/// values to CharPos values as necessary.
50-
#[derive(Copy, PartialEq, Hash, PartialOrd, Debug)]
50+
#[derive(Copy, Clone, PartialEq, Hash, PartialOrd, Debug)]
5151
pub struct CharPos(pub usize);
5252

5353
// FIXME: Lots of boilerplate in these impls, but so far my attempts to fix
@@ -305,7 +305,7 @@ pub struct FileLines {
305305
}
306306

307307
/// Identifies an offset of a multi-byte character in a FileMap
308-
#[derive(Copy, RustcEncodable, RustcDecodable, Eq, PartialEq)]
308+
#[derive(Copy, Clone, RustcEncodable, RustcDecodable, Eq, PartialEq)]
309309
pub struct MultiByteChar {
310310
/// The absolute offset of the character in the CodeMap
311311
pub pos: BytePos,

src/libsyntax/diagnostic.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ pub trait Emitter {
7171
/// This structure is used to signify that a task has panicked with a fatal error
7272
/// from the diagnostics. You can use this with the `Any` trait to figure out
7373
/// how a rustc task died (if so desired).
74-
#[derive(Copy)]
74+
#[derive(Copy, Clone)]
7575
pub struct FatalError;
7676

7777
/// Signifies that the compiler died with an explicit call to `.bug`
7878
/// or `.span_bug` rather than a failed assertion, etc.
79-
#[derive(Copy)]
79+
#[derive(Copy, Clone)]
8080
pub struct ExplicitBug;
8181

8282
/// A span-handler is like a handler but also

src/libsyntax/ext/base.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ impl MacResult for MacEager {
318318

319319
/// Fill-in macro expansion result, to allow compilation to continue
320320
/// after hitting errors.
321-
#[derive(Copy)]
321+
#[derive(Copy, Clone)]
322322
pub struct DummyResult {
323323
expr_only: bool,
324324
span: Span

src/libsyntax/ext/deriving/cmp/ord.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ pub fn expand_deriving_ord<F>(cx: &mut ExtCtxt,
8484
trait_def.expand(cx, mitem, item, push)
8585
}
8686

87-
#[derive(Copy)]
87+
#[derive(Copy, Clone)]
8888
pub enum OrderingOp {
8989
PartialCmpOp, LtOp, LeOp, GtOp, GeOp,
9090
}

src/libsyntax/ext/mtwt.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pub struct SCTable {
3838
rename_memo: RefCell<HashMap<(SyntaxContext,Ident,Name),SyntaxContext>>,
3939
}
4040

41-
#[derive(PartialEq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)]
41+
#[derive(PartialEq, RustcEncodable, RustcDecodable, Hash, Debug, Copy, Clone)]
4242
pub enum SyntaxContext_ {
4343
EmptyCtxt,
4444
Mark (Mrk,SyntaxContext),

src/libsyntax/feature_gate.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ pub const KNOWN_ATTRIBUTES: &'static [(&'static str, AttributeType)] = &[
286286
("recursion_limit", CrateLevel),
287287
];
288288

289-
#[derive(PartialEq, Copy, Debug)]
289+
#[derive(PartialEq, Copy, Clone, Debug)]
290290
pub enum AttributeType {
291291
/// Normal, builtin attribute that is consumed
292292
/// by the compiler before the unused_attribute check

src/libsyntax/parse/obsolete.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use parse::token;
2020
use ptr::P;
2121

2222
/// The specific types of unsupported syntax
23-
#[derive(Copy, PartialEq, Eq, Hash)]
23+
#[derive(Copy, Clone, PartialEq, Eq, Hash)]
2424
pub enum ObsoleteSyntax {
2525
ClosureKind,
2626
ExternCrateString,

src/libsyntax/parse/parser.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ type ItemInfo = (Ident, Item_, Option<Vec<Attribute> >);
9696

9797
/// How to parse a path. There are four different kinds of paths, all of which
9898
/// are parsed somewhat differently.
99-
#[derive(Copy, PartialEq)]
99+
#[derive(Copy, Clone, PartialEq)]
100100
pub enum PathParsingMode {
101101
/// A path with no type parameters; e.g. `foo::bar::Baz`
102102
NoTypesAllowed,
@@ -109,7 +109,7 @@ pub enum PathParsingMode {
109109
}
110110

111111
/// How to parse a bound, whether to allow bound modifiers such as `?`.
112-
#[derive(Copy, PartialEq)]
112+
#[derive(Copy, Clone, PartialEq)]
113113
pub enum BoundParsingMode {
114114
Bare,
115115
Modified,

src/libsyntax/print/pp.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,13 @@ pub fn buf_str(toks: &[Token],
147147
s
148148
}
149149

150-
#[derive(Copy)]
150+
#[derive(Copy, Clone)]
151151
pub enum PrintStackBreak {
152152
Fits,
153153
Broken(Breaks),
154154
}
155155

156-
#[derive(Copy)]
156+
#[derive(Copy, Clone)]
157157
pub struct PrintStackElem {
158158
offset: isize,
159159
pbreak: PrintStackBreak

src/libsyntax/print/pprust.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ pub trait PpAnn {
4646
fn post(&self, _state: &mut State, _node: AnnNode) -> io::Result<()> { Ok(()) }
4747
}
4848

49-
#[derive(Copy)]
49+
#[derive(Copy, Clone)]
5050
pub struct NoAnn;
5151

5252
impl PpAnn for NoAnn {}
5353

54-
#[derive(Copy)]
54+
#[derive(Copy, Clone)]
5555
pub struct CurrentCommentAndLiteral {
5656
cur_cmnt: usize,
5757
cur_lit: usize,

src/libsyntax/visit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ use codemap::Span;
3232
use ptr::P;
3333
use owned_slice::OwnedSlice;
3434

35-
#[derive(Copy)]
35+
#[derive(Copy, Clone)]
3636
pub enum FnKind<'a> {
3737
/// fn foo() or extern "Abi" fn foo()
3838
FkItemFn(Ident, &'a Generics, Unsafety, Abi),

0 commit comments

Comments
 (0)