Skip to content

Commit d9530c0

Browse files
committed
Fallout out rustc
1 parent 890ed5c commit d9530c0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+173
-171
lines changed

src/librustc/lint/builtin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ declare_lint! {
113113
}
114114
/// Does nothing as a lint pass, but registers some `Lint`s
115115
/// which are used by other parts of the compiler.
116-
#[derive(Copy)]
116+
#[derive(Copy, Clone)]
117117
pub struct HardwiredLints;
118118

119119
impl LintPass for HardwiredLints {

src/librustc/lint/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ pub use lint::context::{Context, LintStore, raw_emit_lint, check_crate, gather_a
4141
GatherNodeLevels};
4242

4343
/// Specification of a single lint.
44-
#[derive(Copy, Debug)]
44+
#[derive(Copy, Clone, Debug)]
4545
pub struct Lint {
4646
/// A string identifier for the lint.
4747
///

src/librustc/metadata/common.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ pub const tag_items_data_item_reexport_def_id: usize = 0x47;
116116
pub const tag_items_data_item_reexport_name: usize = 0x48;
117117

118118
// used to encode crate_ctxt side tables
119-
#[derive(Copy, PartialEq, FromPrimitive)]
119+
#[derive(Copy, Clone, PartialEq, FromPrimitive)]
120120
#[repr(usize)]
121121
pub enum astencode_tag { // Reserves 0x50 -- 0x6f
122122
tag_ast = 0x50,

src/librustc/metadata/csearch.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use syntax::parse::token;
2929

3030
use std::collections::hash_map::HashMap;
3131

32-
#[derive(Copy)]
32+
#[derive(Copy, Clone)]
3333
pub struct MethodInfo {
3434
pub name: ast::Name,
3535
pub def_id: ast::DefId,

src/librustc/metadata/filesearch.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use std::path::{Path, PathBuf};
2121
use util::fs as myfs;
2222
use session::search_paths::{SearchPaths, PathKind};
2323

24-
#[derive(Copy)]
24+
#[derive(Copy, Clone)]
2525
pub enum FileMatch {
2626
FileMatches,
2727
FileDoesntMatch,

src/librustc/metadata/tydecode.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ use syntax::parse::token;
4343
// def-id will depend on where it originated from. Therefore, the conversion
4444
// function is given an indicator of the source of the def-id. See
4545
// astencode.rs for more information.
46-
#[derive(Copy, Debug)]
46+
#[derive(Copy, Clone, Debug)]
4747
pub enum DefIdSource {
4848
// Identifies a struct, trait, enum, etc.
4949
NominalType,

src/librustc/middle/cfg/construct.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ struct CFGBuilder<'a, 'tcx: 'a> {
2525
loop_scopes: Vec<LoopScope>,
2626
}
2727

28-
#[derive(Copy)]
28+
#[derive(Copy, Clone)]
2929
struct LoopScope {
3030
loop_id: ast::NodeId, // id of loop/while node
3131
continue_index: CFGIndex, // where to go on a `loop`

src/librustc/middle/cfg/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub struct CFG {
2424
pub exit: CFGIndex,
2525
}
2626

27-
#[derive(Copy, PartialEq)]
27+
#[derive(Copy, Clone, PartialEq)]
2828
pub enum CFGNodeData {
2929
AST(ast::NodeId),
3030
Entry,

src/librustc/middle/check_const.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ bitflags! {
7676
}
7777
}
7878

79-
#[derive(Copy, Eq, PartialEq)]
79+
#[derive(Copy, Clone, Eq, PartialEq)]
8080
enum Mode {
8181
Const,
8282
Static,

src/librustc/middle/check_loop.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ enum Context {
2121
Normal, Loop, Closure
2222
}
2323

24-
#[derive(Copy)]
24+
#[derive(Copy, Clone)]
2525
struct CheckLoopVisitor<'a> {
2626
sess: &'a Session,
2727
cx: Context

src/librustc/middle/check_match.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ enum Usefulness {
128128
NotUseful
129129
}
130130

131-
#[derive(Copy)]
131+
#[derive(Copy, Clone)]
132132
enum WitnessPreference {
133133
ConstructWitness,
134134
LeaveOutWitness

src/librustc/middle/dataflow.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use syntax::visit;
2828
use syntax::print::{pp, pprust};
2929
use util::nodemap::NodeMap;
3030

31-
#[derive(Copy, Debug)]
31+
#[derive(Copy, Clone, Debug)]
3232
pub enum EntryOrExit {
3333
Entry,
3434
Exit,

src/librustc/middle/def.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ pub enum Def {
6565
/// <T as Trait>::AssocX::AssocY::MethodOrAssocType
6666
/// ^~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~
6767
/// base_def depth = 2
68-
#[derive(Copy, Debug)]
68+
#[derive(Copy, Clone, Debug)]
6969
pub struct PathResolution {
7070
pub base_def: Def,
7171
pub last_private: LastPrivate,
@@ -93,7 +93,7 @@ pub type DefMap = RefCell<NodeMap<PathResolution>>;
9393
// within.
9494
pub type ExportMap = NodeMap<Vec<Export>>;
9595

96-
#[derive(Copy)]
96+
#[derive(Copy, Clone)]
9797
pub struct Export {
9898
pub name: ast::Name, // The name of the target.
9999
pub def_id: ast::DefId, // The definition of the target.

src/librustc/middle/effect.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use syntax::codemap::Span;
2222
use syntax::visit;
2323
use syntax::visit::Visitor;
2424

25-
#[derive(Copy, PartialEq)]
25+
#[derive(Copy, Clone, PartialEq)]
2626
enum UnsafeContext {
2727
SafeContext,
2828
UnsafeFn,

src/librustc/middle/expr_use_visitor.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ pub trait Delegate<'tcx> {
9494
mode: MutateMode);
9595
}
9696

97-
#[derive(Copy, PartialEq, Debug)]
97+
#[derive(Copy, Clone, PartialEq, Debug)]
9898
pub enum LoanCause {
9999
ClosureCapture(Span),
100100
AddrOf,
@@ -106,28 +106,28 @@ pub enum LoanCause {
106106
MatchDiscriminant
107107
}
108108

109-
#[derive(Copy, PartialEq, Debug)]
109+
#[derive(Copy, Clone, PartialEq, Debug)]
110110
pub enum ConsumeMode {
111111
Copy, // reference to x where x has a type that copies
112112
Move(MoveReason), // reference to x where x has a type that moves
113113
}
114114

115-
#[derive(Copy, PartialEq, Debug)]
115+
#[derive(Copy, Clone, PartialEq, Debug)]
116116
pub enum MoveReason {
117117
DirectRefMove,
118118
PatBindingMove,
119119
CaptureMove,
120120
}
121121

122-
#[derive(Copy, PartialEq, Debug)]
122+
#[derive(Copy, Clone, PartialEq, Debug)]
123123
pub enum MatchMode {
124124
NonBindingMatch,
125125
BorrowingMatch,
126126
CopyingMatch,
127127
MovingMatch,
128128
}
129129

130-
#[derive(Copy, PartialEq, Debug)]
130+
#[derive(Copy, Clone, PartialEq, Debug)]
131131
enum TrackMatchMode {
132132
Unknown,
133133
Definite(MatchMode),
@@ -194,14 +194,14 @@ impl TrackMatchMode {
194194
}
195195
}
196196

197-
#[derive(Copy, PartialEq, Debug)]
197+
#[derive(Copy, Clone, PartialEq, Debug)]
198198
pub enum MutateMode {
199199
Init,
200200
JustWrite, // x = y
201201
WriteAndRead, // x += y
202202
}
203203

204-
#[derive(Copy)]
204+
#[derive(Copy, Clone)]
205205
enum OverloadedCallType {
206206
FnOverloadedCall,
207207
FnMutOverloadedCall,

src/librustc/middle/graph.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ pub struct NodeIndex(pub usize);
6666
#[allow(non_upper_case_globals)]
6767
pub const InvalidNodeIndex: NodeIndex = NodeIndex(usize::MAX);
6868

69-
#[derive(Copy, PartialEq, Debug)]
69+
#[derive(Copy, Clone, PartialEq, Debug)]
7070
pub struct EdgeIndex(pub usize);
7171
#[allow(non_upper_case_globals)]
7272
pub const InvalidEdgeIndex: EdgeIndex = EdgeIndex(usize::MAX);
7373

7474
// Use a private field here to guarantee no more instances are created:
75-
#[derive(Copy, Debug)]
75+
#[derive(Copy, Clone, Debug)]
7676
pub struct Direction { repr: usize }
7777
#[allow(non_upper_case_globals)]
7878
pub const Outgoing: Direction = Direction { repr: 0 };

src/librustc/middle/infer/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ pub enum RegionVariableOrigin<'tcx> {
294294
BoundRegionInCoherence(ast::Name),
295295
}
296296

297-
#[derive(Copy, Debug)]
297+
#[derive(Copy, Clone, Debug)]
298298
pub enum fixup_err {
299299
unresolved_int_ty(IntVid),
300300
unresolved_float_ty(FloatVid),

src/librustc/middle/infer/region_inference/mod.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,13 @@ pub enum GenericKind<'tcx> {
7474
Projection(ty::ProjectionTy<'tcx>),
7575
}
7676

77-
#[derive(Copy, PartialEq, Eq, Hash)]
77+
#[derive(Copy, Clone, PartialEq, Eq, Hash)]
7878
pub struct TwoRegions {
7979
a: Region,
8080
b: Region,
8181
}
8282

83-
#[derive(Copy, PartialEq)]
83+
#[derive(Copy, Clone, PartialEq)]
8484
pub enum UndoLogEntry {
8585
OpenSnapshot,
8686
CommitedSnapshot,
@@ -91,7 +91,7 @@ pub enum UndoLogEntry {
9191
AddCombination(CombineMapType, TwoRegions)
9292
}
9393

94-
#[derive(Copy, PartialEq)]
94+
#[derive(Copy, Clone, PartialEq)]
9595
pub enum CombineMapType {
9696
Lub, Glb
9797
}
@@ -944,10 +944,10 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> {
944944

945945
// ______________________________________________________________________
946946

947-
#[derive(Copy, PartialEq, Debug)]
947+
#[derive(Copy, Clone, PartialEq, Debug)]
948948
enum Classification { Expanding, Contracting }
949949

950-
#[derive(Copy)]
950+
#[derive(Copy, Clone)]
951951
pub enum VarValue { NoValue, Value(Region), ErrorValue }
952952

953953
struct VarData {

src/librustc/middle/infer/type_variable.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ struct Delegate<'tcx>(PhantomData<&'tcx ()>);
4747

4848
type Relation = (RelationDir, ty::TyVid);
4949

50-
#[derive(Copy, PartialEq, Debug)]
50+
#[derive(Copy, Clone, PartialEq, Debug)]
5151
pub enum RelationDir {
5252
SubtypeOf, SupertypeOf, EqTo, BiTo
5353
}

src/librustc/middle/infer/unify.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ pub struct Node<K:UnifyKey> {
9292
pub rank: usize,
9393
}
9494

95-
#[derive(Copy)]
95+
#[derive(Copy, Clone)]
9696
pub struct Delegate<K>(PhantomData<K>);
9797

9898
// We can't use V:LatticeValue, much as I would like to,

src/librustc/middle/lang_items.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ macro_rules! lets_do_this {
4646
$( $variant:ident, $name:expr, $method:ident; )*
4747
) => {
4848

49-
#[derive(Copy, FromPrimitive, PartialEq, Eq, Hash)]
49+
#[derive(Copy, Clone, FromPrimitive, PartialEq, Eq, Hash)]
5050
pub enum LangItem {
5151
$($variant),*
5252
}

src/librustc/middle/liveness.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ enum LoopKind<'a> {
139139
WhileLoop(&'a Expr),
140140
}
141141

142-
#[derive(Copy, PartialEq)]
142+
#[derive(Copy, Clone, PartialEq)]
143143
struct Variable(usize);
144144

145145
#[derive(Copy, PartialEq)]
@@ -159,7 +159,7 @@ impl Clone for LiveNode {
159159
}
160160
}
161161

162-
#[derive(Copy, PartialEq, Debug)]
162+
#[derive(Copy, Clone, PartialEq, Debug)]
163163
enum LiveNodeKind {
164164
FreeVarNode(Span),
165165
ExprNode(Span),
@@ -245,13 +245,13 @@ struct CaptureInfo {
245245
var_nid: NodeId
246246
}
247247

248-
#[derive(Copy, Debug)]
248+
#[derive(Copy, Clone, Debug)]
249249
struct LocalInfo {
250250
id: NodeId,
251251
ident: ast::Ident
252252
}
253253

254-
#[derive(Copy, Debug)]
254+
#[derive(Copy, Clone, Debug)]
255255
enum VarKind {
256256
Arg(NodeId, ast::Ident),
257257
Local(LocalInfo),
@@ -534,7 +534,7 @@ fn invalid_users() -> Users {
534534
}
535535
}
536536

537-
#[derive(Copy)]
537+
#[derive(Copy, Clone)]
538538
struct Specials {
539539
exit_ln: LiveNode,
540540
fallthrough_ln: LiveNode,

src/librustc/middle/mem_categorization.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ pub type cmt<'tcx> = Rc<cmt_<'tcx>>;
199199

200200
// We pun on *T to mean both actual deref of a ptr as well
201201
// as accessing of components:
202-
#[derive(Copy)]
202+
#[derive(Copy, Clone)]
203203
pub enum deref_kind {
204204
deref_ptr(PointerKind),
205205
deref_interior(InteriorKind),
@@ -263,6 +263,9 @@ pub struct MemCategorizationContext<'t,TYPER:'t> {
263263
}
264264

265265
impl<'t,TYPER:'t> Copy for MemCategorizationContext<'t,TYPER> {}
266+
impl<'t,TYPER:'t> Clone for MemCategorizationContext<'t,TYPER> {
267+
fn clone(&self) -> MemCategorizationContext<'t,TYPER> { *self }
268+
}
266269

267270
pub type McResult<T> = Result<T, ()>;
268271

src/librustc/middle/privacy.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub type ExternalExports = DefIdSet;
3232
/// reexporting a public struct doesn't inline the doc).
3333
pub type PublicItems = NodeSet;
3434

35-
#[derive(Copy, Debug)]
35+
#[derive(Copy, Clone, Debug)]
3636
pub enum LastPrivate {
3737
LastMod(PrivateDep),
3838
// `use` directives (imports) can refer to two separate definitions in the
@@ -46,14 +46,14 @@ pub enum LastPrivate {
4646
type_used: ImportUse},
4747
}
4848

49-
#[derive(Copy, Debug)]
49+
#[derive(Copy, Clone, Debug)]
5050
pub enum PrivateDep {
5151
AllPublic,
5252
DependsOn(ast::DefId),
5353
}
5454

5555
// How an import is used.
56-
#[derive(Copy, PartialEq, Debug)]
56+
#[derive(Copy, Clone, PartialEq, Debug)]
5757
pub enum ImportUse {
5858
Unused, // The import is not used.
5959
Used, // The import is used.

0 commit comments

Comments
 (0)