auto merge of #14360 : alexcrichton/rust/remove-deprecated, r=kballard
These have all been deprecated for awhile now, so it's likely time to start removing them.
This commit is contained in:
commit
ad775be8b4
26 changed files with 70 additions and 521 deletions
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
use std::cmp;
|
use std::cmp;
|
||||||
use std::iter::RandomAccessIterator;
|
use std::iter::RandomAccessIterator;
|
||||||
use std::iter::{Rev, Enumerate, Repeat, Map, Zip};
|
use std::iter::{Enumerate, Repeat, Map, Zip};
|
||||||
use std::ops;
|
use std::ops;
|
||||||
use std::slice;
|
use std::slice;
|
||||||
use std::strbuf::StrBuf;
|
use std::strbuf::StrBuf;
|
||||||
|
@ -466,12 +466,6 @@ impl Bitv {
|
||||||
Bits {bitv: self, next_idx: 0, end_idx: self.nbits}
|
Bits {bitv: self, next_idx: 0, end_idx: self.nbits}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
|
||||||
#[deprecated = "replaced by .iter().rev()"]
|
|
||||||
pub fn rev_iter<'a>(&'a self) -> Rev<Bits<'a>> {
|
|
||||||
self.iter().rev()
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Returns `true` if all bits are 0
|
/// Returns `true` if all bits are 0
|
||||||
pub fn none(&self) -> bool {
|
pub fn none(&self) -> bool {
|
||||||
match self.rep {
|
match self.rep {
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
// Backlinks over DList::prev are raw pointers that form a full chain in
|
// Backlinks over DList::prev are raw pointers that form a full chain in
|
||||||
// the reverse direction.
|
// the reverse direction.
|
||||||
|
|
||||||
use std::iter::Rev;
|
|
||||||
use std::iter;
|
use std::iter;
|
||||||
use std::mem;
|
use std::mem;
|
||||||
use std::ptr;
|
use std::ptr;
|
||||||
|
@ -369,12 +368,6 @@ impl<T> DList<T> {
|
||||||
Items{nelem: self.len(), head: &self.list_head, tail: self.list_tail}
|
Items{nelem: self.len(), head: &self.list_head, tail: self.list_tail}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
|
||||||
#[deprecated = "replaced by .iter().rev()"]
|
|
||||||
pub fn rev_iter<'a>(&'a self) -> Rev<Items<'a, T>> {
|
|
||||||
self.iter().rev()
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Provide a forward iterator with mutable references
|
/// Provide a forward iterator with mutable references
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn mut_iter<'a>(&'a mut self) -> MutItems<'a, T> {
|
pub fn mut_iter<'a>(&'a mut self) -> MutItems<'a, T> {
|
||||||
|
@ -390,24 +383,12 @@ impl<T> DList<T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
|
||||||
#[deprecated = "replaced by .mut_iter().rev()"]
|
|
||||||
pub fn mut_rev_iter<'a>(&'a mut self) -> Rev<MutItems<'a, T>> {
|
|
||||||
self.mut_iter().rev()
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/// Consume the list into an iterator yielding elements by value
|
/// Consume the list into an iterator yielding elements by value
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn move_iter(self) -> MoveItems<T> {
|
pub fn move_iter(self) -> MoveItems<T> {
|
||||||
MoveItems{list: self}
|
MoveItems{list: self}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
|
||||||
#[deprecated = "replaced by .move_iter().rev()"]
|
|
||||||
pub fn move_rev_iter(self) -> Rev<MoveItems<T>> {
|
|
||||||
self.move_iter().rev()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T: TotalOrd> DList<T> {
|
impl<T: TotalOrd> DList<T> {
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
//! collections::deque::Deque`.
|
//! collections::deque::Deque`.
|
||||||
|
|
||||||
use std::cmp;
|
use std::cmp;
|
||||||
use std::iter::{Rev, RandomAccessIterator};
|
use std::iter::RandomAccessIterator;
|
||||||
|
|
||||||
use deque::Deque;
|
use deque::Deque;
|
||||||
|
|
||||||
|
@ -190,11 +190,6 @@ impl<T> RingBuf<T> {
|
||||||
Items{index: 0, rindex: self.nelts, lo: self.lo, elts: self.elts.as_slice()}
|
Items{index: 0, rindex: self.nelts, lo: self.lo, elts: self.elts.as_slice()}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[deprecated = "replaced by .iter().rev()"]
|
|
||||||
pub fn rev_iter<'a>(&'a self) -> Rev<Items<'a, T>> {
|
|
||||||
self.iter().rev()
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Front-to-back iterator which returns mutable values.
|
/// Front-to-back iterator which returns mutable values.
|
||||||
pub fn mut_iter<'a>(&'a mut self) -> MutItems<'a, T> {
|
pub fn mut_iter<'a>(&'a mut self) -> MutItems<'a, T> {
|
||||||
let start_index = raw_index(self.lo, self.elts.len(), 0);
|
let start_index = raw_index(self.lo, self.elts.len(), 0);
|
||||||
|
@ -220,11 +215,6 @@ impl<T> RingBuf<T> {
|
||||||
nelts: self.nelts }
|
nelts: self.nelts }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[deprecated = "replaced by .mut_iter().rev()"]
|
|
||||||
pub fn mut_rev_iter<'a>(&'a mut self) -> Rev<MutItems<'a, T>> {
|
|
||||||
self.mut_iter().rev()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// RingBuf iterator
|
/// RingBuf iterator
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
#![allow(missing_doc)]
|
#![allow(missing_doc)]
|
||||||
|
|
||||||
use std::iter::{Enumerate, FilterMap, Rev};
|
use std::iter::{Enumerate, FilterMap};
|
||||||
use std::mem::replace;
|
use std::mem::replace;
|
||||||
use std::{vec, slice};
|
use std::{vec, slice};
|
||||||
|
|
||||||
|
@ -142,16 +142,6 @@ impl<V> SmallIntMap<V> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[deprecated = "replaced by .iter().rev()"]
|
|
||||||
pub fn rev_iter<'r>(&'r self) -> Rev<Entries<'r, V>> {
|
|
||||||
self.iter().rev()
|
|
||||||
}
|
|
||||||
|
|
||||||
#[deprecated = "replaced by .mut_iter().rev()"]
|
|
||||||
pub fn mut_rev_iter<'r>(&'r mut self) -> Rev<MutEntries<'r, V>> {
|
|
||||||
self.mut_iter().rev()
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Empties the hash map, moving all values into the specified closure
|
/// Empties the hash map, moving all values into the specified closure
|
||||||
pub fn move_iter(&mut self)
|
pub fn move_iter(&mut self)
|
||||||
-> FilterMap<(uint, Option<V>), (uint, V),
|
-> FilterMap<(uint, Option<V>), (uint, V),
|
||||||
|
@ -243,8 +233,6 @@ pub struct Entries<'a, T> {
|
||||||
|
|
||||||
iterator!(impl Entries -> (uint, &'a T), get_ref)
|
iterator!(impl Entries -> (uint, &'a T), get_ref)
|
||||||
double_ended_iterator!(impl Entries -> (uint, &'a T), get_ref)
|
double_ended_iterator!(impl Entries -> (uint, &'a T), get_ref)
|
||||||
#[deprecated = "replaced by Rev<Entries<'a, T>>"]
|
|
||||||
pub type RevEntries<'a, T> = Rev<Entries<'a, T>>;
|
|
||||||
|
|
||||||
pub struct MutEntries<'a, T> {
|
pub struct MutEntries<'a, T> {
|
||||||
front: uint,
|
front: uint,
|
||||||
|
@ -254,8 +242,6 @@ pub struct MutEntries<'a, T> {
|
||||||
|
|
||||||
iterator!(impl MutEntries -> (uint, &'a mut T), get_mut_ref)
|
iterator!(impl MutEntries -> (uint, &'a mut T), get_mut_ref)
|
||||||
double_ended_iterator!(impl MutEntries -> (uint, &'a mut T), get_mut_ref)
|
double_ended_iterator!(impl MutEntries -> (uint, &'a mut T), get_mut_ref)
|
||||||
#[deprecated = "replaced by Rev<MutEntries<'a, T>"]
|
|
||||||
pub type RevMutEntries<'a, T> = Rev<MutEntries<'a, T>>;
|
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test_map {
|
mod test_map {
|
||||||
|
|
|
@ -386,9 +386,6 @@ pub trait ImmutableVector<'a, T> {
|
||||||
fn slice_to(&self, end: uint) -> &'a [T];
|
fn slice_to(&self, end: uint) -> &'a [T];
|
||||||
/// Returns an iterator over the vector
|
/// Returns an iterator over the vector
|
||||||
fn iter(self) -> Items<'a, T>;
|
fn iter(self) -> Items<'a, T>;
|
||||||
/// Returns a reversed iterator over a vector
|
|
||||||
#[deprecated = "replaced by .iter().rev()"]
|
|
||||||
fn rev_iter(self) -> Rev<Items<'a, T>>;
|
|
||||||
/// Returns an iterator over the subslices of the vector which are
|
/// Returns an iterator over the subslices of the vector which are
|
||||||
/// separated by elements that match `pred`. The matched element
|
/// separated by elements that match `pred`. The matched element
|
||||||
/// is not contained in the subslices.
|
/// is not contained in the subslices.
|
||||||
|
@ -399,12 +396,6 @@ pub trait ImmutableVector<'a, T> {
|
||||||
/// the subslices.
|
/// the subslices.
|
||||||
fn splitn(self, n: uint, pred: |&T|: 'a -> bool) -> SplitsN<'a, T>;
|
fn splitn(self, n: uint, pred: |&T|: 'a -> bool) -> SplitsN<'a, T>;
|
||||||
/// Returns an iterator over the subslices of the vector which are
|
/// Returns an iterator over the subslices of the vector which are
|
||||||
/// separated by elements that match `pred`. This starts at the
|
|
||||||
/// end of the vector and works backwards. The matched element is
|
|
||||||
/// not contained in the subslices.
|
|
||||||
#[deprecated = "replaced by .split(pred).rev()"]
|
|
||||||
fn rsplit(self, pred: |&T|: 'a -> bool) -> Rev<Splits<'a, T>>;
|
|
||||||
/// Returns an iterator over the subslices of the vector which are
|
|
||||||
/// separated by elements that match `pred` limited to splitting
|
/// separated by elements that match `pred` limited to splitting
|
||||||
/// at most `n` times. This starts at the end of the vector and
|
/// at most `n` times. This starts at the end of the vector and
|
||||||
/// works backwards. The matched element is not contained in the
|
/// works backwards. The matched element is not contained in the
|
||||||
|
@ -580,12 +571,6 @@ impl<'a,T> ImmutableVector<'a, T> for &'a [T] {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
|
||||||
#[deprecated = "replaced by .iter().rev()"]
|
|
||||||
fn rev_iter(self) -> Rev<Items<'a, T>> {
|
|
||||||
self.iter().rev()
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn split(self, pred: |&T|: 'a -> bool) -> Splits<'a, T> {
|
fn split(self, pred: |&T|: 'a -> bool) -> Splits<'a, T> {
|
||||||
Splits {
|
Splits {
|
||||||
|
@ -604,12 +589,6 @@ impl<'a,T> ImmutableVector<'a, T> for &'a [T] {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
|
||||||
#[deprecated = "replaced by .split(pred).rev()"]
|
|
||||||
fn rsplit(self, pred: |&T|: 'a -> bool) -> Rev<Splits<'a, T>> {
|
|
||||||
self.split(pred).rev()
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn rsplitn(self, n: uint, pred: |&T|: 'a -> bool) -> SplitsN<'a, T> {
|
fn rsplitn(self, n: uint, pred: |&T|: 'a -> bool) -> SplitsN<'a, T> {
|
||||||
SplitsN {
|
SplitsN {
|
||||||
|
@ -806,10 +785,6 @@ pub trait MutableVector<'a, T> {
|
||||||
/// Returns a mutable pointer to the last item in the vector.
|
/// Returns a mutable pointer to the last item in the vector.
|
||||||
fn mut_last(self) -> Option<&'a mut T>;
|
fn mut_last(self) -> Option<&'a mut T>;
|
||||||
|
|
||||||
/// Returns a reversed iterator that allows modifying each value
|
|
||||||
#[deprecated = "replaced by .mut_iter().rev()"]
|
|
||||||
fn mut_rev_iter(self) -> Rev<MutItems<'a, T>>;
|
|
||||||
|
|
||||||
/// Returns an iterator over the mutable subslices of the vector
|
/// Returns an iterator over the mutable subslices of the vector
|
||||||
/// which are separated by elements that match `pred`. The
|
/// which are separated by elements that match `pred`. The
|
||||||
/// matched element is not contained in the subslices.
|
/// matched element is not contained in the subslices.
|
||||||
|
@ -1045,12 +1020,6 @@ impl<'a,T> MutableVector<'a, T> for &'a mut [T] {
|
||||||
Some(&mut self[len - 1])
|
Some(&mut self[len - 1])
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
|
||||||
#[deprecated = "replaced by .mut_iter().rev()"]
|
|
||||||
fn mut_rev_iter(self) -> Rev<MutItems<'a, T>> {
|
|
||||||
self.mut_iter().rev()
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn mut_split(self, pred: |&T|: 'a -> bool) -> MutSplits<'a, T> {
|
fn mut_split(self, pred: |&T|: 'a -> bool) -> MutSplits<'a, T> {
|
||||||
MutSplits { v: self, pred: pred, finished: false }
|
MutSplits { v: self, pred: pred, finished: false }
|
||||||
|
@ -1354,8 +1323,6 @@ impl<'a, T> RandomAccessIterator<&'a T> for Items<'a, T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
iterator!{struct Items -> *T, &'a T}
|
iterator!{struct Items -> *T, &'a T}
|
||||||
#[deprecated = "replaced by Rev<Items<'a, T>>"]
|
|
||||||
pub type RevItems<'a, T> = Rev<Items<'a, T>>;
|
|
||||||
|
|
||||||
impl<'a, T> ExactSize<&'a T> for Items<'a, T> {}
|
impl<'a, T> ExactSize<&'a T> for Items<'a, T> {}
|
||||||
impl<'a, T> ExactSize<&'a mut T> for MutItems<'a, T> {}
|
impl<'a, T> ExactSize<&'a mut T> for MutItems<'a, T> {}
|
||||||
|
@ -1365,8 +1332,6 @@ impl<'a, T> Clone for Items<'a, T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
iterator!{struct MutItems -> *mut T, &'a mut T}
|
iterator!{struct MutItems -> *mut T, &'a mut T}
|
||||||
#[deprecated = "replaced by Rev<MutItems<'a, T>>"]
|
|
||||||
pub type RevMutItems<'a, T> = Rev<MutItems<'a, T>>;
|
|
||||||
|
|
||||||
/// An iterator over the subslices of the vector which are separated
|
/// An iterator over the subslices of the vector which are separated
|
||||||
/// by elements that match `pred`.
|
/// by elements that match `pred`.
|
||||||
|
|
|
@ -20,7 +20,7 @@ use cmp::{Eq, TotalEq};
|
||||||
use container::Container;
|
use container::Container;
|
||||||
use default::Default;
|
use default::Default;
|
||||||
use iter::{Filter, Map, Iterator};
|
use iter::{Filter, Map, Iterator};
|
||||||
use iter::{Rev, DoubleEndedIterator, ExactSize};
|
use iter::{DoubleEndedIterator, ExactSize};
|
||||||
use iter::range;
|
use iter::range;
|
||||||
use num::Saturating;
|
use num::Saturating;
|
||||||
use option::{None, Option, Some};
|
use option::{None, Option, Some};
|
||||||
|
@ -174,20 +174,11 @@ impl<'a> DoubleEndedIterator<(uint, char)> for CharOffsets<'a> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[deprecated = "replaced by Rev<Chars<'a>>"]
|
|
||||||
pub type RevChars<'a> = Rev<Chars<'a>>;
|
|
||||||
|
|
||||||
#[deprecated = "replaced by Rev<CharOffsets<'a>>"]
|
|
||||||
pub type RevCharOffsets<'a> = Rev<CharOffsets<'a>>;
|
|
||||||
|
|
||||||
/// External iterator for a string's bytes.
|
/// External iterator for a string's bytes.
|
||||||
/// Use with the `std::iter` module.
|
/// Use with the `std::iter` module.
|
||||||
pub type Bytes<'a> =
|
pub type Bytes<'a> =
|
||||||
Map<'a, &'a u8, u8, slice::Items<'a, u8>>;
|
Map<'a, &'a u8, u8, slice::Items<'a, u8>>;
|
||||||
|
|
||||||
#[deprecated = "replaced by Rev<Bytes<'a>>"]
|
|
||||||
pub type RevBytes<'a> = Rev<Bytes<'a>>;
|
|
||||||
|
|
||||||
/// An iterator over the substrings of a string, separated by `sep`.
|
/// An iterator over the substrings of a string, separated by `sep`.
|
||||||
#[deriving(Clone)]
|
#[deriving(Clone)]
|
||||||
pub struct CharSplits<'a, Sep> {
|
pub struct CharSplits<'a, Sep> {
|
||||||
|
@ -200,9 +191,6 @@ pub struct CharSplits<'a, Sep> {
|
||||||
finished: bool,
|
finished: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[deprecated = "replaced by Rev<CharSplits<'a, Sep>>"]
|
|
||||||
pub type RevCharSplits<'a, Sep> = Rev<CharSplits<'a, Sep>>;
|
|
||||||
|
|
||||||
/// An iterator over the substrings of a string, separated by `sep`,
|
/// An iterator over the substrings of a string, separated by `sep`,
|
||||||
/// splitting at most `count` times.
|
/// splitting at most `count` times.
|
||||||
#[deriving(Clone)]
|
#[deriving(Clone)]
|
||||||
|
@ -1032,24 +1020,12 @@ pub trait StrSlice<'a> {
|
||||||
/// ```
|
/// ```
|
||||||
fn chars(&self) -> Chars<'a>;
|
fn chars(&self) -> Chars<'a>;
|
||||||
|
|
||||||
/// Do not use this - it is deprecated.
|
|
||||||
#[deprecated = "replaced by .chars().rev()"]
|
|
||||||
fn chars_rev(&self) -> Rev<Chars<'a>>;
|
|
||||||
|
|
||||||
/// An iterator over the bytes of `self`
|
/// An iterator over the bytes of `self`
|
||||||
fn bytes(&self) -> Bytes<'a>;
|
fn bytes(&self) -> Bytes<'a>;
|
||||||
|
|
||||||
/// Do not use this - it is deprecated.
|
|
||||||
#[deprecated = "replaced by .bytes().rev()"]
|
|
||||||
fn bytes_rev(&self) -> Rev<Bytes<'a>>;
|
|
||||||
|
|
||||||
/// An iterator over the characters of `self` and their byte offsets.
|
/// An iterator over the characters of `self` and their byte offsets.
|
||||||
fn char_indices(&self) -> CharOffsets<'a>;
|
fn char_indices(&self) -> CharOffsets<'a>;
|
||||||
|
|
||||||
/// Do not use this - it is deprecated.
|
|
||||||
#[deprecated = "replaced by .char_indices().rev()"]
|
|
||||||
fn char_indices_rev(&self) -> Rev<CharOffsets<'a>>;
|
|
||||||
|
|
||||||
/// An iterator over substrings of `self`, separated by characters
|
/// An iterator over substrings of `self`, separated by characters
|
||||||
/// matched by `sep`.
|
/// matched by `sep`.
|
||||||
///
|
///
|
||||||
|
@ -1120,10 +1096,6 @@ pub trait StrSlice<'a> {
|
||||||
/// ```
|
/// ```
|
||||||
fn split_terminator<Sep: CharEq>(&self, sep: Sep) -> CharSplits<'a, Sep>;
|
fn split_terminator<Sep: CharEq>(&self, sep: Sep) -> CharSplits<'a, Sep>;
|
||||||
|
|
||||||
/// Do not use this - it is deprecated.
|
|
||||||
#[deprecated = "replaced by .split(sep).rev()"]
|
|
||||||
fn rsplit<Sep: CharEq>(&self, sep: Sep) -> Rev<CharSplits<'a, Sep>>;
|
|
||||||
|
|
||||||
/// An iterator over substrings of `self`, separated by characters
|
/// An iterator over substrings of `self`, separated by characters
|
||||||
/// matched by `sep`, starting from the end of the string.
|
/// matched by `sep`, starting from the end of the string.
|
||||||
/// Restricted to splitting at most `count` times.
|
/// Restricted to splitting at most `count` times.
|
||||||
|
@ -1642,34 +1614,16 @@ impl<'a> StrSlice<'a> for &'a str {
|
||||||
Chars{string: *self}
|
Chars{string: *self}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
|
||||||
#[deprecated = "replaced by .chars().rev()"]
|
|
||||||
fn chars_rev(&self) -> RevChars<'a> {
|
|
||||||
self.chars().rev()
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn bytes(&self) -> Bytes<'a> {
|
fn bytes(&self) -> Bytes<'a> {
|
||||||
self.as_bytes().iter().map(|&b| b)
|
self.as_bytes().iter().map(|&b| b)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
|
||||||
#[deprecated = "replaced by .bytes().rev()"]
|
|
||||||
fn bytes_rev(&self) -> RevBytes<'a> {
|
|
||||||
self.bytes().rev()
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn char_indices(&self) -> CharOffsets<'a> {
|
fn char_indices(&self) -> CharOffsets<'a> {
|
||||||
CharOffsets{string: *self, iter: self.chars()}
|
CharOffsets{string: *self, iter: self.chars()}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
|
||||||
#[deprecated = "replaced by .char_indices().rev()"]
|
|
||||||
fn char_indices_rev(&self) -> RevCharOffsets<'a> {
|
|
||||||
self.char_indices().rev()
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn split<Sep: CharEq>(&self, sep: Sep) -> CharSplits<'a, Sep> {
|
fn split<Sep: CharEq>(&self, sep: Sep) -> CharSplits<'a, Sep> {
|
||||||
CharSplits {
|
CharSplits {
|
||||||
|
@ -1700,12 +1654,6 @@ impl<'a> StrSlice<'a> for &'a str {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
|
||||||
#[deprecated = "replaced by .split(sep).rev()"]
|
|
||||||
fn rsplit<Sep: CharEq>(&self, sep: Sep) -> RevCharSplits<'a, Sep> {
|
|
||||||
self.split(sep).rev()
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn rsplitn<Sep: CharEq>(&self, sep: Sep, count: uint)
|
fn rsplitn<Sep: CharEq>(&self, sep: Sep, count: uint)
|
||||||
-> CharSplitsN<'a, Sep> {
|
-> CharSplitsN<'a, Sep> {
|
||||||
|
|
|
@ -323,12 +323,6 @@ pub trait Rng {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Shuffle a mutable slice in place.
|
|
||||||
#[deprecated="renamed to `.shuffle`"]
|
|
||||||
fn shuffle_mut<T>(&mut self, values: &mut [T]) {
|
|
||||||
self.shuffle(values)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Randomly sample up to `n` elements from an iterator.
|
/// Randomly sample up to `n` elements from an iterator.
|
||||||
///
|
///
|
||||||
/// # Example
|
/// # Example
|
||||||
|
@ -387,23 +381,6 @@ pub trait SeedableRng<Seed>: Rng {
|
||||||
fn from_seed(seed: Seed) -> Self;
|
fn from_seed(seed: Seed) -> Self;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create a random number generator with a default algorithm and seed.
|
|
||||||
///
|
|
||||||
/// It returns the strongest `Rng` algorithm currently implemented in
|
|
||||||
/// pure Rust. If you require a specifically seeded `Rng` for
|
|
||||||
/// consistency over time you should pick one algorithm and create the
|
|
||||||
/// `Rng` yourself.
|
|
||||||
///
|
|
||||||
/// This is a very expensive operation as it has to read randomness
|
|
||||||
/// from the operating system and use this in an expensive seeding
|
|
||||||
/// operation. If one does not require high performance generation of
|
|
||||||
/// random numbers, `task_rng` and/or `random` may be more
|
|
||||||
/// appropriate.
|
|
||||||
#[deprecated="use `task_rng` or `StdRng::new`"]
|
|
||||||
pub fn rng() -> StdRng {
|
|
||||||
StdRng::new().unwrap()
|
|
||||||
}
|
|
||||||
|
|
||||||
/// The standard RNG. This is designed to be efficient on the current
|
/// The standard RNG. This is designed to be efficient on the current
|
||||||
/// platform.
|
/// platform.
|
||||||
#[cfg(not(target_word_size="64"))]
|
#[cfg(not(target_word_size="64"))]
|
||||||
|
|
|
@ -1099,7 +1099,10 @@ impl<'a> SanePrivacyVisitor<'a> {
|
||||||
check_inherited(m.span, m.vis,
|
check_inherited(m.span, m.vis,
|
||||||
"unnecessary visibility");
|
"unnecessary visibility");
|
||||||
}
|
}
|
||||||
ast::Required(..) => {}
|
ast::Required(ref m) => {
|
||||||
|
check_inherited(m.span, m.vis,
|
||||||
|
"unnecessary visibility");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,7 +102,7 @@ fn doit(sess: &parse::ParseSess, mut lexer: lexer::StringReader, class: Option<&
|
||||||
|
|
||||||
// miscellaneous, no highlighting
|
// miscellaneous, no highlighting
|
||||||
t::DOT | t::DOTDOT | t::DOTDOTDOT | t::COMMA | t::SEMI |
|
t::DOT | t::DOTDOT | t::DOTDOTDOT | t::COMMA | t::SEMI |
|
||||||
t::COLON | t::MOD_SEP | t::LARROW | t::DARROW | t::LPAREN |
|
t::COLON | t::MOD_SEP | t::LARROW | t::LPAREN |
|
||||||
t::RPAREN | t::LBRACKET | t::LBRACE | t::RBRACE => "",
|
t::RPAREN | t::LBRACKET | t::LBRACE | t::RBRACE => "",
|
||||||
t::DOLLAR => {
|
t::DOLLAR => {
|
||||||
if t::is_ident(&lexer.peek().tok) {
|
if t::is_ident(&lexer.peek().tok) {
|
||||||
|
|
|
@ -96,28 +96,16 @@ pub use Path = self::windows::Path;
|
||||||
/// Typedef for the platform-native component iterator
|
/// Typedef for the platform-native component iterator
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
pub use Components = self::posix::Components;
|
pub use Components = self::posix::Components;
|
||||||
/// Typedef for the platform-native reverse component iterator
|
|
||||||
#[cfg(unix)]
|
|
||||||
pub use RevComponents = self::posix::RevComponents;
|
|
||||||
/// Typedef for the platform-native component iterator
|
/// Typedef for the platform-native component iterator
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
pub use Components = self::windows::Components;
|
pub use Components = self::windows::Components;
|
||||||
/// Typedef for the platform-native reverse component iterator
|
|
||||||
#[cfg(windows)]
|
|
||||||
pub use RevComponents = self::windows::RevComponents;
|
|
||||||
|
|
||||||
/// Typedef for the platform-native str component iterator
|
/// Typedef for the platform-native str component iterator
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
pub use StrComponents = self::posix::StrComponents;
|
pub use StrComponents = self::posix::StrComponents;
|
||||||
/// Typedef for the platform-native reverse str component iterator
|
|
||||||
#[cfg(unix)]
|
|
||||||
pub use RevStrComponents = self::posix::RevStrComponents;
|
|
||||||
/// Typedef for the platform-native str component iterator
|
/// Typedef for the platform-native str component iterator
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
pub use StrComponents = self::windows::StrComponents;
|
pub use StrComponents = self::windows::StrComponents;
|
||||||
/// Typedef for the platform-native reverse str component iterator
|
|
||||||
#[cfg(windows)]
|
|
||||||
pub use RevStrComponents = self::windows::RevStrComponents;
|
|
||||||
|
|
||||||
/// Alias for the platform-native separator character.
|
/// Alias for the platform-native separator character.
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
|
|
|
@ -16,7 +16,7 @@ use clone::Clone;
|
||||||
use cmp::{Eq, TotalEq};
|
use cmp::{Eq, TotalEq};
|
||||||
use from_str::FromStr;
|
use from_str::FromStr;
|
||||||
use io::Writer;
|
use io::Writer;
|
||||||
use iter::{DoubleEndedIterator, Rev, AdditiveIterator, Extendable, Iterator, Map};
|
use iter::{DoubleEndedIterator, AdditiveIterator, Extendable, Iterator, Map};
|
||||||
use option::{Option, None, Some};
|
use option::{Option, None, Some};
|
||||||
use str;
|
use str;
|
||||||
use str::Str;
|
use str::Str;
|
||||||
|
@ -28,16 +28,10 @@ use super::{BytesContainer, GenericPath, GenericPathUnsafe};
|
||||||
|
|
||||||
/// Iterator that yields successive components of a Path as &[u8]
|
/// Iterator that yields successive components of a Path as &[u8]
|
||||||
pub type Components<'a> = Splits<'a, u8>;
|
pub type Components<'a> = Splits<'a, u8>;
|
||||||
/// Iterator that yields components of a Path in reverse as &[u8]
|
|
||||||
#[deprecated = "replaced by Rev<Components<'a>>"]
|
|
||||||
pub type RevComponents<'a> = Rev<Components<'a>>;
|
|
||||||
|
|
||||||
/// Iterator that yields successive components of a Path as Option<&str>
|
/// Iterator that yields successive components of a Path as Option<&str>
|
||||||
pub type StrComponents<'a> = Map<'a, &'a [u8], Option<&'a str>,
|
pub type StrComponents<'a> = Map<'a, &'a [u8], Option<&'a str>,
|
||||||
Components<'a>>;
|
Components<'a>>;
|
||||||
/// Iterator that yields components of a Path in reverse as Option<&str>
|
|
||||||
#[deprecated = "replaced by Rev<StrComponents<'a>>"]
|
|
||||||
pub type RevStrComponents<'a> = Rev<StrComponents<'a>>;
|
|
||||||
|
|
||||||
/// Represents a POSIX file path
|
/// Represents a POSIX file path
|
||||||
#[deriving(Clone)]
|
#[deriving(Clone)]
|
||||||
|
@ -414,25 +408,11 @@ impl Path {
|
||||||
ret
|
ret
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns an iterator that yields each component of the path in reverse.
|
|
||||||
/// See components() for details.
|
|
||||||
#[deprecated = "replaced by .components().rev()"]
|
|
||||||
pub fn rev_components<'a>(&'a self) -> Rev<Components<'a>> {
|
|
||||||
self.components().rev()
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Returns an iterator that yields each component of the path as Option<&str>.
|
/// Returns an iterator that yields each component of the path as Option<&str>.
|
||||||
/// See components() for details.
|
/// See components() for details.
|
||||||
pub fn str_components<'a>(&'a self) -> StrComponents<'a> {
|
pub fn str_components<'a>(&'a self) -> StrComponents<'a> {
|
||||||
self.components().map(str::from_utf8)
|
self.components().map(str::from_utf8)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns an iterator that yields each component of the path in reverse as Option<&str>.
|
|
||||||
/// See components() for details.
|
|
||||||
#[deprecated = "replaced by .str_components().rev()"]
|
|
||||||
pub fn rev_str_components<'a>(&'a self) -> Rev<StrComponents<'a>> {
|
|
||||||
self.str_components().rev()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// None result means the byte vector didn't need normalizing
|
// None result means the byte vector didn't need normalizing
|
||||||
|
|
|
@ -17,7 +17,7 @@ use cmp::{Eq, TotalEq};
|
||||||
use container::Container;
|
use container::Container;
|
||||||
use from_str::FromStr;
|
use from_str::FromStr;
|
||||||
use io::Writer;
|
use io::Writer;
|
||||||
use iter::{AdditiveIterator, DoubleEndedIterator, Extendable, Rev, Iterator, Map};
|
use iter::{AdditiveIterator, DoubleEndedIterator, Extendable, Iterator, Map};
|
||||||
use mem;
|
use mem;
|
||||||
use option::{Option, Some, None};
|
use option::{Option, Some, None};
|
||||||
use slice::{Vector, OwnedVector, ImmutableVector};
|
use slice::{Vector, OwnedVector, ImmutableVector};
|
||||||
|
@ -33,19 +33,10 @@ use super::{contains_nul, BytesContainer, GenericPath, GenericPathUnsafe};
|
||||||
/// every component in WindowsPath is guaranteed to be Some.
|
/// every component in WindowsPath is guaranteed to be Some.
|
||||||
pub type StrComponents<'a> = Map<'a, &'a str, Option<&'a str>,
|
pub type StrComponents<'a> = Map<'a, &'a str, Option<&'a str>,
|
||||||
CharSplits<'a, char>>;
|
CharSplits<'a, char>>;
|
||||||
/// Iterator that yields components of a Path in reverse as &str
|
|
||||||
///
|
|
||||||
/// Each component is yielded as Option<&str> for compatibility with PosixPath, but
|
|
||||||
/// every component in WindowsPath is guaranteed to be Some.
|
|
||||||
#[deprecated = "replaced by Rev<StrComponents<'a>>"]
|
|
||||||
pub type RevStrComponents<'a> = Rev<StrComponents<'a>>;
|
|
||||||
|
|
||||||
/// Iterator that yields successive components of a Path as &[u8]
|
/// Iterator that yields successive components of a Path as &[u8]
|
||||||
pub type Components<'a> = Map<'a, Option<&'a str>, &'a [u8],
|
pub type Components<'a> = Map<'a, Option<&'a str>, &'a [u8],
|
||||||
StrComponents<'a>>;
|
StrComponents<'a>>;
|
||||||
/// Iterator that yields components of a Path in reverse as &[u8]
|
|
||||||
#[deprecated = "replaced by Rev<Components<'a>>"]
|
|
||||||
pub type RevComponents<'a> = Rev<Components<'a>>;
|
|
||||||
|
|
||||||
/// Represents a Windows path
|
/// Represents a Windows path
|
||||||
// Notes for Windows path impl:
|
// Notes for Windows path impl:
|
||||||
|
@ -657,13 +648,6 @@ impl Path {
|
||||||
ret
|
ret
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns an iterator that yields each component of the path in reverse as an Option<&str>
|
|
||||||
/// See str_components() for details.
|
|
||||||
#[deprecated = "replaced by .str_components().rev()"]
|
|
||||||
pub fn rev_str_components<'a>(&'a self) -> Rev<StrComponents<'a>> {
|
|
||||||
self.str_components().rev()
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Returns an iterator that yields each component of the path in turn as a &[u8].
|
/// Returns an iterator that yields each component of the path in turn as a &[u8].
|
||||||
/// See str_components() for details.
|
/// See str_components() for details.
|
||||||
pub fn components<'a>(&'a self) -> Components<'a> {
|
pub fn components<'a>(&'a self) -> Components<'a> {
|
||||||
|
@ -674,13 +658,6 @@ impl Path {
|
||||||
self.str_components().map(convert)
|
self.str_components().map(convert)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns an iterator that yields each component of the path in reverse as a &[u8].
|
|
||||||
/// See str_components() for details.
|
|
||||||
#[deprecated = "replaced by .components().rev()"]
|
|
||||||
pub fn rev_components<'a>(&'a self) -> Rev<Components<'a>> {
|
|
||||||
self.components().rev()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn equiv_prefix(&self, other: &Path) -> bool {
|
fn equiv_prefix(&self, other: &Path) -> bool {
|
||||||
let s_repr = self.repr.as_slice();
|
let s_repr = self.repr.as_slice();
|
||||||
let o_repr = other.repr.as_slice();
|
let o_repr = other.repr.as_slice();
|
||||||
|
|
|
@ -116,7 +116,7 @@ use vec::Vec;
|
||||||
pub use core::slice::{ref_slice, mut_ref_slice, Splits, Windows};
|
pub use core::slice::{ref_slice, mut_ref_slice, Splits, Windows};
|
||||||
pub use core::slice::{Chunks, Vector, ImmutableVector, ImmutableEqVector};
|
pub use core::slice::{Chunks, Vector, ImmutableVector, ImmutableEqVector};
|
||||||
pub use core::slice::{ImmutableTotalOrdVector, MutableVector, Items, MutItems};
|
pub use core::slice::{ImmutableTotalOrdVector, MutableVector, Items, MutItems};
|
||||||
pub use core::slice::{RevItems, RevMutItems, MutSplits, MutChunks};
|
pub use core::slice::{MutSplits, MutChunks};
|
||||||
pub use core::slice::{bytes, MutableCloneableVector};
|
pub use core::slice::{bytes, MutableCloneableVector};
|
||||||
|
|
||||||
// Functional utilities
|
// Functional utilities
|
||||||
|
@ -403,10 +403,6 @@ pub trait OwnedVector<T> {
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
fn move_iter(self) -> MoveItems<T>;
|
fn move_iter(self) -> MoveItems<T>;
|
||||||
/// Creates a consuming iterator that moves out of the vector in
|
|
||||||
/// reverse order.
|
|
||||||
#[deprecated = "replaced by .move_iter().rev()"]
|
|
||||||
fn move_rev_iter(self) -> Rev<MoveItems<T>>;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Partitions the vector into two vectors `(A,B)`, where all
|
* Partitions the vector into two vectors `(A,B)`, where all
|
||||||
|
@ -425,12 +421,6 @@ impl<T> OwnedVector<T> for ~[T] {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
|
||||||
#[deprecated = "replaced by .move_iter().rev()"]
|
|
||||||
fn move_rev_iter(self) -> Rev<MoveItems<T>> {
|
|
||||||
self.move_iter().rev()
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn partition(self, f: |&T| -> bool) -> (Vec<T>, Vec<T>) {
|
fn partition(self, f: |&T| -> bool) -> (Vec<T>, Vec<T>) {
|
||||||
let mut lefts = Vec::new();
|
let mut lefts = Vec::new();
|
||||||
|
@ -776,10 +766,6 @@ impl<T> Drop for MoveItems<T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An iterator that moves out of a vector in reverse order.
|
|
||||||
#[deprecated = "replaced by Rev<MoveItems<'a, T>>"]
|
|
||||||
pub type RevMoveItems<T> = Rev<MoveItems<T>>;
|
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use prelude::*;
|
use prelude::*;
|
||||||
|
|
|
@ -82,8 +82,8 @@ use slice::{ImmutableVector, MutableVector, CloneableVector};
|
||||||
use strbuf::StrBuf;
|
use strbuf::StrBuf;
|
||||||
use vec::Vec;
|
use vec::Vec;
|
||||||
|
|
||||||
pub use core::str::{from_utf8, CharEq, Chars, CharOffsets, RevChars};
|
pub use core::str::{from_utf8, CharEq, Chars, CharOffsets};
|
||||||
pub use core::str::{RevCharOffsets, Bytes, RevBytes, CharSplits, RevCharSplits};
|
pub use core::str::{Bytes, CharSplits};
|
||||||
pub use core::str::{CharSplitsN, Words, AnyLines, MatchIndices, StrSplits};
|
pub use core::str::{CharSplitsN, Words, AnyLines, MatchIndices, StrSplits};
|
||||||
pub use core::str::{eq_slice, is_utf8, is_utf16, UTF16Items};
|
pub use core::str::{eq_slice, is_utf8, is_utf16, UTF16Items};
|
||||||
pub use core::str::{UTF16Item, ScalarValue, LoneSurrogate, utf16_items};
|
pub use core::str::{UTF16Item, ScalarValue, LoneSurrogate, utf16_items};
|
||||||
|
|
|
@ -689,6 +689,7 @@ pub struct TypeMethod {
|
||||||
pub explicit_self: ExplicitSelf,
|
pub explicit_self: ExplicitSelf,
|
||||||
pub id: NodeId,
|
pub id: NodeId,
|
||||||
pub span: Span,
|
pub span: Span,
|
||||||
|
pub vis: Visibility,
|
||||||
}
|
}
|
||||||
|
|
||||||
// A trait method is either required (meaning it doesn't have an
|
// A trait method is either required (meaning it doesn't have an
|
||||||
|
|
|
@ -305,6 +305,7 @@ pub fn trait_method_to_ty_method(method: &TraitMethod) -> TypeMethod {
|
||||||
explicit_self: m.explicit_self,
|
explicit_self: m.explicit_self,
|
||||||
id: m.id,
|
id: m.id,
|
||||||
span: m.span,
|
span: m.span,
|
||||||
|
vis: m.vis,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -543,7 +543,6 @@ fn mk_token(cx: &ExtCtxt, sp: Span, tok: &token::Token) -> @ast::Expr {
|
||||||
MOD_SEP => "MOD_SEP",
|
MOD_SEP => "MOD_SEP",
|
||||||
RARROW => "RARROW",
|
RARROW => "RARROW",
|
||||||
LARROW => "LARROW",
|
LARROW => "LARROW",
|
||||||
DARROW => "DARROW",
|
|
||||||
FAT_ARROW => "FAT_ARROW",
|
FAT_ARROW => "FAT_ARROW",
|
||||||
LPAREN => "LPAREN",
|
LPAREN => "LPAREN",
|
||||||
RPAREN => "RPAREN",
|
RPAREN => "RPAREN",
|
||||||
|
|
|
@ -648,6 +648,7 @@ pub fn noop_fold_type_method<T: Folder>(m: &TypeMethod, fld: &mut T) -> TypeMeth
|
||||||
generics: fold_generics(&m.generics, fld),
|
generics: fold_generics(&m.generics, fld),
|
||||||
explicit_self: fld.fold_explicit_self(&m.explicit_self),
|
explicit_self: fld.fold_explicit_self(&m.explicit_self),
|
||||||
span: fld.new_span(m.span),
|
span: fld.new_span(m.span),
|
||||||
|
vis: m.vis,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -789,10 +789,7 @@ fn next_token_inner(rdr: &mut StringReader) -> token::Token {
|
||||||
'<' => { return binop(rdr, token::SHL); }
|
'<' => { return binop(rdr, token::SHL); }
|
||||||
'-' => {
|
'-' => {
|
||||||
bump(rdr);
|
bump(rdr);
|
||||||
match rdr.curr.unwrap_or('\x00') {
|
return token::LARROW;
|
||||||
'>' => { bump(rdr); return token::DARROW; }
|
|
||||||
_ => { return token::LARROW; }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
_ => { return token::LT; }
|
_ => { return token::LT; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,21 +25,6 @@ use parse::token;
|
||||||
/// The specific types of unsupported syntax
|
/// The specific types of unsupported syntax
|
||||||
#[deriving(Eq, TotalEq, Hash)]
|
#[deriving(Eq, TotalEq, Hash)]
|
||||||
pub enum ObsoleteSyntax {
|
pub enum ObsoleteSyntax {
|
||||||
ObsoleteSwap,
|
|
||||||
ObsoleteUnsafeBlock,
|
|
||||||
ObsoleteBareFnType,
|
|
||||||
ObsoleteMultipleLocalDecl,
|
|
||||||
ObsoleteUnsafeExternFn,
|
|
||||||
ObsoleteTraitFuncVisibility,
|
|
||||||
ObsoleteConstPointer,
|
|
||||||
ObsoleteLoopAsContinue,
|
|
||||||
ObsoleteEnumWildcard,
|
|
||||||
ObsoleteStructWildcard,
|
|
||||||
ObsoleteVecDotDotWildcard,
|
|
||||||
ObsoleteMultipleImport,
|
|
||||||
ObsoleteManagedPattern,
|
|
||||||
ObsoleteManagedString,
|
|
||||||
ObsoleteManagedVec,
|
|
||||||
ObsoleteOwnedType,
|
ObsoleteOwnedType,
|
||||||
ObsoleteOwnedExpr,
|
ObsoleteOwnedExpr,
|
||||||
ObsoleteOwnedPattern,
|
ObsoleteOwnedPattern,
|
||||||
|
@ -64,71 +49,6 @@ impl<'a> ParserObsoleteMethods for Parser<'a> {
|
||||||
/// Reports an obsolete syntax non-fatal error.
|
/// Reports an obsolete syntax non-fatal error.
|
||||||
fn obsolete(&mut self, sp: Span, kind: ObsoleteSyntax) {
|
fn obsolete(&mut self, sp: Span, kind: ObsoleteSyntax) {
|
||||||
let (kind_str, desc) = match kind {
|
let (kind_str, desc) = match kind {
|
||||||
ObsoleteSwap => (
|
|
||||||
"swap",
|
|
||||||
"use std::mem::{swap, replace} instead"
|
|
||||||
),
|
|
||||||
ObsoleteUnsafeBlock => (
|
|
||||||
"non-standalone unsafe block",
|
|
||||||
"use an inner `unsafe { ... }` block instead"
|
|
||||||
),
|
|
||||||
ObsoleteBareFnType => (
|
|
||||||
"bare function type",
|
|
||||||
"use `|A| -> B` or `extern fn(A) -> B` instead"
|
|
||||||
),
|
|
||||||
ObsoleteMultipleLocalDecl => (
|
|
||||||
"declaration of multiple locals at once",
|
|
||||||
"instead of e.g. `let a = 1, b = 2`, write \
|
|
||||||
`let (a, b) = (1, 2)`."
|
|
||||||
),
|
|
||||||
ObsoleteUnsafeExternFn => (
|
|
||||||
"unsafe external function",
|
|
||||||
"external functions are always unsafe; remove the `unsafe` \
|
|
||||||
keyword"
|
|
||||||
),
|
|
||||||
ObsoleteTraitFuncVisibility => (
|
|
||||||
"visibility not necessary",
|
|
||||||
"trait functions inherit the visibility of the trait itself"
|
|
||||||
),
|
|
||||||
ObsoleteConstPointer => (
|
|
||||||
"const pointer",
|
|
||||||
"instead of `&const Foo` or `@const Foo`, write `&Foo` or \
|
|
||||||
`@Foo`"
|
|
||||||
),
|
|
||||||
ObsoleteLoopAsContinue => (
|
|
||||||
"`loop` instead of `continue`",
|
|
||||||
"`loop` is now only used for loops and `continue` is used for \
|
|
||||||
skipping iterations"
|
|
||||||
),
|
|
||||||
ObsoleteEnumWildcard => (
|
|
||||||
"enum wildcard",
|
|
||||||
"use `..` instead of `*` for matching all enum fields"
|
|
||||||
),
|
|
||||||
ObsoleteStructWildcard => (
|
|
||||||
"struct wildcard",
|
|
||||||
"use `..` instead of `_` for matching trailing struct fields"
|
|
||||||
),
|
|
||||||
ObsoleteVecDotDotWildcard => (
|
|
||||||
"vec slice wildcard",
|
|
||||||
"use `..` instead of `.._` for matching slices"
|
|
||||||
),
|
|
||||||
ObsoleteMultipleImport => (
|
|
||||||
"multiple imports",
|
|
||||||
"only one import is allowed per `use` statement"
|
|
||||||
),
|
|
||||||
ObsoleteManagedPattern => (
|
|
||||||
"managed pointer pattern",
|
|
||||||
"use a nested `match` expression instead of a managed box \
|
|
||||||
pattern"
|
|
||||||
),
|
|
||||||
ObsoleteManagedString => (
|
|
||||||
"managed string",
|
|
||||||
"use `Rc<StrBuf>` instead of a managed string"
|
|
||||||
),
|
|
||||||
ObsoleteManagedVec => (
|
|
||||||
"managed vector",
|
|
||||||
"use `Rc<~[T]>` instead of a managed vector"
|
|
||||||
),
|
|
||||||
ObsoleteOwnedType => (
|
ObsoleteOwnedType => (
|
||||||
"`~` notation for owned pointers",
|
"`~` notation for owned pointers",
|
||||||
"use `Box<T>` in `std::owned` instead"
|
"use `Box<T>` in `std::owned` instead"
|
||||||
|
|
|
@ -1138,11 +1138,10 @@ impl<'a> Parser<'a> {
|
||||||
let attrs = p.parse_outer_attributes();
|
let attrs = p.parse_outer_attributes();
|
||||||
let lo = p.span.lo;
|
let lo = p.span.lo;
|
||||||
|
|
||||||
let vis_span = p.span;
|
|
||||||
let vis = p.parse_visibility();
|
|
||||||
let style = p.parse_fn_style();
|
|
||||||
// NB: at the moment, trait methods are public by default; this
|
// NB: at the moment, trait methods are public by default; this
|
||||||
// could change.
|
// could change.
|
||||||
|
let vis = p.parse_visibility();
|
||||||
|
let style = p.parse_fn_style();
|
||||||
let ident = p.parse_ident();
|
let ident = p.parse_ident();
|
||||||
|
|
||||||
let generics = p.parse_generics();
|
let generics = p.parse_generics();
|
||||||
|
@ -1158,11 +1157,6 @@ impl<'a> Parser<'a> {
|
||||||
token::SEMI => {
|
token::SEMI => {
|
||||||
p.bump();
|
p.bump();
|
||||||
debug!("parse_trait_methods(): parsing required method");
|
debug!("parse_trait_methods(): parsing required method");
|
||||||
// NB: at the moment, visibility annotations on required
|
|
||||||
// methods are ignored; this could change.
|
|
||||||
if vis != ast::Inherited {
|
|
||||||
p.obsolete(vis_span, ObsoleteTraitFuncVisibility);
|
|
||||||
}
|
|
||||||
Required(TypeMethod {
|
Required(TypeMethod {
|
||||||
ident: ident,
|
ident: ident,
|
||||||
attrs: attrs,
|
attrs: attrs,
|
||||||
|
@ -1171,7 +1165,8 @@ impl<'a> Parser<'a> {
|
||||||
generics: generics,
|
generics: generics,
|
||||||
explicit_self: explicit_self,
|
explicit_self: explicit_self,
|
||||||
id: ast::DUMMY_NODE_ID,
|
id: ast::DUMMY_NODE_ID,
|
||||||
span: mk_sp(lo, hi)
|
span: mk_sp(lo, hi),
|
||||||
|
vis: vis,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
token::LBRACE => {
|
token::LBRACE => {
|
||||||
|
@ -1691,9 +1686,6 @@ impl<'a> Parser<'a> {
|
||||||
pub fn parse_mutability(&mut self) -> Mutability {
|
pub fn parse_mutability(&mut self) -> Mutability {
|
||||||
if self.eat_keyword(keywords::Mut) {
|
if self.eat_keyword(keywords::Mut) {
|
||||||
MutMutable
|
MutMutable
|
||||||
} else if self.eat_keyword(keywords::Const) {
|
|
||||||
self.obsolete(self.last_span, ObsoleteConstPointer);
|
|
||||||
MutImmutable
|
|
||||||
} else {
|
} else {
|
||||||
MutImmutable
|
MutImmutable
|
||||||
}
|
}
|
||||||
|
@ -2318,20 +2310,7 @@ impl<'a> Parser<'a> {
|
||||||
let e = self.parse_prefix_expr();
|
let e = self.parse_prefix_expr();
|
||||||
hi = e.span.hi;
|
hi = e.span.hi;
|
||||||
// HACK: pretending @[] is a (removed) @-vec
|
// HACK: pretending @[] is a (removed) @-vec
|
||||||
ex = match e.node {
|
ex = self.mk_unary(UnBox, e);
|
||||||
ExprVec(..) |
|
|
||||||
ExprRepeat(..) => {
|
|
||||||
self.obsolete(e.span, ObsoleteManagedVec);
|
|
||||||
// the above error means that no-one will know we're
|
|
||||||
// lying... hopefully.
|
|
||||||
ExprVstore(e, ExprVstoreUniq)
|
|
||||||
}
|
|
||||||
ExprLit(lit) if lit_is_str(lit) => {
|
|
||||||
self.obsolete(self.last_span, ObsoleteManagedString);
|
|
||||||
ExprVstore(e, ExprVstoreUniq)
|
|
||||||
}
|
|
||||||
_ => self.mk_unary(UnBox, e)
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
token::TILDE => {
|
token::TILDE => {
|
||||||
self.bump();
|
self.bump();
|
||||||
|
@ -2469,13 +2448,6 @@ impl<'a> Parser<'a> {
|
||||||
let assign_op = self.mk_assign_op(aop, lhs, rhs);
|
let assign_op = self.mk_assign_op(aop, lhs, rhs);
|
||||||
self.mk_expr(lo, rhs.span.hi, assign_op)
|
self.mk_expr(lo, rhs.span.hi, assign_op)
|
||||||
}
|
}
|
||||||
token::DARROW => {
|
|
||||||
self.obsolete(self.span, ObsoleteSwap);
|
|
||||||
self.bump();
|
|
||||||
// Ignore what we get, this is an error anyway
|
|
||||||
self.parse_expr();
|
|
||||||
self.mk_expr(lo, self.span.hi, ExprBreak(None))
|
|
||||||
}
|
|
||||||
_ => {
|
_ => {
|
||||||
lhs
|
lhs
|
||||||
}
|
}
|
||||||
|
@ -2586,37 +2558,10 @@ impl<'a> Parser<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn parse_loop_expr(&mut self, opt_ident: Option<ast::Ident>) -> @Expr {
|
pub fn parse_loop_expr(&mut self, opt_ident: Option<ast::Ident>) -> @Expr {
|
||||||
// loop headers look like 'loop {' or 'loop unsafe {'
|
let lo = self.last_span.lo;
|
||||||
let is_loop_header =
|
let body = self.parse_block();
|
||||||
self.token == token::LBRACE
|
let hi = body.span.hi;
|
||||||
|| (is_ident(&self.token)
|
self.mk_expr(lo, hi, ExprLoop(body, opt_ident))
|
||||||
&& self.look_ahead(1, |t| *t == token::LBRACE));
|
|
||||||
|
|
||||||
if is_loop_header {
|
|
||||||
// This is a loop body
|
|
||||||
let lo = self.last_span.lo;
|
|
||||||
let body = self.parse_block();
|
|
||||||
let hi = body.span.hi;
|
|
||||||
return self.mk_expr(lo, hi, ExprLoop(body, opt_ident));
|
|
||||||
} else {
|
|
||||||
// This is an obsolete 'continue' expression
|
|
||||||
if opt_ident.is_some() {
|
|
||||||
self.span_err(self.last_span,
|
|
||||||
"a label may not be used with a `loop` expression");
|
|
||||||
}
|
|
||||||
|
|
||||||
self.obsolete(self.last_span, ObsoleteLoopAsContinue);
|
|
||||||
let lo = self.span.lo;
|
|
||||||
let ex = if Parser::token_is_lifetime(&self.token) {
|
|
||||||
let lifetime = self.get_lifetime();
|
|
||||||
self.bump();
|
|
||||||
ExprAgain(Some(lifetime))
|
|
||||||
} else {
|
|
||||||
ExprAgain(None)
|
|
||||||
};
|
|
||||||
let hi = self.span.hi;
|
|
||||||
return self.mk_expr(lo, hi, ex);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// For distingishing between struct literals and blocks
|
// For distingishing between struct literals and blocks
|
||||||
|
@ -2730,14 +2675,6 @@ impl<'a> Parser<'a> {
|
||||||
} else {
|
} else {
|
||||||
let subpat = self.parse_pat();
|
let subpat = self.parse_pat();
|
||||||
match *subpat {
|
match *subpat {
|
||||||
ast::Pat { id, node: PatWild, span } => {
|
|
||||||
self.obsolete(self.span, ObsoleteVecDotDotWildcard);
|
|
||||||
slice = Some(@ast::Pat {
|
|
||||||
id: id,
|
|
||||||
node: PatWildMulti,
|
|
||||||
span: span
|
|
||||||
})
|
|
||||||
},
|
|
||||||
ast::Pat { node: PatIdent(_, _, _), .. } => {
|
ast::Pat { node: PatIdent(_, _, _), .. } => {
|
||||||
slice = Some(subpat);
|
slice = Some(subpat);
|
||||||
}
|
}
|
||||||
|
@ -2773,11 +2710,7 @@ impl<'a> Parser<'a> {
|
||||||
if self.token == token::RBRACE { break }
|
if self.token == token::RBRACE { break }
|
||||||
}
|
}
|
||||||
|
|
||||||
etc = self.token == token::UNDERSCORE || self.token == token::DOTDOT;
|
if self.token == token::DOTDOT {
|
||||||
if self.token == token::UNDERSCORE {
|
|
||||||
self.obsolete(self.span, ObsoleteStructWildcard);
|
|
||||||
}
|
|
||||||
if etc {
|
|
||||||
self.bump();
|
self.bump();
|
||||||
if self.token != token::RBRACE {
|
if self.token != token::RBRACE {
|
||||||
let token_str = self.this_token_to_str();
|
let token_str = self.this_token_to_str();
|
||||||
|
@ -2843,18 +2776,6 @@ impl<'a> Parser<'a> {
|
||||||
span: mk_sp(lo, hi)
|
span: mk_sp(lo, hi)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// parse @pat
|
|
||||||
token::AT => {
|
|
||||||
self.bump();
|
|
||||||
let sub = self.parse_pat();
|
|
||||||
self.obsolete(self.span, ObsoleteManagedPattern);
|
|
||||||
let hi = self.last_span.hi;
|
|
||||||
return @ast::Pat {
|
|
||||||
id: ast::DUMMY_NODE_ID,
|
|
||||||
node: PatUniq(sub),
|
|
||||||
span: mk_sp(lo, hi)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
token::TILDE => {
|
token::TILDE => {
|
||||||
// parse ~pat
|
// parse ~pat
|
||||||
self.bump();
|
self.bump();
|
||||||
|
@ -3011,24 +2932,15 @@ impl<'a> Parser<'a> {
|
||||||
let mut args: Vec<@Pat> = Vec::new();
|
let mut args: Vec<@Pat> = Vec::new();
|
||||||
match self.token {
|
match self.token {
|
||||||
token::LPAREN => {
|
token::LPAREN => {
|
||||||
let is_star = self.look_ahead(1, |t| {
|
|
||||||
match *t {
|
|
||||||
token::BINOP(token::STAR) => true,
|
|
||||||
_ => false,
|
|
||||||
}
|
|
||||||
});
|
|
||||||
let is_dotdot = self.look_ahead(1, |t| {
|
let is_dotdot = self.look_ahead(1, |t| {
|
||||||
match *t {
|
match *t {
|
||||||
token::DOTDOT => true,
|
token::DOTDOT => true,
|
||||||
_ => false,
|
_ => false,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if is_star | is_dotdot {
|
if is_dotdot {
|
||||||
// This is a "top constructor only" pat
|
// This is a "top constructor only" pat
|
||||||
self.bump();
|
self.bump();
|
||||||
if is_star {
|
|
||||||
self.obsolete(self.span, ObsoleteEnumWildcard);
|
|
||||||
}
|
|
||||||
self.bump();
|
self.bump();
|
||||||
self.expect(&token::RPAREN);
|
self.expect(&token::RPAREN);
|
||||||
pat = PatEnum(enum_path, None);
|
pat = PatEnum(enum_path, None);
|
||||||
|
@ -3125,10 +3037,6 @@ impl<'a> Parser<'a> {
|
||||||
fn parse_let(&mut self) -> @Decl {
|
fn parse_let(&mut self) -> @Decl {
|
||||||
let lo = self.span.lo;
|
let lo = self.span.lo;
|
||||||
let local = self.parse_local();
|
let local = self.parse_local();
|
||||||
while self.eat(&token::COMMA) {
|
|
||||||
let _ = self.parse_local();
|
|
||||||
self.obsolete(self.span, ObsoleteMultipleLocalDecl);
|
|
||||||
}
|
|
||||||
return @spanned(lo, self.last_span.hi, DeclLocal(local));
|
return @spanned(lo, self.last_span.hi, DeclLocal(local));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3276,9 +3184,6 @@ impl<'a> Parser<'a> {
|
||||||
maybe_whole!(no_clone self, NtBlock);
|
maybe_whole!(no_clone self, NtBlock);
|
||||||
|
|
||||||
let lo = self.span.lo;
|
let lo = self.span.lo;
|
||||||
if self.eat_keyword(keywords::Unsafe) {
|
|
||||||
self.obsolete(self.span, ObsoleteUnsafeBlock);
|
|
||||||
}
|
|
||||||
self.expect(&token::LBRACE);
|
self.expect(&token::LBRACE);
|
||||||
|
|
||||||
return self.parse_block_tail_(lo, DefaultBlock, Vec::new());
|
return self.parse_block_tail_(lo, DefaultBlock, Vec::new());
|
||||||
|
@ -3291,9 +3196,6 @@ impl<'a> Parser<'a> {
|
||||||
maybe_whole!(pair_empty self, NtBlock);
|
maybe_whole!(pair_empty self, NtBlock);
|
||||||
|
|
||||||
let lo = self.span.lo;
|
let lo = self.span.lo;
|
||||||
if self.eat_keyword(keywords::Unsafe) {
|
|
||||||
self.obsolete(self.span, ObsoleteUnsafeBlock);
|
|
||||||
}
|
|
||||||
self.expect(&token::LBRACE);
|
self.expect(&token::LBRACE);
|
||||||
let (inner, next) = self.parse_inner_attrs_and_next();
|
let (inner, next) = self.parse_inner_attrs_and_next();
|
||||||
|
|
||||||
|
@ -4338,12 +4240,7 @@ impl<'a> Parser<'a> {
|
||||||
fn parse_item_foreign_fn(&mut self, vis: ast::Visibility,
|
fn parse_item_foreign_fn(&mut self, vis: ast::Visibility,
|
||||||
attrs: Vec<Attribute> ) -> @ForeignItem {
|
attrs: Vec<Attribute> ) -> @ForeignItem {
|
||||||
let lo = self.span.lo;
|
let lo = self.span.lo;
|
||||||
|
self.expect_keyword(keywords::Fn);
|
||||||
// Parse obsolete purity.
|
|
||||||
let fn_style = self.parse_fn_style();
|
|
||||||
if fn_style != NormalFn {
|
|
||||||
self.obsolete(self.last_span, ObsoleteUnsafeExternFn);
|
|
||||||
}
|
|
||||||
|
|
||||||
let (ident, generics) = self.parse_fn_header();
|
let (ident, generics) = self.parse_fn_header();
|
||||||
let decl = self.parse_fn_decl(true);
|
let decl = self.parse_fn_decl(true);
|
||||||
|
@ -4924,7 +4821,7 @@ impl<'a> Parser<'a> {
|
||||||
|
|
||||||
// parse, e.g., "use a::b::{z,y}"
|
// parse, e.g., "use a::b::{z,y}"
|
||||||
fn parse_use(&mut self) -> ViewItem_ {
|
fn parse_use(&mut self) -> ViewItem_ {
|
||||||
return ViewItemUse(self.parse_view_paths());
|
return ViewItemUse(self.parse_view_path());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -5055,17 +4952,6 @@ impl<'a> Parser<'a> {
|
||||||
ViewPathSimple(last, path, ast::DUMMY_NODE_ID));
|
ViewPathSimple(last, path, ast::DUMMY_NODE_ID));
|
||||||
}
|
}
|
||||||
|
|
||||||
// matches view_paths = view_path | view_path , view_paths
|
|
||||||
fn parse_view_paths(&mut self) -> @ViewPath {
|
|
||||||
let vp = self.parse_view_path();
|
|
||||||
while self.token == token::COMMA {
|
|
||||||
self.bump();
|
|
||||||
self.obsolete(self.last_span, ObsoleteMultipleImport);
|
|
||||||
let _ = self.parse_view_path();
|
|
||||||
}
|
|
||||||
return vp;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Parses a sequence of items. Stops when it finds program
|
// Parses a sequence of items. Stops when it finds program
|
||||||
// text that can't be parsed as an item
|
// text that can't be parsed as an item
|
||||||
// - mod_items uses extern_mod_allowed = true
|
// - mod_items uses extern_mod_allowed = true
|
||||||
|
|
|
@ -67,7 +67,6 @@ pub enum Token {
|
||||||
MOD_SEP,
|
MOD_SEP,
|
||||||
RARROW,
|
RARROW,
|
||||||
LARROW,
|
LARROW,
|
||||||
DARROW,
|
|
||||||
FAT_ARROW,
|
FAT_ARROW,
|
||||||
LPAREN,
|
LPAREN,
|
||||||
RPAREN,
|
RPAREN,
|
||||||
|
@ -183,7 +182,6 @@ pub fn to_str(t: &Token) -> StrBuf {
|
||||||
MOD_SEP => "::".to_strbuf(),
|
MOD_SEP => "::".to_strbuf(),
|
||||||
RARROW => "->".to_strbuf(),
|
RARROW => "->".to_strbuf(),
|
||||||
LARROW => "<-".to_strbuf(),
|
LARROW => "<-".to_strbuf(),
|
||||||
DARROW => "<->".to_strbuf(),
|
|
||||||
FAT_ARROW => "=>".to_strbuf(),
|
FAT_ARROW => "=>".to_strbuf(),
|
||||||
LPAREN => "(".to_strbuf(),
|
LPAREN => "(".to_strbuf(),
|
||||||
RPAREN => ")".to_strbuf(),
|
RPAREN => ")".to_strbuf(),
|
||||||
|
@ -449,45 +447,45 @@ declare_special_idents_and_keywords! {
|
||||||
'strict:
|
'strict:
|
||||||
(9, As, "as");
|
(9, As, "as");
|
||||||
(10, Break, "break");
|
(10, Break, "break");
|
||||||
(11, Const, "const");
|
(11, Crate, "crate");
|
||||||
(12, Crate, "crate");
|
(12, Else, "else");
|
||||||
(13, Else, "else");
|
(13, Enum, "enum");
|
||||||
(14, Enum, "enum");
|
(14, Extern, "extern");
|
||||||
(15, Extern, "extern");
|
(15, False, "false");
|
||||||
(16, False, "false");
|
(16, Fn, "fn");
|
||||||
(17, Fn, "fn");
|
(17, For, "for");
|
||||||
(18, For, "for");
|
(18, If, "if");
|
||||||
(19, If, "if");
|
(19, Impl, "impl");
|
||||||
(20, Impl, "impl");
|
(20, In, "in");
|
||||||
(21, In, "in");
|
(21, Let, "let");
|
||||||
(22, Let, "let");
|
(22, Loop, "loop");
|
||||||
(23, Loop, "loop");
|
(23, Match, "match");
|
||||||
(24, Match, "match");
|
(24, Mod, "mod");
|
||||||
(25, Mod, "mod");
|
(25, Mut, "mut");
|
||||||
(26, Mut, "mut");
|
(26, Once, "once");
|
||||||
(27, Once, "once");
|
(27, Pub, "pub");
|
||||||
(28, Pub, "pub");
|
(28, Ref, "ref");
|
||||||
(29, Ref, "ref");
|
(29, Return, "return");
|
||||||
(30, Return, "return");
|
|
||||||
// Static and Self are also special idents (prefill de-dupes)
|
// Static and Self are also special idents (prefill de-dupes)
|
||||||
(super::STATIC_KEYWORD_NAME, Static, "static");
|
(super::STATIC_KEYWORD_NAME, Static, "static");
|
||||||
(super::SELF_KEYWORD_NAME, Self, "self");
|
(super::SELF_KEYWORD_NAME, Self, "self");
|
||||||
(31, Struct, "struct");
|
(30, Struct, "struct");
|
||||||
(32, Super, "super");
|
(31, Super, "super");
|
||||||
(33, True, "true");
|
(32, True, "true");
|
||||||
(34, Trait, "trait");
|
(33, Trait, "trait");
|
||||||
(35, Type, "type");
|
(34, Type, "type");
|
||||||
(36, Unsafe, "unsafe");
|
(35, Unsafe, "unsafe");
|
||||||
(37, Use, "use");
|
(36, Use, "use");
|
||||||
(38, Virtual, "virtual");
|
(37, Virtual, "virtual");
|
||||||
(39, While, "while");
|
(38, While, "while");
|
||||||
(40, Continue, "continue");
|
(39, Continue, "continue");
|
||||||
(41, Proc, "proc");
|
(40, Proc, "proc");
|
||||||
(42, Box, "box");
|
(41, Box, "box");
|
||||||
|
|
||||||
'reserved:
|
'reserved:
|
||||||
(43, Alignof, "alignof");
|
(42, Alignof, "alignof");
|
||||||
(44, Be, "be");
|
(43, Be, "be");
|
||||||
|
(44, Const, "const");
|
||||||
(45, Offsetof, "offsetof");
|
(45, Offsetof, "offsetof");
|
||||||
(46, Priv, "priv");
|
(46, Priv, "priv");
|
||||||
(47, Pure, "pure");
|
(47, Pure, "pure");
|
||||||
|
|
|
@ -52,7 +52,7 @@ impl Noise2DContext {
|
||||||
for (i, x) in permutations.mut_iter().enumerate() {
|
for (i, x) in permutations.mut_iter().enumerate() {
|
||||||
*x = i as i32;
|
*x = i as i32;
|
||||||
}
|
}
|
||||||
rng.shuffle_mut(permutations);
|
rng.shuffle(permutations);
|
||||||
|
|
||||||
Noise2DContext { rgradients: rgradients, permutations: permutations }
|
Noise2DContext { rgradients: rgradients, permutations: permutations }
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
|
|
||||||
// file at the top-level directory of this distribution and at
|
|
||||||
// http://rust-lang.org/COPYRIGHT.
|
|
||||||
//
|
|
||||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
||||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
||||||
// option. This file may not be copied, modified, or distributed
|
|
||||||
// except according to those terms.
|
|
||||||
|
|
||||||
fn main() {
|
|
||||||
loop {
|
|
||||||
loop //~ ERROR: `loop` instead of `continue`
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
|
|
||||||
// file at the top-level directory of this distribution and at
|
|
||||||
// http://rust-lang.org/COPYRIGHT.
|
|
||||||
//
|
|
||||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
||||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
||||||
// option. This file may not be copied, modified, or distributed
|
|
||||||
// except according to those terms.
|
|
||||||
|
|
||||||
trait A {
|
|
||||||
pub fn foo(); //~ ERROR: visibility not necessary
|
|
||||||
pub fn bar(); //~ ERROR: visibility not necessary
|
|
||||||
}
|
|
||||||
|
|
||||||
fn main() { }
|
|
|
@ -9,6 +9,8 @@
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
pub trait E {
|
pub trait E {
|
||||||
pub fn foo(); //~ ERROR: obsolete syntax
|
pub fn foo(); //~ ERROR: unnecessary visibility
|
||||||
}
|
}
|
||||||
trait F { pub fn foo(); } //~ ERROR: obsolete syntax
|
trait F { pub fn foo(); } //~ ERROR: unnecessary visibility
|
||||||
|
|
||||||
|
fn main() {}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue