Skip to content

Commit 0ed7054

Browse files
author
Jorge Aparicio
committed
---
yaml --- r: 163671 b: refs/heads/snap-stage3 c: 5e2bca9 h: refs/heads/master i: 163669: 5f8985e 163667: 9ee1d93 163663: 8ebc0df v: v3
1 parent 9359be7 commit 0ed7054

File tree

21 files changed

+44
-110
lines changed

21 files changed

+44
-110
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 9146a919b616e39e528e4d7100d16eef52f1f852
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 463475b7fa95cfeddbe9e153b1fdf408965252da
4+
refs/heads/snap-stage3: 5e2bca9e86ee6e40d6aaf6e4f4ba60a6e71b01e4
55
refs/heads/try: 20cbbffeefc1f35e2ea63afce7b42fbd79611d42
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/src/librustc_trans/back/write.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ use std::sync::{Arc, Mutex};
3333
use std::thread;
3434
use libc::{c_uint, c_int, c_void};
3535

36-
#[deriving(Clone, PartialEq, PartialOrd, Ord, Eq)]
36+
#[deriving(Clone, Copy, PartialEq, PartialOrd, Ord, Eq)]
3737
pub enum OutputType {
3838
OutputTypeBitcode,
3939
OutputTypeAssembly,
@@ -42,8 +42,6 @@ pub enum OutputType {
4242
OutputTypeExe,
4343
}
4444

45-
impl Copy for OutputType {}
46-
4745
pub fn llvm_err(handler: &diagnostic::Handler, msg: String) -> ! {
4846
unsafe {
4947
let cstr = llvm::LLVMRustGetLastError();

branches/snap-stage3/src/librustc_trans/save/recorder.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ macro_rules! svec {
6161
})
6262
}
6363

64+
#[deriving(Copy)]
6465
pub enum Row {
6566
Variable,
6667
Enum,
@@ -87,8 +88,6 @@ pub enum Row {
8788
FnRef,
8889
}
8990

90-
impl Copy for Row {}
91-
9291
impl<'a> FmtStrs<'a> {
9392
pub fn new(rec: Box<Recorder>, span: SpanUtils<'a>, krate: String) -> FmtStrs<'a> {
9493
FmtStrs {

branches/snap-stage3/src/librustc_trans/trans/_match.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,9 @@ use syntax::codemap::Span;
228228
use syntax::fold::Folder;
229229
use syntax::ptr::P;
230230

231-
#[deriving(Show)]
231+
#[deriving(Copy, Show)]
232232
struct ConstantExpr<'a>(&'a ast::Expr);
233233

234-
impl<'a> Copy for ConstantExpr<'a> {}
235-
236234
impl<'a> ConstantExpr<'a> {
237235
fn eq(self, other: ConstantExpr<'a>, tcx: &ty::ctxt) -> bool {
238236
let ConstantExpr(expr) = self;
@@ -301,7 +299,7 @@ impl<'a, 'tcx> Opt<'a, 'tcx> {
301299
}
302300
}
303301

304-
#[deriving(PartialEq)]
302+
#[deriving(Copy, PartialEq)]
305303
pub enum BranchKind {
306304
NoBranch,
307305
Single,
@@ -310,31 +308,27 @@ pub enum BranchKind {
310308
CompareSliceLength
311309
}
312310

313-
impl Copy for BranchKind {}
314-
315311
pub enum OptResult<'blk, 'tcx: 'blk> {
316312
SingleResult(Result<'blk, 'tcx>),
317313
RangeResult(Result<'blk, 'tcx>, Result<'blk, 'tcx>),
318314
LowerBound(Result<'blk, 'tcx>)
319315
}
320316

321-
#[deriving(Clone)]
317+
#[deriving(Clone, Copy)]
322318
pub enum TransBindingMode {
323319
TrByCopy(/* llbinding */ ValueRef),
324320
TrByMove,
325321
TrByRef,
326322
}
327323

328-
impl Copy for TransBindingMode {}
329-
330324
/// Information about a pattern binding:
331325
/// - `llmatch` is a pointer to a stack slot. The stack slot contains a
332326
/// pointer into the value being matched. Hence, llmatch has type `T**`
333327
/// where `T` is the value being matched.
334328
/// - `trmode` is the trans binding mode
335329
/// - `id` is the node id of the binding
336330
/// - `ty` is the Rust type of the binding
337-
#[deriving(Clone)]
331+
#[deriving(Clone, Copy)]
338332
pub struct BindingInfo<'tcx> {
339333
pub llmatch: ValueRef,
340334
pub trmode: TransBindingMode,
@@ -343,8 +337,6 @@ pub struct BindingInfo<'tcx> {
343337
pub ty: Ty<'tcx>,
344338
}
345339

346-
impl<'tcx> Copy for BindingInfo<'tcx> {}
347-
348340
type BindingsMap<'tcx> = FnvHashMap<Ident, BindingInfo<'tcx>>;
349341

350342
struct ArmData<'p, 'blk, 'tcx: 'blk> {

branches/snap-stage3/src/librustc_trans/trans/adt.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,14 +281,12 @@ struct Case<'tcx> {
281281
}
282282

283283

284-
#[deriving(Eq, PartialEq, Show)]
284+
#[deriving(Copy, Eq, PartialEq, Show)]
285285
pub enum PointerField {
286286
ThinPointer(uint),
287287
FatPointer(uint)
288288
}
289289

290-
impl Copy for PointerField {}
291-
292290
impl<'tcx> Case<'tcx> {
293291
fn is_zerolen<'a>(&self, cx: &CrateContext<'a, 'tcx>, scapegoat: Ty<'tcx>)
294292
-> bool {

branches/snap-stage3/src/librustc_trans/trans/base.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -565,10 +565,9 @@ pub fn maybe_name_value(cx: &CrateContext, v: ValueRef, s: &str) {
565565

566566

567567
// Used only for creating scalar comparison glue.
568+
#[deriving(Copy)]
568569
pub enum scalar_type { nil_type, signed_int, unsigned_int, floating_point, }
569570

570-
impl Copy for scalar_type {}
571-
572571
pub fn compare_scalar_types<'blk, 'tcx>(cx: Block<'blk, 'tcx>,
573572
lhs: ValueRef,
574573
rhs: ValueRef,
@@ -1792,14 +1791,12 @@ pub fn build_return_block<'blk, 'tcx>(fcx: &FunctionContext<'blk, 'tcx>,
17921791
}
17931792
}
17941793

1795-
#[deriving(Clone, Eq, PartialEq)]
1794+
#[deriving(Clone, Copy, Eq, PartialEq)]
17961795
pub enum IsUnboxedClosureFlag {
17971796
NotUnboxedClosure,
17981797
IsUnboxedClosure,
17991798
}
18001799

1801-
impl Copy for IsUnboxedClosureFlag {}
1802-
18031800
// trans_closure: Builds an LLVM function out of a source function.
18041801
// If the function closes over its environment a closure will be
18051802
// returned.
@@ -2194,6 +2191,7 @@ pub fn llvm_linkage_by_name(name: &str) -> Option<Linkage> {
21942191

21952192

21962193
/// Enum describing the origin of an LLVM `Value`, for linkage purposes.
2194+
#[deriving(Copy)]
21972195
pub enum ValueOrigin {
21982196
/// The LLVM `Value` is in this context because the corresponding item was
21992197
/// assigned to the current compilation unit.
@@ -2204,8 +2202,6 @@ pub enum ValueOrigin {
22042202
InlinedCopy,
22052203
}
22062204

2207-
impl Copy for ValueOrigin {}
2208-
22092205
/// Set the appropriate linkage for an LLVM `ValueRef` (function or global).
22102206
/// If the `llval` is the direct translation of a specific Rust item, `id`
22112207
/// should be set to the `NodeId` of that item. (This mapping should be

branches/snap-stage3/src/librustc_trans/trans/basic_block.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@ use llvm::{BasicBlockRef};
1313
use trans::value::{Users, Value};
1414
use std::iter::{Filter, Map};
1515

16+
#[deriving(Copy)]
1617
pub struct BasicBlock(pub BasicBlockRef);
1718

18-
impl Copy for BasicBlock {}
19-
2019
pub type Preds = Map<
2120
Value,
2221
BasicBlock,

branches/snap-stage3/src/librustc_trans/trans/cabi.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use trans::cabi_arm;
2020
use trans::cabi_mips;
2121
use trans::type_::Type;
2222

23-
#[deriving(Clone, PartialEq)]
23+
#[deriving(Clone, Copy, PartialEq)]
2424
pub enum ArgKind {
2525
/// Pass the argument directly using the normal converted
2626
/// LLVM type or by coercing to another specified type
@@ -31,13 +31,11 @@ pub enum ArgKind {
3131
Ignore,
3232
}
3333

34-
impl Copy for ArgKind {}
35-
3634
/// Information about how a specific C type
3735
/// should be passed to or returned from a function
3836
///
3937
/// This is borrowed from clang's ABIInfo.h
40-
#[deriving(Clone)]
38+
#[deriving(Clone, Copy)]
4139
pub struct ArgType {
4240
pub kind: ArgKind,
4341
/// Original LLVM type
@@ -50,8 +48,6 @@ pub struct ArgType {
5048
pub attr: option::Option<Attribute>
5149
}
5250

53-
impl Copy for ArgType {}
54-
5551
impl ArgType {
5652
pub fn direct(ty: Type, cast: option::Option<Type>,
5753
pad: option::Option<Type>,

branches/snap-stage3/src/librustc_trans/trans/cabi_x86_64.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use trans::type_::Type;
2424

2525
use std::cmp;
2626

27-
#[deriving(Clone, PartialEq)]
27+
#[deriving(Clone, Copy, PartialEq)]
2828
enum RegClass {
2929
NoClass,
3030
Int,
@@ -40,8 +40,6 @@ enum RegClass {
4040
Memory
4141
}
4242

43-
impl Copy for RegClass {}
44-
4543
trait TypeMethods {
4644
fn is_reg_ty(&self) -> bool;
4745
}

branches/snap-stage3/src/librustc_trans/trans/callee.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,12 @@ use syntax::ast;
5757
use syntax::ast_map;
5858
use syntax::ptr::P;
5959

60+
#[deriving(Copy)]
6061
pub struct MethodData {
6162
pub llfn: ValueRef,
6263
pub llself: ValueRef,
6364
}
6465

65-
impl Copy for MethodData {}
66-
6766
pub enum CalleeData<'tcx> {
6867
Closure(Datum<'tcx, Lvalue>),
6968

@@ -1049,13 +1048,12 @@ pub fn trans_args<'a, 'blk, 'tcx>(cx: Block<'blk, 'tcx>,
10491048
bcx
10501049
}
10511050

1051+
#[deriving(Copy)]
10521052
pub enum AutorefArg {
10531053
DontAutorefArg,
10541054
DoAutorefArg(ast::NodeId)
10551055
}
10561056

1057-
impl Copy for AutorefArg {}
1058-
10591057
pub fn trans_arg_datum<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
10601058
formal_arg_ty: Ty<'tcx>,
10611059
arg_datum: Datum<'tcx, Expr>,

branches/snap-stage3/src/librustc_trans/trans/cleanup.rs

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,11 @@ pub struct CleanupScope<'blk, 'tcx: 'blk> {
5050
cached_landing_pad: Option<BasicBlockRef>,
5151
}
5252

53-
#[deriving(Show)]
53+
#[deriving(Copy, Show)]
5454
pub struct CustomScopeIndex {
5555
index: uint
5656
}
5757

58-
impl Copy for CustomScopeIndex {}
59-
6058
pub const EXIT_BREAK: uint = 0;
6159
pub const EXIT_LOOP: uint = 1;
6260
pub const EXIT_MAX: uint = 2;
@@ -83,22 +81,19 @@ impl<'blk, 'tcx: 'blk> fmt::Show for CleanupScopeKind<'blk, 'tcx> {
8381
}
8482
}
8583

86-
#[deriving(PartialEq, Show)]
84+
#[deriving(Copy, PartialEq, Show)]
8785
pub enum EarlyExitLabel {
8886
UnwindExit,
8987
ReturnExit,
9088
LoopExit(ast::NodeId, uint)
9189
}
9290

93-
impl Copy for EarlyExitLabel {}
94-
91+
#[deriving(Copy)]
9592
pub struct CachedEarlyExit {
9693
label: EarlyExitLabel,
9794
cleanup_block: BasicBlockRef,
9895
}
9996

100-
impl Copy for CachedEarlyExit {}
101-
10297
pub trait Cleanup<'tcx> {
10398
fn must_unwind(&self) -> bool;
10499
fn clean_on_unwind(&self) -> bool;
@@ -111,14 +106,12 @@ pub trait Cleanup<'tcx> {
111106

112107
pub type CleanupObj<'tcx> = Box<Cleanup<'tcx>+'tcx>;
113108

114-
#[deriving(Show)]
109+
#[deriving(Copy, Show)]
115110
pub enum ScopeId {
116111
AstScope(ast::NodeId),
117112
CustomScope(CustomScopeIndex)
118113
}
119114

120-
impl Copy for ScopeId {}
121-
122115
impl<'blk, 'tcx> CleanupMethods<'blk, 'tcx> for FunctionContext<'blk, 'tcx> {
123116
/// Invoked when we start to trans the code contained within a new cleanup scope.
124117
fn push_ast_cleanup_scope(&self, debug_loc: NodeInfo) {
@@ -876,6 +869,7 @@ impl EarlyExitLabel {
876869
///////////////////////////////////////////////////////////////////////////
877870
// Cleanup types
878871

872+
#[deriving(Copy)]
879873
pub struct DropValue<'tcx> {
880874
is_immediate: bool,
881875
must_unwind: bool,
@@ -884,8 +878,6 @@ pub struct DropValue<'tcx> {
884878
zero: bool
885879
}
886880

887-
impl<'tcx> Copy for DropValue<'tcx> {}
888-
889881
impl<'tcx> Cleanup<'tcx> for DropValue<'tcx> {
890882
fn must_unwind(&self) -> bool {
891883
self.must_unwind
@@ -915,21 +907,18 @@ impl<'tcx> Cleanup<'tcx> for DropValue<'tcx> {
915907
}
916908
}
917909

918-
#[deriving(Show)]
910+
#[deriving(Copy, Show)]
919911
pub enum Heap {
920912
HeapExchange
921913
}
922914

923-
impl Copy for Heap {}
924-
915+
#[deriving(Copy)]
925916
pub struct FreeValue<'tcx> {
926917
ptr: ValueRef,
927918
heap: Heap,
928919
content_ty: Ty<'tcx>
929920
}
930921

931-
impl<'tcx> Copy for FreeValue<'tcx> {}
932-
933922
impl<'tcx> Cleanup<'tcx> for FreeValue<'tcx> {
934923
fn must_unwind(&self) -> bool {
935924
true
@@ -957,15 +946,14 @@ impl<'tcx> Cleanup<'tcx> for FreeValue<'tcx> {
957946
}
958947
}
959948

949+
#[deriving(Copy)]
960950
pub struct FreeSlice {
961951
ptr: ValueRef,
962952
size: ValueRef,
963953
align: ValueRef,
964954
heap: Heap,
965955
}
966956

967-
impl Copy for FreeSlice {}
968-
969957
impl<'tcx> Cleanup<'tcx> for FreeSlice {
970958
fn must_unwind(&self) -> bool {
971959
true
@@ -993,12 +981,11 @@ impl<'tcx> Cleanup<'tcx> for FreeSlice {
993981
}
994982
}
995983

984+
#[deriving(Copy)]
996985
pub struct LifetimeEnd {
997986
ptr: ValueRef,
998987
}
999988

1000-
impl Copy for LifetimeEnd {}
1001-
1002989
impl<'tcx> Cleanup<'tcx> for LifetimeEnd {
1003990
fn must_unwind(&self) -> bool {
1004991
false

0 commit comments

Comments
 (0)