Skip to content

Commit 470118f

Browse files
committed
auto merge of #20504 : japaric/rust/derive-self, r=alexcrichton
I put the sed scripts in the commits, in case this needs a "rebase".
2 parents c6c7866 + 351409a commit 470118f

File tree

327 files changed

+1416
-1416
lines changed

Some content is hidden

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

327 files changed

+1416
-1416
lines changed

src/compiletest/common.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use std::fmt;
1313
use std::str::FromStr;
1414
use regex::Regex;
1515

16-
#[deriving(Clone, PartialEq)]
16+
#[derive(Clone, PartialEq)]
1717
pub enum Mode {
1818
CompileFail,
1919
RunFail,
@@ -59,7 +59,7 @@ impl fmt::Show for Mode {
5959
}
6060
}
6161

62-
#[deriving(Clone)]
62+
#[derive(Clone)]
6363
pub struct Config {
6464
// The library paths required for running the compiler
6565
pub compile_lib_path: String,

src/compiletest/errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pub struct ExpectedError {
3030
pub static EXPECTED_PATTERN : &'static str =
3131
r"//~(?P<follow>\|)?(?P<adjusts>\^*)\s*(?P<kind>\S*)\s*(?P<msg>.*)";
3232

33-
#[deriving(PartialEq, Show)]
33+
#[derive(PartialEq, Show)]
3434
enum WhichLine { ThisLine, FollowPrevious(uint), AdjustBackward(uint) }
3535

3636
// Load any test directives embedded in the file

src/grammar/verify.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use std::io::File;
2626

2727
use syntax::parse;
2828
use syntax::parse::lexer;
29-
use rustc::session::{mod, config};
29+
use rustc::session::{self, config};
3030

3131
use syntax::ast;
3232
use syntax::ast::Name;

src/liballoc/arc.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ use core::atomic;
7171
use core::atomic::Ordering::{Relaxed, Release, Acquire, SeqCst};
7272
use core::borrow::BorrowFrom;
7373
use core::clone::Clone;
74-
use core::fmt::{mod, Show};
74+
use core::fmt::{self, Show};
7575
use core::cmp::{Eq, Ord, PartialEq, PartialOrd, Ordering};
7676
use core::default::Default;
7777
use core::kinds::{Sync, Send};
@@ -81,7 +81,7 @@ use core::nonzero::NonZero;
8181
use core::ops::{Drop, Deref};
8282
use core::option::Option;
8383
use core::option::Option::{Some, None};
84-
use core::ptr::{mod, PtrExt};
84+
use core::ptr::{self, PtrExt};
8585
use heap::deallocate;
8686

8787
/// An atomically reference counted wrapper for shared state.
@@ -800,6 +800,6 @@ mod tests {
800800
}
801801

802802
// Make sure deriving works with Arc<T>
803-
#[deriving(Eq, Ord, PartialEq, PartialOrd, Clone, Show, Default)]
803+
#[derive(Eq, Ord, PartialEq, PartialOrd, Clone, Show, Default)]
804804
struct Foo { inner: Arc<int> }
805805
}

src/liballoc/boxed.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use core::clone::Clone;
1717
use core::cmp::{PartialEq, PartialOrd, Eq, Ord, Ordering};
1818
use core::default::Default;
1919
use core::fmt;
20-
use core::hash::{mod, Hash};
20+
use core::hash::{self, Hash};
2121
use core::kinds::Sized;
2222
use core::mem;
2323
use core::option::Option;

src/liballoc/rc.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,14 +147,14 @@ use core::clone::Clone;
147147
use core::cmp::{PartialEq, PartialOrd, Eq, Ord, Ordering};
148148
use core::default::Default;
149149
use core::fmt;
150-
use core::hash::{mod, Hash};
150+
use core::hash::{self, Hash};
151151
use core::kinds::marker;
152152
use core::mem::{transmute, min_align_of, size_of, forget};
153153
use core::nonzero::NonZero;
154154
use core::ops::{Deref, Drop};
155155
use core::option::Option;
156156
use core::option::Option::{Some, None};
157-
use core::ptr::{mod, PtrExt};
157+
use core::ptr::{self, PtrExt};
158158
use core::result::Result;
159159
use core::result::Result::{Ok, Err};
160160

@@ -264,7 +264,7 @@ pub fn is_unique<T>(rc: &Rc<T>) -> bool {
264264
/// # Example
265265
///
266266
/// ```
267-
/// use std::rc::{mod, Rc};
267+
/// use std::rc::{self, Rc};
268268
///
269269
/// let x = Rc::new(3u);
270270
/// assert_eq!(rc::try_unwrap(x), Ok(3u));
@@ -298,7 +298,7 @@ pub fn try_unwrap<T>(rc: Rc<T>) -> Result<T, Rc<T>> {
298298
/// # Example
299299
///
300300
/// ```
301-
/// use std::rc::{mod, Rc};
301+
/// use std::rc::{self, Rc};
302302
///
303303
/// let mut x = Rc::new(3u);
304304
/// *rc::get_mut(&mut x).unwrap() = 4u;

src/libarena/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ use std::rt::heap::{allocate, deallocate};
4646
// The way arena uses arrays is really deeply awful. The arrays are
4747
// allocated, and have capacities reserved, but the fill for the array
4848
// will always stay at 0.
49-
#[deriving(Clone, PartialEq)]
49+
#[derive(Clone, PartialEq)]
5050
struct Chunk {
5151
data: Rc<RefCell<Vec<u8>>>,
5252
fill: Cell<uint>,

src/libcollections/binary_heap.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
//! use std::collections::BinaryHeap;
3131
//! use std::uint;
3232
//!
33-
//! #[deriving(Copy, Eq, PartialEq)]
33+
//! #[derive(Copy, Eq, PartialEq)]
3434
//! struct State {
3535
//! cost: uint,
3636
//! position: uint,
@@ -157,12 +157,12 @@ use core::mem::{zeroed, replace, swap};
157157
use core::ptr;
158158

159159
use slice;
160-
use vec::{mod, Vec};
160+
use vec::{self, Vec};
161161

162162
/// A priority queue implemented with a binary heap.
163163
///
164164
/// This will be a max-heap.
165-
#[deriving(Clone)]
165+
#[derive(Clone)]
166166
#[stable]
167167
pub struct BinaryHeap<T> {
168168
data: Vec<T>,
@@ -565,7 +565,7 @@ pub struct Iter <'a, T: 'a> {
565565
iter: slice::Iter<'a, T>,
566566
}
567567

568-
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
568+
// FIXME(#19839) Remove in favor of `#[derive(Clone)]`
569569
impl<'a, T> Clone for Iter<'a, T> {
570570
fn clone(&self) -> Iter<'a, T> {
571571
Iter { iter: self.iter.clone() }

src/libcollections/bit.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ use core::fmt;
8989
use core::hash;
9090
use core::iter::RandomAccessIterator;
9191
use core::iter::{Chain, Enumerate, Repeat, Skip, Take, repeat, Cloned};
92-
use core::iter::{mod, FromIterator};
92+
use core::iter::{self, FromIterator};
9393
use core::num::Int;
9494
use core::ops::Index;
9595
use core::slice;
@@ -1040,7 +1040,7 @@ impl cmp::Eq for Bitv {}
10401040

10411041
/// An iterator for `Bitv`.
10421042
#[stable]
1043-
#[deriving(Clone)]
1043+
#[derive(Clone)]
10441044
pub struct Iter<'a> {
10451045
bitv: &'a Bitv,
10461046
next_idx: uint,
@@ -1139,7 +1139,7 @@ impl<'a> RandomAccessIterator for Iter<'a> {
11391139
/// let bv: Bitv = s.into_bitv();
11401140
/// assert!(bv[3]);
11411141
/// ```
1142-
#[deriving(Clone)]
1142+
#[derive(Clone)]
11431143
#[stable]
11441144
pub struct BitvSet {
11451145
bitv: Bitv,
@@ -1784,15 +1784,15 @@ impl<S: hash::Writer> hash::Hash<S> for BitvSet {
17841784
}
17851785

17861786
/// An iterator for `BitvSet`.
1787-
#[deriving(Clone)]
1787+
#[derive(Clone)]
17881788
#[stable]
17891789
pub struct SetIter<'a> {
17901790
set: &'a BitvSet,
17911791
next_idx: uint
17921792
}
17931793

17941794
/// An iterator combining two `BitvSet` iterators.
1795-
#[deriving(Clone)]
1795+
#[derive(Clone)]
17961796
struct TwoBitPositions<'a> {
17971797
set: &'a BitvSet,
17981798
other: &'a BitvSet,

src/libcollections/btree/map.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ use ring_buf::RingBuf;
3333
use self::Continuation::{Continue, Finished};
3434
use self::StackOp::*;
3535
use super::node::ForceResult::{Leaf, Internal};
36-
use super::node::TraversalItem::{mod, Elem, Edge};
36+
use super::node::TraversalItem::{self, Elem, Edge};
3737
use super::node::{Traversal, MutTraversal, MoveTraversal};
38-
use super::node::{mod, Node, Found, GoDown};
38+
use super::node::{self, Node, Found, GoDown};
3939

4040
// FIXME(conventions): implement bounded iterators
4141

@@ -81,7 +81,7 @@ use super::node::{mod, Node, Found, GoDown};
8181
/// force this degenerate behaviour to occur on every operation. While the total amount of work
8282
/// done on each operation isn't *catastrophic*, and *is* still bounded by O(B log<sub>B</sub>n),
8383
/// it is certainly much slower when it does.
84-
#[deriving(Clone)]
84+
#[derive(Clone)]
8585
#[stable]
8686
pub struct BTreeMap<K, V> {
8787
root: Node<K, V>,
@@ -505,7 +505,7 @@ mod stack {
505505
use core::mem;
506506
use core::ops::{Deref, DerefMut};
507507
use super::BTreeMap;
508-
use super::super::node::{mod, Node, Fit, Split, Internal, Leaf};
508+
use super::super::node::{self, Node, Fit, Split, Internal, Leaf};
509509
use super::super::node::handle;
510510
use vec::Vec;
511511

0 commit comments

Comments
 (0)