Skip to content

Commit 3fa3557

Browse files
committed
rollup merge of rust-lang#20556: japaric/no-for-sized
Conflicts: src/libserialize/serialize.rs src/libstd/c_str.rs
2 parents c397f49 + 8abcbf9 commit 3fa3557

Some content is hidden

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

41 files changed

+75
-79
lines changed

src/libcollections/slice.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ pub use core::slice::{from_raw_buf, from_raw_mut_buf};
120120

121121
/// Allocating extension methods for slices.
122122
#[unstable = "needs associated types, may merge with other traits"]
123-
pub trait SliceExt for Sized? {
123+
pub trait SliceExt {
124124
type Item;
125125

126126
/// Sorts the slice, in place, using `compare` to compare
@@ -989,7 +989,7 @@ impl<T> SliceExt for [T] {
989989
////////////////////////////////////////////////////////////////////////////////
990990
#[unstable = "U should be an associated type"]
991991
/// An extension trait for concatenating slices
992-
pub trait SliceConcatExt<Sized? T, U> for Sized? {
992+
pub trait SliceConcatExt<Sized? T, U> {
993993
/// Flattens a slice of `T` into a single value `U`.
994994
#[stable]
995995
fn concat(&self) -> U;

src/libcollections/str.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ use core::char::Char;
5959
use core::clone::Clone;
6060
use core::iter::AdditiveIterator;
6161
use core::iter::{range, Iterator, IteratorExt};
62-
use core::kinds::Sized;
6362
use core::ops;
6463
use core::option::Option::{self, Some, None};
6564
use core::slice::AsSlice;
@@ -401,7 +400,7 @@ Section: Trait implementations
401400
*/
402401

403402
/// Any string that can be represented as a slice.
404-
pub trait StrExt for Sized?: ops::Slice<uint, str> {
403+
pub trait StrExt: ops::Slice<uint, str> {
405404
/// Escapes each char in `s` with `char::escape_default`.
406405
#[unstable = "return type may change to be an iterator"]
407406
fn escape_default(&self) -> String {

src/libcore/borrow.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ use option::Option;
5353
use self::Cow::*;
5454

5555
/// A trait for borrowing data.
56-
pub trait BorrowFrom<Sized? Owned> for Sized? {
56+
pub trait BorrowFrom<Sized? Owned> {
5757
/// Immutably borrow from an owned value.
5858
fn borrow_from(owned: &Owned) -> &Self;
5959
}
6060

6161
/// A trait for mutably borrowing data.
62-
pub trait BorrowFromMut<Sized? Owned> for Sized? : BorrowFrom<Owned> {
62+
pub trait BorrowFromMut<Sized? Owned> : BorrowFrom<Owned> {
6363
/// Mutably borrow from an owned value.
6464
fn borrow_from_mut(owned: &mut Owned) -> &mut Self;
6565
}
@@ -103,7 +103,7 @@ impl<'a, T, Sized? B> IntoCow<'a, T, B> for Cow<'a, T, B> where B: ToOwned<T> {
103103
}
104104

105105
/// A generalization of Clone to borrowed data.
106-
pub trait ToOwned<Owned> for Sized?: BorrowFrom<Owned> {
106+
pub trait ToOwned<Owned>: BorrowFrom<Owned> {
107107
/// Create owned data from borrowed data, usually by copying.
108108
fn to_owned(&self) -> Owned;
109109
}

src/libcore/cmp.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ use option::Option::{self, Some, None};
6969
/// only if `a != b`.
7070
#[lang="eq"]
7171
#[stable]
72-
pub trait PartialEq<Sized? Rhs = Self> for Sized? {
72+
pub trait PartialEq<Sized? Rhs = Self> {
7373
/// This method tests for `self` and `other` values to be equal, and is used by `==`.
7474
#[stable]
7575
fn eq(&self, other: &Rhs) -> bool;
@@ -90,7 +90,7 @@ pub trait PartialEq<Sized? Rhs = Self> for Sized? {
9090
/// - symmetric: `a == b` implies `b == a`; and
9191
/// - transitive: `a == b` and `b == c` implies `a == c`.
9292
#[stable]
93-
pub trait Eq for Sized?: PartialEq<Self> {
93+
pub trait Eq: PartialEq<Self> {
9494
// FIXME #13101: this method is used solely by #[deriving] to
9595
// assert that every component of a type implements #[deriving]
9696
// itself, the current deriving infrastructure means doing this
@@ -164,7 +164,7 @@ impl Ordering {
164164
/// - transitive, `a < b` and `b < c` implies `a < c`. The same must hold for
165165
/// both `==` and `>`.
166166
#[stable]
167-
pub trait Ord for Sized?: Eq + PartialOrd<Self> {
167+
pub trait Ord: Eq + PartialOrd<Self> {
168168
/// This method returns an ordering between `self` and `other` values.
169169
///
170170
/// By convention, `self.cmp(&other)` returns the ordering matching
@@ -224,7 +224,7 @@ impl PartialOrd for Ordering {
224224
/// 5.11).
225225
#[lang="ord"]
226226
#[stable]
227-
pub trait PartialOrd<Sized? Rhs = Self> for Sized?: PartialEq<Rhs> {
227+
pub trait PartialOrd<Sized? Rhs = Self>: PartialEq<Rhs> {
228228
/// This method returns an ordering between `self` and `other` values
229229
/// if one exists.
230230
#[stable]

src/libcore/fmt/mod.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -222,57 +222,57 @@ impl<'a> Show for Arguments<'a> {
222222
/// to this trait. There is not an explicit way of selecting this trait to be
223223
/// used for formatting, it is only if no other format is specified.
224224
#[unstable = "I/O and core have yet to be reconciled"]
225-
pub trait Show for Sized? {
225+
pub trait Show {
226226
/// Formats the value using the given formatter.
227227
fn fmt(&self, &mut Formatter) -> Result;
228228
}
229229

230230

231231
/// Format trait for the `o` character
232232
#[unstable = "I/O and core have yet to be reconciled"]
233-
pub trait Octal for Sized? {
233+
pub trait Octal {
234234
/// Formats the value using the given formatter.
235235
fn fmt(&self, &mut Formatter) -> Result;
236236
}
237237

238238
/// Format trait for the `b` character
239239
#[unstable = "I/O and core have yet to be reconciled"]
240-
pub trait Binary for Sized? {
240+
pub trait Binary {
241241
/// Formats the value using the given formatter.
242242
fn fmt(&self, &mut Formatter) -> Result;
243243
}
244244

245245
/// Format trait for the `x` character
246246
#[unstable = "I/O and core have yet to be reconciled"]
247-
pub trait LowerHex for Sized? {
247+
pub trait LowerHex {
248248
/// Formats the value using the given formatter.
249249
fn fmt(&self, &mut Formatter) -> Result;
250250
}
251251

252252
/// Format trait for the `X` character
253253
#[unstable = "I/O and core have yet to be reconciled"]
254-
pub trait UpperHex for Sized? {
254+
pub trait UpperHex {
255255
/// Formats the value using the given formatter.
256256
fn fmt(&self, &mut Formatter) -> Result;
257257
}
258258

259259
/// Format trait for the `p` character
260260
#[unstable = "I/O and core have yet to be reconciled"]
261-
pub trait Pointer for Sized? {
261+
pub trait Pointer {
262262
/// Formats the value using the given formatter.
263263
fn fmt(&self, &mut Formatter) -> Result;
264264
}
265265

266266
/// Format trait for the `e` character
267267
#[unstable = "I/O and core have yet to be reconciled"]
268-
pub trait LowerExp for Sized? {
268+
pub trait LowerExp {
269269
/// Formats the value using the given formatter.
270270
fn fmt(&self, &mut Formatter) -> Result;
271271
}
272272

273273
/// Format trait for the `E` character
274274
#[unstable = "I/O and core have yet to be reconciled"]
275-
pub trait UpperExp for Sized? {
275+
pub trait UpperExp {
276276
/// Formats the value using the given formatter.
277277
fn fmt(&self, &mut Formatter) -> Result;
278278
}

src/libcore/hash/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ pub mod sip;
7676
/// A hashable type. The `S` type parameter is an abstract hash state that is
7777
/// used by the `Hash` to compute the hash. It defaults to
7878
/// `std::hash::sip::SipState`.
79-
pub trait Hash<S = sip::SipState> for Sized? {
79+
pub trait Hash<S = sip::SipState> {
8080
/// Computes the hash of a value.
8181
fn hash(&self, state: &mut S);
8282
}

src/libcore/kinds.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@
1919
2020
/// Types able to be transferred across task boundaries.
2121
#[lang="send"]
22-
pub unsafe trait Send for Sized? : 'static {
22+
pub unsafe trait Send : 'static {
2323
// empty.
2424
}
2525

2626
/// Types with a constant size known at compile-time.
2727
#[lang="sized"]
28-
pub trait Sized for Sized? {
28+
pub trait Sized {
2929
// Empty.
3030
}
3131

3232
/// Types that can be copied by simply copying bits (i.e. `memcpy`).
3333
#[lang="copy"]
34-
pub trait Copy for Sized? {
34+
pub trait Copy {
3535
// Empty.
3636
}
3737

@@ -81,7 +81,7 @@ pub trait Copy for Sized? {
8181
/// reference; not doing this is undefined behaviour (for example,
8282
/// `transmute`-ing from `&T` to `&mut T` is illegal).
8383
#[lang="sync"]
84-
pub unsafe trait Sync for Sized? {
84+
pub unsafe trait Sync {
8585
// Empty
8686
}
8787

src/libcore/ops.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ shr_impl! { uint u8 u16 u32 u64 int i8 i16 i32 i64 }
721721
#[cfg(stage0)]
722722
#[allow(missing_docs)]
723723
#[lang="index"]
724-
pub trait Index<Sized? Index, Sized? Result> for Sized? {
724+
pub trait Index<Sized? Index, Sized? Result> {
725725
/// The method for the indexing (`Foo[Bar]`) operation
726726
fn index<'a>(&'a self, index: &Index) -> &'a Result;
727727
}
@@ -757,7 +757,7 @@ pub trait Index<Sized? Index, Sized? Result> for Sized? {
757757
/// ```
758758
#[cfg(not(stage0))] // NOTE(stage0) remove cfg after a snapshot
759759
#[lang="index"]
760-
pub trait Index<Sized? Index> for Sized? {
760+
pub trait Index<Sized? Index> {
761761
type Sized? Output;
762762

763763
/// The method for the indexing (`Foo[Bar]`) operation
@@ -768,7 +768,7 @@ pub trait Index<Sized? Index> for Sized? {
768768
#[cfg(stage0)]
769769
#[allow(missing_docs)]
770770
#[lang="index_mut"]
771-
pub trait IndexMut<Sized? Index, Sized? Result> for Sized? {
771+
pub trait IndexMut<Sized? Index, Sized? Result> {
772772
/// The method for the indexing (`Foo[Bar]`) operation
773773
fn index_mut<'a>(&'a mut self, index: &Index) -> &'a mut Result;
774774
}
@@ -804,7 +804,7 @@ pub trait IndexMut<Sized? Index, Sized? Result> for Sized? {
804804
/// ```
805805
#[cfg(not(stage0))] // NOTE(stage0) remove cfg after a snapshot
806806
#[lang="index_mut"]
807-
pub trait IndexMut<Sized? Index> for Sized? {
807+
pub trait IndexMut<Sized? Index> {
808808
type Sized? Output;
809809

810810
/// The method for the indexing (`Foo[Bar]`) operation
@@ -849,7 +849,7 @@ pub trait IndexMut<Sized? Index> for Sized? {
849849
/// }
850850
/// ```
851851
#[lang="slice"]
852-
pub trait Slice<Sized? Idx, Sized? Result> for Sized? {
852+
pub trait Slice<Sized? Idx, Sized? Result> {
853853
/// The method for the slicing operation foo[]
854854
fn as_slice_<'a>(&'a self) -> &'a Result;
855855
/// The method for the slicing operation foo[from..]
@@ -898,7 +898,7 @@ pub trait Slice<Sized? Idx, Sized? Result> for Sized? {
898898
/// }
899899
/// ```
900900
#[lang="slice_mut"]
901-
pub trait SliceMut<Sized? Idx, Sized? Result> for Sized? {
901+
pub trait SliceMut<Sized? Idx, Sized? Result> {
902902
/// The method for the slicing operation foo[]
903903
fn as_mut_slice_<'a>(&'a mut self) -> &'a mut Result;
904904
/// The method for the slicing operation foo[from..]
@@ -1025,7 +1025,7 @@ pub struct RangeTo<Idx> {
10251025
/// }
10261026
/// ```
10271027
#[lang="deref"]
1028-
pub trait Deref for Sized? {
1028+
pub trait Deref {
10291029
type Sized? Target;
10301030

10311031
/// The method called to dereference a value
@@ -1082,7 +1082,7 @@ impl<'a, Sized? T> Deref for &'a mut T {
10821082
/// }
10831083
/// ```
10841084
#[lang="deref_mut"]
1085-
pub trait DerefMut for Sized? : Deref {
1085+
pub trait DerefMut : Deref {
10861086
/// The method called to mutably dereference a value
10871087
fn deref_mut<'a>(&'a mut self) -> &'a mut <Self as Deref>::Target;
10881088
}
@@ -1093,14 +1093,14 @@ impl<'a, Sized? T> DerefMut for &'a mut T {
10931093

10941094
/// A version of the call operator that takes an immutable receiver.
10951095
#[lang="fn"]
1096-
pub trait Fn<Args,Result> for Sized? {
1096+
pub trait Fn<Args,Result> {
10971097
/// This is called when the call operator is used.
10981098
extern "rust-call" fn call(&self, args: Args) -> Result;
10991099
}
11001100

11011101
/// A version of the call operator that takes a mutable receiver.
11021102
#[lang="fn_mut"]
1103-
pub trait FnMut<Args,Result> for Sized? {
1103+
pub trait FnMut<Args,Result> {
11041104
/// This is called when the call operator is used.
11051105
extern "rust-call" fn call_mut(&mut self, args: Args) -> Result;
11061106
}

src/libcore/raw.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
2121
use kinds::Copy;
2222
use mem;
23-
use kinds::Sized;
2423

2524
/// The representation of a Rust slice
2625
#[repr(C)]
@@ -52,7 +51,7 @@ pub struct TraitObject {
5251

5352
/// This trait is meant to map equivalences between raw structs and their
5453
/// corresponding rust values.
55-
pub trait Repr<T> for Sized? {
54+
pub trait Repr<T> {
5655
/// This function "unwraps" a rust value (without consuming it) into its raw
5756
/// struct representation. This can be used to read/write different values
5857
/// for the struct. This is a safe method because by default it does not

src/libcore/slice.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ use raw::Slice as RawSlice;
6464

6565
/// Extension methods for slices.
6666
#[allow(missing_docs)] // docs in libcollections
67-
pub trait SliceExt for Sized? {
67+
pub trait SliceExt {
6868
type Item;
6969

7070
fn slice<'a>(&'a self, start: uint, end: uint) -> &'a [Self::Item];
@@ -636,7 +636,7 @@ impl<T> ops::SliceMut<uint, [T]> for [T] {
636636

637637
/// Data that is viewable as a slice.
638638
#[experimental = "will be replaced by slice syntax"]
639-
pub trait AsSlice<T> for Sized? {
639+
pub trait AsSlice<T> {
640640
/// Work with `self` as a slice.
641641
fn as_slice<'a>(&'a self) -> &'a [T];
642642
}
@@ -1372,12 +1372,11 @@ pub unsafe fn from_raw_mut_buf<'a, T>(p: &'a *mut T, len: uint) -> &'a mut [T] {
13721372
/// Operations on `[u8]`.
13731373
#[experimental = "needs review"]
13741374
pub mod bytes {
1375-
use kinds::Sized;
13761375
use ptr;
13771376
use slice::SliceExt;
13781377

13791378
/// A trait for operations on mutable `[u8]`s.
1380-
pub trait MutableByteVector for Sized? {
1379+
pub trait MutableByteVector {
13811380
/// Sets all bytes of the receiver to the given value.
13821381
fn set_memory(&mut self, value: u8);
13831382
}
@@ -1461,7 +1460,7 @@ impl<T: PartialOrd> PartialOrd for [T] {
14611460

14621461
/// Extension methods for slices containing integers.
14631462
#[experimental]
1464-
pub trait IntSliceExt<U, S> for Sized? {
1463+
pub trait IntSliceExt<U, S> {
14651464
/// Converts the slice to an immutable slice of unsigned integers with the same width.
14661465
fn as_unsigned<'a>(&'a self) -> &'a [U];
14671466
/// Converts the slice to an immutable slice of signed integers with the same width.

src/libcore/str/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,7 +1130,7 @@ pub mod traits {
11301130
#[unstable = "Instead of taking this bound generically, this trait will be \
11311131
replaced with one of slicing syntax, deref coercions, or \
11321132
a more generic conversion trait"]
1133-
pub trait Str for Sized? {
1133+
pub trait Str {
11341134
/// Work with `self` as a slice.
11351135
fn as_slice<'a>(&'a self) -> &'a str;
11361136
}
@@ -1171,7 +1171,7 @@ delegate_iter!{pattern forward &'a str in RSplitN<'a, P>}
11711171

11721172
/// Methods for string slices
11731173
#[allow(missing_docs)]
1174-
pub trait StrExt for Sized? {
1174+
pub trait StrExt {
11751175
// NB there are no docs here are they're all located on the StrExt trait in
11761176
// libcollections, not here.
11771177

src/librustc/middle/traits/util.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ impl<'cx, 'tcx> Elaborator<'cx, 'tcx> {
9292
// Only keep those bounds that we haven't already
9393
// seen. This is necessary to prevent infinite
9494
// recursion in some cases. One common case is when
95-
// people define `trait Sized { }` rather than `trait
96-
// Sized for Sized? { }`.
95+
// people define `trait Sized: Sized { }` rather than `trait
96+
// Sized { }`.
9797
predicates.retain(|r| self.visited.insert(r.clone()));
9898

9999
self.stack.push(StackEntry { position: 0,

src/librustc/util/ppaux.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ use syntax::{ast, ast_util};
3838
use syntax::owned_slice::OwnedSlice;
3939

4040
/// Produces a string suitable for debugging output.
41-
pub trait Repr<'tcx> for Sized? {
41+
pub trait Repr<'tcx> {
4242
fn repr(&self, tcx: &ctxt<'tcx>) -> String;
4343
}
4444

src/librustc_trans/trans/cabi_x86_64.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ impl RegClass {
6363
}
6464
}
6565

66-
trait ClassList for Sized? {
66+
trait ClassList {
6767
fn is_pass_byval(&self) -> bool;
6868
fn is_ret_bysret(&self) -> bool;
6969
}

0 commit comments

Comments
 (0)