Skip to content

Remove old syntax: s/mod/self/g + s/deriving/derive/g #20504

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 4, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions src/compiletest/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use std::fmt;
use std::str::FromStr;
use regex::Regex;

#[deriving(Clone, PartialEq)]
#[derive(Clone, PartialEq)]
pub enum Mode {
CompileFail,
RunFail,
Expand Down Expand Up @@ -59,7 +59,7 @@ impl fmt::Show for Mode {
}
}

#[deriving(Clone)]
#[derive(Clone)]
pub struct Config {
// The library paths required for running the compiler
pub compile_lib_path: String,
Expand Down
2 changes: 1 addition & 1 deletion src/compiletest/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub struct ExpectedError {
pub static EXPECTED_PATTERN : &'static str =
r"//~(?P<follow>\|)?(?P<adjusts>\^*)\s*(?P<kind>\S*)\s*(?P<msg>.*)";

#[deriving(PartialEq, Show)]
#[derive(PartialEq, Show)]
enum WhichLine { ThisLine, FollowPrevious(uint), AdjustBackward(uint) }

// Load any test directives embedded in the file
Expand Down
2 changes: 1 addition & 1 deletion src/grammar/verify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use std::io::File;

use syntax::parse;
use syntax::parse::lexer;
use rustc::session::{mod, config};
use rustc::session::{self, config};

use syntax::ast;
use syntax::ast::Name;
Expand Down
6 changes: 3 additions & 3 deletions src/liballoc/arc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ use core::atomic;
use core::atomic::Ordering::{Relaxed, Release, Acquire, SeqCst};
use core::borrow::BorrowFrom;
use core::clone::Clone;
use core::fmt::{mod, Show};
use core::fmt::{self, Show};
use core::cmp::{Eq, Ord, PartialEq, PartialOrd, Ordering};
use core::default::Default;
use core::kinds::{Sync, Send};
Expand All @@ -81,7 +81,7 @@ use core::nonzero::NonZero;
use core::ops::{Drop, Deref};
use core::option::Option;
use core::option::Option::{Some, None};
use core::ptr::{mod, PtrExt};
use core::ptr::{self, PtrExt};
use heap::deallocate;

/// An atomically reference counted wrapper for shared state.
Expand Down Expand Up @@ -800,6 +800,6 @@ mod tests {
}

// Make sure deriving works with Arc<T>
#[deriving(Eq, Ord, PartialEq, PartialOrd, Clone, Show, Default)]
#[derive(Eq, Ord, PartialEq, PartialOrd, Clone, Show, Default)]
struct Foo { inner: Arc<int> }
}
2 changes: 1 addition & 1 deletion src/liballoc/boxed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use core::clone::Clone;
use core::cmp::{PartialEq, PartialOrd, Eq, Ord, Ordering};
use core::default::Default;
use core::fmt;
use core::hash::{mod, Hash};
use core::hash::{self, Hash};
use core::kinds::Sized;
use core::mem;
use core::option::Option;
Expand Down
8 changes: 4 additions & 4 deletions src/liballoc/rc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,14 @@ use core::clone::Clone;
use core::cmp::{PartialEq, PartialOrd, Eq, Ord, Ordering};
use core::default::Default;
use core::fmt;
use core::hash::{mod, Hash};
use core::hash::{self, Hash};
use core::kinds::marker;
use core::mem::{transmute, min_align_of, size_of, forget};
use core::nonzero::NonZero;
use core::ops::{Deref, Drop};
use core::option::Option;
use core::option::Option::{Some, None};
use core::ptr::{mod, PtrExt};
use core::ptr::{self, PtrExt};
use core::result::Result;
use core::result::Result::{Ok, Err};

Expand Down Expand Up @@ -264,7 +264,7 @@ pub fn is_unique<T>(rc: &Rc<T>) -> bool {
/// # Example
///
/// ```
/// use std::rc::{mod, Rc};
/// use std::rc::{self, Rc};
///
/// let x = Rc::new(3u);
/// assert_eq!(rc::try_unwrap(x), Ok(3u));
Expand Down Expand Up @@ -298,7 +298,7 @@ pub fn try_unwrap<T>(rc: Rc<T>) -> Result<T, Rc<T>> {
/// # Example
///
/// ```
/// use std::rc::{mod, Rc};
/// use std::rc::{self, Rc};
///
/// let mut x = Rc::new(3u);
/// *rc::get_mut(&mut x).unwrap() = 4u;
Expand Down
2 changes: 1 addition & 1 deletion src/libarena/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ use std::rt::heap::{allocate, deallocate};
// The way arena uses arrays is really deeply awful. The arrays are
// allocated, and have capacities reserved, but the fill for the array
// will always stay at 0.
#[deriving(Clone, PartialEq)]
#[derive(Clone, PartialEq)]
struct Chunk {
data: Rc<RefCell<Vec<u8>>>,
fill: Cell<uint>,
Expand Down
8 changes: 4 additions & 4 deletions src/libcollections/binary_heap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
//! use std::collections::BinaryHeap;
//! use std::uint;
//!
//! #[deriving(Copy, Eq, PartialEq)]
//! #[derive(Copy, Eq, PartialEq)]
//! struct State {
//! cost: uint,
//! position: uint,
Expand Down Expand Up @@ -157,12 +157,12 @@ use core::mem::{zeroed, replace, swap};
use core::ptr;

use slice;
use vec::{mod, Vec};
use vec::{self, Vec};

/// A priority queue implemented with a binary heap.
///
/// This will be a max-heap.
#[deriving(Clone)]
#[derive(Clone)]
#[stable]
pub struct BinaryHeap<T> {
data: Vec<T>,
Expand Down Expand Up @@ -565,7 +565,7 @@ pub struct Iter <'a, T: 'a> {
iter: slice::Iter<'a, T>,
}

// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
// FIXME(#19839) Remove in favor of `#[derive(Clone)]`
impl<'a, T> Clone for Iter<'a, T> {
fn clone(&self) -> Iter<'a, T> {
Iter { iter: self.iter.clone() }
Expand Down
10 changes: 5 additions & 5 deletions src/libcollections/bit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ use core::fmt;
use core::hash;
use core::iter::RandomAccessIterator;
use core::iter::{Chain, Enumerate, Repeat, Skip, Take, repeat, Cloned};
use core::iter::{mod, FromIterator};
use core::iter::{self, FromIterator};
use core::num::Int;
use core::ops::Index;
use core::slice;
Expand Down Expand Up @@ -1040,7 +1040,7 @@ impl cmp::Eq for Bitv {}

/// An iterator for `Bitv`.
#[stable]
#[deriving(Clone)]
#[derive(Clone)]
pub struct Iter<'a> {
bitv: &'a Bitv,
next_idx: uint,
Expand Down Expand Up @@ -1139,7 +1139,7 @@ impl<'a> RandomAccessIterator for Iter<'a> {
/// let bv: Bitv = s.into_bitv();
/// assert!(bv[3]);
/// ```
#[deriving(Clone)]
#[derive(Clone)]
#[stable]
pub struct BitvSet {
bitv: Bitv,
Expand Down Expand Up @@ -1784,15 +1784,15 @@ impl<S: hash::Writer> hash::Hash<S> for BitvSet {
}

/// An iterator for `BitvSet`.
#[deriving(Clone)]
#[derive(Clone)]
#[stable]
pub struct SetIter<'a> {
set: &'a BitvSet,
next_idx: uint
}

/// An iterator combining two `BitvSet` iterators.
#[deriving(Clone)]
#[derive(Clone)]
struct TwoBitPositions<'a> {
set: &'a BitvSet,
other: &'a BitvSet,
Expand Down
8 changes: 4 additions & 4 deletions src/libcollections/btree/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ use ring_buf::RingBuf;
use self::Continuation::{Continue, Finished};
use self::StackOp::*;
use super::node::ForceResult::{Leaf, Internal};
use super::node::TraversalItem::{mod, Elem, Edge};
use super::node::TraversalItem::{self, Elem, Edge};
use super::node::{Traversal, MutTraversal, MoveTraversal};
use super::node::{mod, Node, Found, GoDown};
use super::node::{self, Node, Found, GoDown};

// FIXME(conventions): implement bounded iterators

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

Expand Down
2 changes: 1 addition & 1 deletion src/libcollections/btree/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ impl<K: Clone, V: Clone> Clone for Node<K, V> {
/// println!("Uninitialized memory: {}", handle.into_kv());
/// }
/// ```
#[deriving(Copy)]
#[derive(Copy)]
pub struct Handle<NodeRef, Type, NodeType> {
node: NodeRef,
index: uint
Expand Down
4 changes: 2 additions & 2 deletions src/libcollections/btree/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use core::prelude::*;

use core::borrow::BorrowFrom;
use core::cmp::Ordering::{mod, Less, Greater, Equal};
use core::cmp::Ordering::{self, Less, Greater, Equal};
use core::default::Default;
use core::fmt::Show;
use core::fmt;
Expand All @@ -30,7 +30,7 @@ use btree_map::{BTreeMap, Keys};
///
/// See BTreeMap's documentation for a detailed discussion of this collection's performance
/// benefits and drawbacks.
#[deriving(Clone, Hash, PartialEq, Eq, Ord, PartialOrd)]
#[derive(Clone, Hash, PartialEq, Eq, Ord, PartialOrd)]
#[stable]
pub struct BTreeSet<T>{
map: BTreeMap<T, ()>,
Expand Down
4 changes: 2 additions & 2 deletions src/libcollections/dlist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use core::cmp::Ordering;
use core::default::Default;
use core::fmt;
use core::hash::{Writer, Hash};
use core::iter::{mod, FromIterator};
use core::iter::{self, FromIterator};
use core::mem;
use core::ptr;

Expand Down Expand Up @@ -84,7 +84,7 @@ pub struct IterMut<'a, T:'a> {
}

/// An iterator over mutable references to the items of a `DList`.
#[deriving(Clone)]
#[derive(Clone)]
#[stable]
pub struct IntoIter<T> {
list: DList<T>
Expand Down
8 changes: 4 additions & 4 deletions src/libcollections/enum_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use core::ops::{Sub, BitOr, BitAnd, BitXor};

// FIXME(contentions): implement union family of methods? (general design may be wrong here)

#[deriving(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
/// A specialized set implementation to use enum types.
pub struct EnumSet<E> {
// We must maintain the invariant that no bits are set
Expand Down Expand Up @@ -223,7 +223,7 @@ pub struct Iter<E> {
bits: uint,
}

// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
// FIXME(#19839) Remove in favor of `#[derive(Clone)]`
impl<E> Clone for Iter<E> {
fn clone(&self) -> Iter<E> {
Iter {
Expand Down Expand Up @@ -287,7 +287,7 @@ mod test {

use super::{EnumSet, CLike};

#[deriving(Copy, PartialEq, Show)]
#[derive(Copy, PartialEq, Show)]
#[repr(uint)]
enum Foo {
A, B, C
Expand Down Expand Up @@ -491,7 +491,7 @@ mod test {
#[should_fail]
fn test_overflow() {
#[allow(dead_code)]
#[deriving(Copy)]
#[derive(Copy)]
#[repr(uint)]
enum Bar {
V00, V01, V02, V03, V04, V05, V06, V07, V08, V09,
Expand Down
10 changes: 5 additions & 5 deletions src/libcollections/ring_buf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use core::prelude::*;
use core::cmp::Ordering;
use core::default::Default;
use core::fmt;
use core::iter::{mod, FromIterator, RandomAccessIterator};
use core::iter::{self, FromIterator, RandomAccessIterator};
use core::kinds::marker;
use core::mem;
use core::num::{Int, UnsignedInt};
Expand Down Expand Up @@ -1139,7 +1139,7 @@ pub struct Iter<'a, T:'a> {
head: uint
}

// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
// FIXME(#19839) Remove in favor of `#[derive(Clone)]`
impl<'a, T> Clone for Iter<'a, T> {
fn clone(&self) -> Iter<'a, T> {
Iter {
Expand Down Expand Up @@ -1674,21 +1674,21 @@ mod tests {
})
}

#[deriving(Clone, PartialEq, Show)]
#[derive(Clone, PartialEq, Show)]
enum Taggy {
One(int),
Two(int, int),
Three(int, int, int),
}

#[deriving(Clone, PartialEq, Show)]
#[derive(Clone, PartialEq, Show)]
enum Taggypar<T> {
Onepar(int),
Twopar(int, int),
Threepar(int, int, int),
}

#[deriving(Clone, PartialEq, Show)]
#[derive(Clone, PartialEq, Show)]
struct RecCy {
x: int,
y: int,
Expand Down
14 changes: 7 additions & 7 deletions src/libcollections/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,15 @@
use alloc::boxed::Box;
use core::borrow::{BorrowFrom, BorrowFromMut, ToOwned};
use core::clone::Clone;
use core::cmp::Ordering::{mod, Greater, Less};
use core::cmp::{mod, Ord, PartialEq};
use core::cmp::Ordering::{self, Greater, Less};
use core::cmp::{self, Ord, PartialEq};
use core::iter::{Iterator, IteratorExt, IteratorCloneExt};
use core::iter::{range, range_step, MultiplicativeIterator};
use core::kinds::Sized;
use core::mem::size_of;
use core::mem;
use core::ops::{FnMut, SliceMut};
use core::option::Option::{mod, Some, None};
use core::option::Option::{self, Some, None};
use core::ptr::PtrExt;
use core::ptr;
use core::result::Result;
Expand Down Expand Up @@ -1083,7 +1083,7 @@ impl<T: Clone, V: AsSlice<T>> SliceConcatExt<T, Vec<T>> for [V] {
/// The last generated swap is always (0, 1), and it returns the
/// sequence to its initial order.
#[experimental]
#[deriving(Clone)]
#[derive(Clone)]
pub struct ElementSwaps {
sdir: Vec<SizeDirection>,
/// If `true`, emit the last swap that returns the sequence to initial
Expand Down Expand Up @@ -1130,11 +1130,11 @@ impl<T: Clone> ToOwned<Vec<T>> for [T] {
// Iterators
////////////////////////////////////////////////////////////////////////////////

#[deriving(Copy, Clone)]
#[derive(Copy, Clone)]
enum Direction { Pos, Neg }

/// An `Index` and `Direction` together.
#[deriving(Copy, Clone)]
#[derive(Copy, Clone)]
struct SizeDirection {
size: uint,
dir: Direction,
Expand Down Expand Up @@ -2709,7 +2709,7 @@ mod tests {
assert!(values == [2, 3, 5, 6, 7]);
}

#[deriving(Clone, PartialEq)]
#[derive(Clone, PartialEq)]
struct Foo;

#[test]
Expand Down
Loading