From 774588fd9def900a467ba2b4ec3620f89832a799 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Sun, 4 Jan 2015 21:39:02 -0500 Subject: sed -i -s 's/ for Sized?//g' **/*.rs --- src/libcore/borrow.rs | 6 +++--- src/libcore/cmp.rs | 8 ++++---- src/libcore/fmt/mod.rs | 16 ++++++++-------- src/libcore/hash/mod.rs | 2 +- src/libcore/kinds.rs | 8 ++++---- src/libcore/ops.rs | 20 ++++++++++---------- src/libcore/raw.rs | 2 +- src/libcore/slice.rs | 8 ++++---- src/libcore/str/mod.rs | 4 ++-- 9 files changed, 37 insertions(+), 37 deletions(-) (limited to 'src/libcore') diff --git a/src/libcore/borrow.rs b/src/libcore/borrow.rs index 7e4d73d598d..6695cae6a1c 100644 --- a/src/libcore/borrow.rs +++ b/src/libcore/borrow.rs @@ -53,13 +53,13 @@ use option::Option; use self::Cow::*; /// A trait for borrowing data. -pub trait BorrowFrom for Sized? { +pub trait BorrowFrom { /// Immutably borrow from an owned value. fn borrow_from(owned: &Owned) -> &Self; } /// A trait for mutably borrowing data. -pub trait BorrowFromMut for Sized? : BorrowFrom { +pub trait BorrowFromMut : BorrowFrom { /// Mutably borrow from an owned value. fn borrow_from_mut(owned: &mut Owned) -> &mut Self; } @@ -103,7 +103,7 @@ impl<'a, T, Sized? B> IntoCow<'a, T, B> for Cow<'a, T, B> where B: ToOwned { } /// A generalization of Clone to borrowed data. -pub trait ToOwned for Sized?: BorrowFrom { +pub trait ToOwned: BorrowFrom { /// Create owned data from borrowed data, usually by copying. fn to_owned(&self) -> Owned; } diff --git a/src/libcore/cmp.rs b/src/libcore/cmp.rs index 13f9f5ccee9..c4ed0a75a4e 100644 --- a/src/libcore/cmp.rs +++ b/src/libcore/cmp.rs @@ -69,7 +69,7 @@ use option::Option::{self, Some, None}; /// only if `a != b`. #[lang="eq"] #[stable] -pub trait PartialEq for Sized? { +pub trait PartialEq { /// This method tests for `self` and `other` values to be equal, and is used by `==`. #[stable] fn eq(&self, other: &Rhs) -> bool; @@ -90,7 +90,7 @@ pub trait PartialEq for Sized? { /// - symmetric: `a == b` implies `b == a`; and /// - transitive: `a == b` and `b == c` implies `a == c`. #[stable] -pub trait Eq for Sized?: PartialEq { +pub trait Eq: PartialEq { // FIXME #13101: this method is used solely by #[deriving] to // assert that every component of a type implements #[deriving] // itself, the current deriving infrastructure means doing this @@ -164,7 +164,7 @@ impl Ordering { /// - transitive, `a < b` and `b < c` implies `a < c`. The same must hold for /// both `==` and `>`. #[stable] -pub trait Ord for Sized?: Eq + PartialOrd { +pub trait Ord: Eq + PartialOrd { /// This method returns an ordering between `self` and `other` values. /// /// By convention, `self.cmp(&other)` returns the ordering matching @@ -224,7 +224,7 @@ impl PartialOrd for Ordering { /// 5.11). #[lang="ord"] #[stable] -pub trait PartialOrd for Sized?: PartialEq { +pub trait PartialOrd: PartialEq { /// This method returns an ordering between `self` and `other` values /// if one exists. #[stable] diff --git a/src/libcore/fmt/mod.rs b/src/libcore/fmt/mod.rs index 102836f8d30..bde2fb75252 100644 --- a/src/libcore/fmt/mod.rs +++ b/src/libcore/fmt/mod.rs @@ -222,7 +222,7 @@ impl<'a> Show for Arguments<'a> { /// to this trait. There is not an explicit way of selecting this trait to be /// used for formatting, it is only if no other format is specified. #[unstable = "I/O and core have yet to be reconciled"] -pub trait Show for Sized? { +pub trait Show { /// Formats the value using the given formatter. fn fmt(&self, &mut Formatter) -> Result; } @@ -230,49 +230,49 @@ pub trait Show for Sized? { /// Format trait for the `o` character #[unstable = "I/O and core have yet to be reconciled"] -pub trait Octal for Sized? { +pub trait Octal { /// Formats the value using the given formatter. fn fmt(&self, &mut Formatter) -> Result; } /// Format trait for the `b` character #[unstable = "I/O and core have yet to be reconciled"] -pub trait Binary for Sized? { +pub trait Binary { /// Formats the value using the given formatter. fn fmt(&self, &mut Formatter) -> Result; } /// Format trait for the `x` character #[unstable = "I/O and core have yet to be reconciled"] -pub trait LowerHex for Sized? { +pub trait LowerHex { /// Formats the value using the given formatter. fn fmt(&self, &mut Formatter) -> Result; } /// Format trait for the `X` character #[unstable = "I/O and core have yet to be reconciled"] -pub trait UpperHex for Sized? { +pub trait UpperHex { /// Formats the value using the given formatter. fn fmt(&self, &mut Formatter) -> Result; } /// Format trait for the `p` character #[unstable = "I/O and core have yet to be reconciled"] -pub trait Pointer for Sized? { +pub trait Pointer { /// Formats the value using the given formatter. fn fmt(&self, &mut Formatter) -> Result; } /// Format trait for the `e` character #[unstable = "I/O and core have yet to be reconciled"] -pub trait LowerExp for Sized? { +pub trait LowerExp { /// Formats the value using the given formatter. fn fmt(&self, &mut Formatter) -> Result; } /// Format trait for the `E` character #[unstable = "I/O and core have yet to be reconciled"] -pub trait UpperExp for Sized? { +pub trait UpperExp { /// Formats the value using the given formatter. fn fmt(&self, &mut Formatter) -> Result; } diff --git a/src/libcore/hash/mod.rs b/src/libcore/hash/mod.rs index b0a5ec9fe12..d929e12a073 100644 --- a/src/libcore/hash/mod.rs +++ b/src/libcore/hash/mod.rs @@ -76,7 +76,7 @@ pub mod sip; /// A hashable type. The `S` type parameter is an abstract hash state that is /// used by the `Hash` to compute the hash. It defaults to /// `std::hash::sip::SipState`. -pub trait Hash for Sized? { +pub trait Hash { /// Computes the hash of a value. fn hash(&self, state: &mut S); } diff --git a/src/libcore/kinds.rs b/src/libcore/kinds.rs index e50aaef5f09..4769c783e58 100644 --- a/src/libcore/kinds.rs +++ b/src/libcore/kinds.rs @@ -19,19 +19,19 @@ /// Types able to be transferred across task boundaries. #[lang="send"] -pub unsafe trait Send for Sized? : 'static { +pub unsafe trait Send : 'static { // empty. } /// Types with a constant size known at compile-time. #[lang="sized"] -pub trait Sized for Sized? { +pub trait Sized { // Empty. } /// Types that can be copied by simply copying bits (i.e. `memcpy`). #[lang="copy"] -pub trait Copy for Sized? { +pub trait Copy { // Empty. } @@ -81,7 +81,7 @@ pub trait Copy for Sized? { /// reference; not doing this is undefined behaviour (for example, /// `transmute`-ing from `&T` to `&mut T` is illegal). #[lang="sync"] -pub unsafe trait Sync for Sized? { +pub unsafe trait Sync { // Empty } diff --git a/src/libcore/ops.rs b/src/libcore/ops.rs index c9b71092f90..ef9f7f25c6a 100644 --- a/src/libcore/ops.rs +++ b/src/libcore/ops.rs @@ -721,7 +721,7 @@ shr_impl! { uint u8 u16 u32 u64 int i8 i16 i32 i64 } #[cfg(stage0)] #[allow(missing_docs)] #[lang="index"] -pub trait Index for Sized? { +pub trait Index { /// The method for the indexing (`Foo[Bar]`) operation fn index<'a>(&'a self, index: &Index) -> &'a Result; } @@ -757,7 +757,7 @@ pub trait Index for Sized? { /// ``` #[cfg(not(stage0))] // NOTE(stage0) remove cfg after a snapshot #[lang="index"] -pub trait Index for Sized? { +pub trait Index { type Sized? Output; /// The method for the indexing (`Foo[Bar]`) operation @@ -768,7 +768,7 @@ pub trait Index for Sized? { #[cfg(stage0)] #[allow(missing_docs)] #[lang="index_mut"] -pub trait IndexMut for Sized? { +pub trait IndexMut { /// The method for the indexing (`Foo[Bar]`) operation fn index_mut<'a>(&'a mut self, index: &Index) -> &'a mut Result; } @@ -804,7 +804,7 @@ pub trait IndexMut for Sized? { /// ``` #[cfg(not(stage0))] // NOTE(stage0) remove cfg after a snapshot #[lang="index_mut"] -pub trait IndexMut for Sized? { +pub trait IndexMut { type Sized? Output; /// The method for the indexing (`Foo[Bar]`) operation @@ -849,7 +849,7 @@ pub trait IndexMut for Sized? { /// } /// ``` #[lang="slice"] -pub trait Slice for Sized? { +pub trait Slice { /// The method for the slicing operation foo[] fn as_slice_<'a>(&'a self) -> &'a Result; /// The method for the slicing operation foo[from..] @@ -898,7 +898,7 @@ pub trait Slice for Sized? { /// } /// ``` #[lang="slice_mut"] -pub trait SliceMut for Sized? { +pub trait SliceMut { /// The method for the slicing operation foo[] fn as_mut_slice_<'a>(&'a mut self) -> &'a mut Result; /// The method for the slicing operation foo[from..] @@ -1025,7 +1025,7 @@ pub struct RangeTo { /// } /// ``` #[lang="deref"] -pub trait Deref for Sized? { +pub trait Deref { type Sized? Target; /// The method called to dereference a value @@ -1082,7 +1082,7 @@ impl<'a, Sized? T> Deref for &'a mut T { /// } /// ``` #[lang="deref_mut"] -pub trait DerefMut for Sized? : Deref { +pub trait DerefMut : Deref { /// The method called to mutably dereference a value fn deref_mut<'a>(&'a mut self) -> &'a mut ::Target; } @@ -1093,14 +1093,14 @@ impl<'a, Sized? T> DerefMut for &'a mut T { /// A version of the call operator that takes an immutable receiver. #[lang="fn"] -pub trait Fn for Sized? { +pub trait Fn { /// This is called when the call operator is used. extern "rust-call" fn call(&self, args: Args) -> Result; } /// A version of the call operator that takes a mutable receiver. #[lang="fn_mut"] -pub trait FnMut for Sized? { +pub trait FnMut { /// This is called when the call operator is used. extern "rust-call" fn call_mut(&mut self, args: Args) -> Result; } diff --git a/src/libcore/raw.rs b/src/libcore/raw.rs index 3bef1d15363..0e91d6123f5 100644 --- a/src/libcore/raw.rs +++ b/src/libcore/raw.rs @@ -52,7 +52,7 @@ pub struct TraitObject { /// This trait is meant to map equivalences between raw structs and their /// corresponding rust values. -pub trait Repr for Sized? { +pub trait Repr { /// This function "unwraps" a rust value (without consuming it) into its raw /// struct representation. This can be used to read/write different values /// for the struct. This is a safe method because by default it does not diff --git a/src/libcore/slice.rs b/src/libcore/slice.rs index f17a775cf42..9aa3f76b525 100644 --- a/src/libcore/slice.rs +++ b/src/libcore/slice.rs @@ -64,7 +64,7 @@ use raw::Slice as RawSlice; /// Extension methods for slices. #[allow(missing_docs)] // docs in libcollections -pub trait SliceExt for Sized? { +pub trait SliceExt { type Item; fn slice<'a>(&'a self, start: uint, end: uint) -> &'a [Self::Item]; @@ -636,7 +636,7 @@ impl ops::SliceMut for [T] { /// Data that is viewable as a slice. #[experimental = "will be replaced by slice syntax"] -pub trait AsSlice for Sized? { +pub trait AsSlice { /// Work with `self` as a slice. fn as_slice<'a>(&'a self) -> &'a [T]; } @@ -1377,7 +1377,7 @@ pub mod bytes { use slice::SliceExt; /// A trait for operations on mutable `[u8]`s. - pub trait MutableByteVector for Sized? { + pub trait MutableByteVector { /// Sets all bytes of the receiver to the given value. fn set_memory(&mut self, value: u8); } @@ -1461,7 +1461,7 @@ impl PartialOrd for [T] { /// Extension methods for slices containing integers. #[experimental] -pub trait IntSliceExt for Sized? { +pub trait IntSliceExt { /// Converts the slice to an immutable slice of unsigned integers with the same width. fn as_unsigned<'a>(&'a self) -> &'a [U]; /// Converts the slice to an immutable slice of signed integers with the same width. diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs index d069744f8da..ccbc444963c 100644 --- a/src/libcore/str/mod.rs +++ b/src/libcore/str/mod.rs @@ -1130,7 +1130,7 @@ pub mod traits { #[unstable = "Instead of taking this bound generically, this trait will be \ replaced with one of slicing syntax, deref coercions, or \ a more generic conversion trait"] -pub trait Str for Sized? { +pub trait Str { /// Work with `self` as a slice. fn as_slice<'a>(&'a self) -> &'a str; } @@ -1171,7 +1171,7 @@ delegate_iter!{pattern forward &'a str in RSplitN<'a, P>} /// Methods for string slices #[allow(missing_docs)] -pub trait StrExt for Sized? { +pub trait StrExt { // NB there are no docs here are they're all located on the StrExt trait in // libcollections, not here. -- cgit 1.4.1-3-g733a5 From c26f5801f5bfca0840c7fc3e01e4c14f8437ef58 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Sun, 4 Jan 2015 21:47:03 -0500 Subject: remove unused `Sized` imports --- src/libcollections/str.rs | 1 - src/libcore/raw.rs | 1 - src/libcore/slice.rs | 1 - src/libstd/ascii.rs | 1 - 4 files changed, 4 deletions(-) (limited to 'src/libcore') diff --git a/src/libcollections/str.rs b/src/libcollections/str.rs index 0f33d21ef02..9ba1264f51e 100644 --- a/src/libcollections/str.rs +++ b/src/libcollections/str.rs @@ -59,7 +59,6 @@ use core::char::CharExt; use core::clone::Clone; use core::iter::AdditiveIterator; use core::iter::{range, Iterator, IteratorExt}; -use core::kinds::Sized; use core::ops; use core::option::Option::{self, Some, None}; use core::slice::AsSlice; diff --git a/src/libcore/raw.rs b/src/libcore/raw.rs index 0e91d6123f5..5ef6f6b2623 100644 --- a/src/libcore/raw.rs +++ b/src/libcore/raw.rs @@ -20,7 +20,6 @@ use kinds::Copy; use mem; -use kinds::Sized; /// The representation of a Rust slice #[repr(C)] diff --git a/src/libcore/slice.rs b/src/libcore/slice.rs index 9aa3f76b525..1fde906062e 100644 --- a/src/libcore/slice.rs +++ b/src/libcore/slice.rs @@ -1372,7 +1372,6 @@ pub unsafe fn from_raw_mut_buf<'a, T>(p: &'a *mut T, len: uint) -> &'a mut [T] { /// Operations on `[u8]`. #[experimental = "needs review"] pub mod bytes { - use kinds::Sized; use ptr; use slice::SliceExt; diff --git a/src/libstd/ascii.rs b/src/libstd/ascii.rs index c0b9bbbbc29..abd4c7faa5b 100644 --- a/src/libstd/ascii.rs +++ b/src/libstd/ascii.rs @@ -14,7 +14,6 @@ #![unstable = "unsure about placement and naming"] -use core::kinds::Sized; use iter::IteratorExt; use ops::FnMut; use slice::SliceExt; -- cgit 1.4.1-3-g733a5