Skip to content

Commit 9824b3d

Browse files
author
Jorge Aparicio
committed
---
yaml --- r: 163668 b: refs/heads/snap-stage3 c: 392ea79 h: refs/heads/master v: v3
1 parent 9ee1d93 commit 9824b3d

File tree

4 files changed

+14
-36
lines changed

4 files changed

+14
-36
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: e64a0072d66f0071f47325711a226f34d7b76f05
4+
refs/heads/snap-stage3: 392ea799b8c19e79ed65228841fc47da8660d74a
55
refs/heads/try: 20cbbffeefc1f35e2ea63afce7b42fbd79611d42
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/src/librustc_borrowck/borrowck/mod.rs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,9 @@ pub mod gather_loans;
5656

5757
pub mod move_data;
5858

59-
#[deriving(Clone)]
59+
#[deriving(Clone, Copy)]
6060
pub struct LoanDataFlowOperator;
6161

62-
impl Copy for LoanDataFlowOperator {}
63-
6462
pub type LoanDataFlow<'a, 'tcx> = DataFlowContext<'a, 'tcx, LoanDataFlowOperator>;
6563

6664
impl<'a, 'tcx, 'v> Visitor<'v> for BorrowckCtxt<'a, 'tcx> {
@@ -325,14 +323,12 @@ impl<'tcx> LoanPath<'tcx> {
325323
// b2b39e8700e37ad32b486b9a8409b50a8a53aa51#commitcomment-7892003
326324
static DOWNCAST_PRINTED_OPERATOR : &'static str = " as ";
327325

328-
#[deriving(PartialEq, Eq, Hash, Show)]
326+
#[deriving(Copy, PartialEq, Eq, Hash, Show)]
329327
pub enum LoanPathElem {
330328
LpDeref(mc::PointerKind), // `*LV` in doc.rs
331329
LpInterior(mc::InteriorKind) // `LV.f` in doc.rs
332330
}
333331

334-
impl Copy for LoanPathElem {}
335-
336332
pub fn closure_to_block(closure_id: ast::NodeId,
337333
tcx: &ty::ctxt) -> ast::NodeId {
338334
match tcx.map.get(closure_id) {
@@ -494,21 +490,18 @@ pub struct BckError<'tcx> {
494490
code: bckerr_code
495491
}
496492

493+
#[deriving(Copy)]
497494
pub enum AliasableViolationKind {
498495
MutabilityViolation,
499496
BorrowViolation(euv::LoanCause)
500497
}
501498

502-
impl Copy for AliasableViolationKind {}
503-
504-
#[deriving(Show)]
499+
#[deriving(Copy, Show)]
505500
pub enum MovedValueUseKind {
506501
MovedInUse,
507502
MovedInCapture,
508503
}
509504

510-
impl Copy for MovedValueUseKind {}
511-
512505
///////////////////////////////////////////////////////////////////////////
513506
// Misc
514507

branches/snap-stage3/src/librustc_borrowck/borrowck/move_data.rs

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,9 @@ pub struct FlowedMoveData<'a, 'tcx: 'a> {
7878
}
7979

8080
/// Index into `MoveData.paths`, used like a pointer
81-
#[deriving(PartialEq, Eq, PartialOrd, Ord, Show)]
81+
#[deriving(Copy, PartialEq, Eq, PartialOrd, Ord, Show)]
8282
pub struct MovePathIndex(uint);
8383

84-
impl Copy for MovePathIndex {}
85-
8684
impl MovePathIndex {
8785
fn get(&self) -> uint {
8886
let MovePathIndex(v) = *self; v
@@ -100,11 +98,9 @@ static InvalidMovePathIndex: MovePathIndex =
10098
MovePathIndex(uint::MAX);
10199

102100
/// Index into `MoveData.moves`, used like a pointer
103-
#[deriving(PartialEq)]
101+
#[deriving(Copy, PartialEq)]
104102
pub struct MoveIndex(uint);
105103

106-
impl Copy for MoveIndex {}
107-
108104
impl MoveIndex {
109105
fn get(&self) -> uint {
110106
let MoveIndex(v) = *self; v
@@ -134,16 +130,15 @@ pub struct MovePath<'tcx> {
134130
pub next_sibling: MovePathIndex,
135131
}
136132

137-
#[deriving(PartialEq, Show)]
133+
#[deriving(Copy, PartialEq, Show)]
138134
pub enum MoveKind {
139135
Declared, // When declared, variables start out "moved".
140136
MoveExpr, // Expression or binding that moves a variable
141137
MovePat, // By-move binding
142138
Captured // Closure creation that moves a value
143139
}
144140

145-
impl Copy for MoveKind {}
146-
141+
#[deriving(Copy)]
147142
pub struct Move {
148143
/// Path being moved.
149144
pub path: MovePathIndex,
@@ -158,8 +153,7 @@ pub struct Move {
158153
pub next_move: MoveIndex
159154
}
160155

161-
impl Copy for Move {}
162-
156+
#[deriving(Copy)]
163157
pub struct Assignment {
164158
/// Path being assigned.
165159
pub path: MovePathIndex,
@@ -171,8 +165,7 @@ pub struct Assignment {
171165
pub span: Span,
172166
}
173167

174-
impl Copy for Assignment {}
175-
168+
#[deriving(Copy)]
176169
pub struct VariantMatch {
177170
/// downcast to the variant.
178171
pub path: MovePathIndex,
@@ -187,20 +180,14 @@ pub struct VariantMatch {
187180
pub mode: euv::MatchMode
188181
}
189182

190-
impl Copy for VariantMatch {}
191-
192-
#[deriving(Clone)]
183+
#[deriving(Clone, Copy)]
193184
pub struct MoveDataFlowOperator;
194185

195-
impl Copy for MoveDataFlowOperator {}
196-
197186
pub type MoveDataFlow<'a, 'tcx> = DataFlowContext<'a, 'tcx, MoveDataFlowOperator>;
198187

199-
#[deriving(Clone)]
188+
#[deriving(Clone, Copy)]
200189
pub struct AssignDataFlowOperator;
201190

202-
impl Copy for AssignDataFlowOperator {}
203-
204191
pub type AssignDataFlow<'a, 'tcx> = DataFlowContext<'a, 'tcx, AssignDataFlowOperator>;
205192

206193
fn loan_path_is_precise(loan_path: &LoanPath) -> bool {

branches/snap-stage3/src/librustc_borrowck/graphviz.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,13 @@ use rustc::middle::dataflow::{DataFlowOperator, DataFlowContext, EntryOrExit};
2525
use rustc::middle::dataflow;
2626
use std::rc::Rc;
2727

28-
#[deriving(Show)]
28+
#[deriving(Show, Copy)]
2929
pub enum Variant {
3030
Loans,
3131
Moves,
3232
Assigns,
3333
}
3434

35-
impl Copy for Variant {}
36-
3735
impl Variant {
3836
pub fn short_name(&self) -> &'static str {
3937
match *self {

0 commit comments

Comments
 (0)