]> git.lizzy.rs Git - rust.git/commitdiff
Fallout
authorNick Cameron <ncameron@mozilla.com>
Mon, 5 Jan 2015 21:16:49 +0000 (10:16 +1300)
committerNick Cameron <ncameron@mozilla.com>
Tue, 6 Jan 2015 01:20:48 +0000 (14:20 +1300)
64 files changed:
src/liballoc/boxed.rs
src/libcollections/btree/map.rs
src/libcollections/btree/node.rs
src/libcollections/btree/set.rs
src/libcollections/slice.rs
src/libcore/borrow.rs
src/libcore/clone.rs
src/libcore/cmp.rs
src/libcore/fmt/mod.rs
src/libcore/hash/mod.rs
src/libcore/hash/sip.rs
src/libcore/kinds.rs
src/libcore/mem.rs
src/libcore/ops.rs
src/libcore/slice.rs
src/libcore/str/mod.rs
src/libcoretest/hash/mod.rs
src/libgraphviz/maybe_owned_vec.rs
src/librustc/middle/intrinsicck.rs
src/librustc/util/nodemap.rs
src/librustc/util/ppaux.rs
src/libserialize/serialize.rs
src/libserialize/serialize_stage0.rs
src/libstd/c_str.rs
src/libstd/collections/hash/map.rs
src/libstd/collections/hash/set.rs
src/libstd/collections/hash/table.rs
src/libstd/hash.rs
src/libstd/io/mod.rs
src/libstd/path/mod.rs
src/libstd/path/posix.rs
src/libsyntax/parse/obsolete.rs
src/libsyntax/util/interner.rs
src/test/compile-fail/associated-types-unsized.rs
src/test/compile-fail/dst-bad-assign-2.rs
src/test/compile-fail/dst-bad-assign.rs
src/test/compile-fail/dst-bad-coerce1.rs
src/test/compile-fail/dst-bad-coerce2.rs
src/test/compile-fail/dst-bad-coerce3.rs
src/test/compile-fail/dst-bad-coerce4.rs
src/test/compile-fail/dst-bad-coercions.rs
src/test/compile-fail/dst-bad-deep.rs
src/test/compile-fail/dst-object-from-unsized-type.rs
src/test/compile-fail/transmute-fat-pointers.rs
src/test/compile-fail/transmute-impl.rs
src/test/compile-fail/unboxed-closure-sugar-default.rs
src/test/compile-fail/unboxed-closure-sugar-equiv.rs
src/test/compile-fail/unboxed-closure-sugar-lifetime-elision.rs
src/test/compile-fail/unboxed-closure-sugar-region.rs
src/test/compile-fail/unsized-bare-typaram.rs
src/test/compile-fail/unsized-enum.rs
src/test/compile-fail/unsized-inherent-impl-self-type.rs
src/test/compile-fail/unsized-struct.rs
src/test/compile-fail/unsized-trait-impl-self-type.rs
src/test/compile-fail/unsized-trait-impl-trait-arg.rs
src/test/compile-fail/unsized3.rs
src/test/compile-fail/unsized4.rs
src/test/compile-fail/unsized5.rs
src/test/compile-fail/unsized6.rs
src/test/compile-fail/unsized7.rs
src/test/run-pass-valgrind/dst-dtor-1.rs
src/test/run-pass-valgrind/dst-dtor-2.rs
src/test/run-pass/associated-types-conditional-dispatch.rs
src/test/run-pass/issue-18906.rs

index 2c318181b099521fc88e0f9f54c15da0dbc12b77..a574367ccf45f434ef17fa7c98cec29b6582bdea 100644 (file)
@@ -75,14 +75,14 @@ fn clone_from(&mut self, source: &Box<T>) {
 }
 
 #[stable]
-impl<Sized? T: PartialEq> PartialEq for Box<T> {
+impl<T: ?Sized + PartialEq> PartialEq for Box<T> {
     #[inline]
     fn eq(&self, other: &Box<T>) -> bool { PartialEq::eq(&**self, &**other) }
     #[inline]
     fn ne(&self, other: &Box<T>) -> bool { PartialEq::ne(&**self, &**other) }
 }
 #[stable]
-impl<Sized? T: PartialOrd> PartialOrd for Box<T> {
+impl<T: ?Sized + PartialOrd> PartialOrd for Box<T> {
     #[inline]
     fn partial_cmp(&self, other: &Box<T>) -> Option<Ordering> {
         PartialOrd::partial_cmp(&**self, &**other)
@@ -97,16 +97,16 @@ fn ge(&self, other: &Box<T>) -> bool { PartialOrd::ge(&**self, &**other) }
     fn gt(&self, other: &Box<T>) -> bool { PartialOrd::gt(&**self, &**other) }
 }
 #[stable]
-impl<Sized? T: Ord> Ord for Box<T> {
+impl<T: ?Sized + Ord> Ord for Box<T> {
     #[inline]
     fn cmp(&self, other: &Box<T>) -> Ordering {
         Ord::cmp(&**self, &**other)
     }
 
 #[stable]}
-impl<Sized? T: Eq> Eq for Box<T> {}
+impl<T: ?Sized + Eq> Eq for Box<T> {}
 
-impl<S: hash::Writer, Sized? T: Hash<S>> Hash<S> for Box<T> {
+impl<S: hash::Writer, T: ?Sized + Hash<S>> Hash<S> for Box<T> {
     #[inline]
     fn hash(&self, state: &mut S) {
         (**self).hash(state);
@@ -143,7 +143,7 @@ fn downcast<T: 'static>(self) -> Result<Box<T>, Box<Any>> {
     }
 }
 
-impl<Sized? T: fmt::Show> fmt::Show for Box<T> {
+impl<T: ?Sized + fmt::Show> fmt::Show for Box<T> {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         (**self).fmt(f)
     }
@@ -155,13 +155,13 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
     }
 }
 
-impl<Sized? T> Deref for Box<T> {
+impl<T: ?Sized> Deref for Box<T> {
     type Target = T;
 
     fn deref(&self) -> &T { &**self }
 }
 
-impl<Sized? T> DerefMut for Box<T> {
+impl<T: ?Sized> DerefMut for Box<T> {
     fn deref_mut(&mut self) -> &mut T { &mut **self }
 }
 
index a9e09a584d6877d8b86c4126941f97242cd27cb5..43b3f3421403dd92905aa7e6a4942311407107e0 100644 (file)
@@ -130,7 +130,7 @@ pub struct Values<'a, K: 'a, V: 'a> {
 
 #[stable]
 /// A view into a single entry in a map, which may either be vacant or occupied.
-pub enum Entry<'a, Sized? Q:'a, K:'a, V:'a> {
+pub enum Entry<'a, Q: ?Sized +'a, K:'a, V:'a> {
     /// A vacant Entry
     Vacant(VacantEntry<'a, Q, K, V>),
     /// An occupied Entry
@@ -139,7 +139,7 @@ pub enum Entry<'a, Sized? Q:'a, K:'a, V:'a> {
 
 #[stable]
 /// A vacant Entry.
-pub struct VacantEntry<'a, Sized? Q:'a, K:'a, V:'a> {
+pub struct VacantEntry<'a, Q: ?Sized +'a, K:'a, V:'a> {
     key: &'a Q,
     stack: stack::SearchStack<'a, K, V, node::handle::Edge, node::handle::Leaf>,
 }
@@ -214,7 +214,7 @@ pub fn clear(&mut self) {
     /// assert_eq!(map.get(&2), None);
     /// ```
     #[stable]
-    pub fn get<Sized? Q>(&self, key: &Q) -> Option<&V> where Q: BorrowFrom<K> + Ord {
+    pub fn get<Q: ?Sized>(&self, key: &Q) -> Option<&V> where Q: BorrowFrom<K> + Ord {
         let mut cur_node = &self.root;
         loop {
             match Node::search(cur_node, key) {
@@ -246,7 +246,7 @@ pub fn get<Sized? Q>(&self, key: &Q) -> Option<&V> where Q: BorrowFrom<K> + Ord
     /// assert_eq!(map.contains_key(&2), false);
     /// ```
     #[stable]
-    pub fn contains_key<Sized? Q>(&self, key: &Q) -> bool where Q: BorrowFrom<K> + Ord {
+    pub fn contains_key<Q: ?Sized>(&self, key: &Q) -> bool where Q: BorrowFrom<K> + Ord {
         self.get(key).is_some()
     }
 
@@ -270,7 +270,7 @@ pub fn contains_key<Sized? Q>(&self, key: &Q) -> bool where Q: BorrowFrom<K> + O
     /// ```
     // See `get` for implementation notes, this is basically a copy-paste with mut's added
     #[stable]
-    pub fn get_mut<Sized? Q>(&mut self, key: &Q) -> Option<&mut V> where Q: BorrowFrom<K> + Ord {
+    pub fn get_mut<Q: ?Sized>(&mut self, key: &Q) -> Option<&mut V> where Q: BorrowFrom<K> + Ord {
         // temp_node is a Borrowck hack for having a mutable value outlive a loop iteration
         let mut temp_node = &mut self.root;
         loop {
@@ -440,7 +440,7 @@ pub fn insert(&mut self, mut key: K, mut value: V) -> Option<V> {
     /// assert_eq!(map.remove(&1), None);
     /// ```
     #[stable]
-    pub fn remove<Sized? Q>(&mut self, key: &Q) -> Option<V> where Q: BorrowFrom<K> + Ord {
+    pub fn remove<Q: ?Sized>(&mut self, key: &Q) -> Option<V> where Q: BorrowFrom<K> + Ord {
         // See `swap` for a more thorough description of the stuff going on in here
         let mut stack = stack::PartialSearchStack::new(self);
         loop {
@@ -880,7 +880,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 // NOTE(stage0): remove impl after a snapshot
 #[cfg(stage0)]
 #[stable]
-impl<K: Ord, Sized? Q, V> Index<Q, V> for BTreeMap<K, V>
+impl<K: Ord, Q: ?Sized, V> Index<Q, V> for BTreeMap<K, V>
     where Q: BorrowFrom<K> + Ord
 {
     fn index(&self, key: &Q) -> &V {
@@ -890,7 +890,7 @@ fn index(&self, key: &Q) -> &V {
 
 #[cfg(not(stage0))]  // NOTE(stage0): remove cfg after a snapshot
 #[stable]
-impl<K: Ord, Sized? Q, V> Index<Q> for BTreeMap<K, V>
+impl<K: Ord, Q: ?Sized, V> Index<Q> for BTreeMap<K, V>
     where Q: BorrowFrom<K> + Ord
 {
     type Output = V;
@@ -903,7 +903,7 @@ fn index(&self, key: &Q) -> &V {
 // NOTE(stage0): remove impl after a snapshot
 #[cfg(stage0)]
 #[stable]
-impl<K: Ord, Sized? Q, V> IndexMut<Q, V> for BTreeMap<K, V>
+impl<K: Ord, Q: ?Sized, V> IndexMut<Q, V> for BTreeMap<K, V>
     where Q: BorrowFrom<K> + Ord
 {
     fn index_mut(&mut self, key: &Q) -> &mut V {
@@ -913,7 +913,7 @@ fn index_mut(&mut self, key: &Q) -> &mut V {
 
 #[cfg(not(stage0))]  // NOTE(stage0): remove cfg after a snapshot
 #[stable]
-impl<K: Ord, Sized? Q, V> IndexMut<Q> for BTreeMap<K, V>
+impl<K: Ord, Q: ?Sized, V> IndexMut<Q> for BTreeMap<K, V>
     where Q: BorrowFrom<K> + Ord
 {
     type Output = V;
@@ -1135,7 +1135,7 @@ fn next_back(&mut self) -> Option<(&'a V)> { self.inner.next_back() }
 #[stable]
 impl<'a, K, V> ExactSizeIterator for Values<'a, K, V> {}
 
-impl<'a, Sized? Q, K: Ord, V> Entry<'a, Q, K, V> {
+impl<'a, Q: ?Sized, K: Ord, V> Entry<'a, Q, K, V> {
     #[unstable = "matches collection reform v2 specification, waiting for dust to settle"]
     /// Returns a mutable reference to the entry if occupied, or the VacantEntry if vacant
     pub fn get(self) -> Result<&'a mut V, VacantEntry<'a, Q, K, V>> {
@@ -1146,7 +1146,7 @@ pub fn get(self) -> Result<&'a mut V, VacantEntry<'a, Q, K, V>> {
     }
 }
 
-impl<'a, Sized? Q: ToOwned<K>, K: Ord, V> VacantEntry<'a, Q, K, V> {
+impl<'a, Q: ?Sized + ToOwned<K>, K: Ord, V> VacantEntry<'a, Q, K, V> {
     #[stable]
     /// Sets the value of the entry with the VacantEntry's key,
     /// and returns a mutable reference to it.
@@ -1386,7 +1386,7 @@ impl<K: Ord, V> BTreeMap<K, V> {
     /// ```
     /// The key must have the same ordering before or after `.to_owned()` is called.
     #[stable]
-    pub fn entry<'a, Sized? Q>(&'a mut self, mut key: &'a Q) -> Entry<'a, Q, K, V>
+    pub fn entry<'a, Q: ?Sized>(&'a mut self, mut key: &'a Q) -> Entry<'a, Q, K, V>
         where Q: Ord + ToOwned<K>
     {
         // same basic logic of `swap` and `pop`, blended together
index 1f719da590b349b8e772e26d4ef924e9008d0759..0a93bbf89c9971dea74fe7c5fadc95e614f35f06 100644 (file)
@@ -517,7 +517,7 @@ impl<K: Ord, V> Node<K, V> {
     /// Searches for the given key in the node. If it finds an exact match,
     /// `Found` will be yielded with the matching index. If it doesn't find an exact match,
     /// `GoDown` will be yielded with the index of the subtree the key must lie in.
-    pub fn search<Sized? Q, NodeRef: Deref<Target=Node<K, V>>>(node: NodeRef, key: &Q)
+    pub fn search<Q: ?Sized, NodeRef: Deref<Target=Node<K, V>>>(node: NodeRef, key: &Q)
                   -> SearchResult<NodeRef> where Q: BorrowFrom<K> + Ord {
         // FIXME(Gankro): Tune when to search linear or binary based on B (and maybe K/V).
         // For the B configured as of this writing (B = 6), binary search was *significantly*
@@ -536,7 +536,7 @@ pub fn search<Sized? Q, NodeRef: Deref<Target=Node<K, V>>>(node: NodeRef, key: &
         }
     }
 
-    fn search_linear<Sized? Q>(&self, key: &Q) -> (bool, uint) where Q: BorrowFrom<K> + Ord {
+    fn search_linear<Q: ?Sized>(&self, key: &Q) -> (bool, uint) where Q: BorrowFrom<K> + Ord {
         for (i, k) in self.keys().iter().enumerate() {
             match key.cmp(BorrowFrom::borrow_from(k)) {
                 Greater => {},
index 0406edcdd32e7ac622bbb277544f63120df93e93..98f163321706041f81f7fb731f81726ba79b1303 100644 (file)
@@ -299,7 +299,7 @@ pub fn clear(&mut self) {
     /// assert_eq!(set.contains(&4), false);
     /// ```
     #[stable]
-    pub fn contains<Sized? Q>(&self, value: &Q) -> bool where Q: BorrowFrom<T> + Ord {
+    pub fn contains<Q: ?Sized>(&self, value: &Q) -> bool where Q: BorrowFrom<T> + Ord {
         self.map.contains_key(value)
     }
 
@@ -429,7 +429,7 @@ pub fn insert(&mut self, value: T) -> bool {
     /// assert_eq!(set.remove(&2), false);
     /// ```
     #[stable]
-    pub fn remove<Sized? Q>(&mut self, value: &Q) -> bool where Q: BorrowFrom<T> + Ord {
+    pub fn remove<Q: ?Sized>(&mut self, value: &Q) -> bool where Q: BorrowFrom<T> + Ord {
         self.map.remove(value).is_some()
     }
 }
index 3602bfc10c3079b5b67a5914a7074b9c465f8c48..efb73e7d7c8b57e4ddabe8fb7114d14631b16c71 100644 (file)
@@ -989,7 +989,7 @@ fn into_vec(mut self: Box<Self>) -> Vec<T> {
 ////////////////////////////////////////////////////////////////////////////////
 #[unstable = "U should be an associated type"]
 /// An extension trait for concatenating slices
-pub trait SliceConcatExt<Sized? T, U> for Sized? {
+pub trait SliceConcatExt<T: ?Sized, U> for Sized? {
     /// Flattens a slice of `T` into a single value `U`.
     #[stable]
     fn concat(&self) -> U;
index 7e4d73d598d8d8227bed2325082170b019a34f15..54621f59c2f4683114d67e62bdc410b70f71f869 100644 (file)
 use self::Cow::*;
 
 /// A trait for borrowing data.
-pub trait BorrowFrom<Sized? Owned> for Sized? {
+pub trait BorrowFrom<Owned: ?Sized> for Sized? {
     /// Immutably borrow from an owned value.
     fn borrow_from(owned: &Owned) -> &Self;
 }
 
 /// A trait for mutably borrowing data.
-pub trait BorrowFromMut<Sized? Owned> for Sized? : BorrowFrom<Owned> {
+pub trait BorrowFromMut<Owned: ?Sized> for Sized? : BorrowFrom<Owned> {
     /// Mutably borrow from an owned value.
     fn borrow_from_mut(owned: &mut Owned) -> &mut Self;
 }
 
-impl<Sized? T> BorrowFrom<T> for T {
+impl<T: ?Sized> BorrowFrom<T> for T {
     fn borrow_from(owned: &T) -> &T { owned }
 }
 
-impl<Sized? T> BorrowFromMut<T> for T {
+impl<T: ?Sized> BorrowFromMut<T> for T {
     fn borrow_from_mut(owned: &mut T) -> &mut T { owned }
 }
 
-impl<'a, Sized? T> BorrowFrom<&'a T> for T {
+impl<'a, T: ?Sized> BorrowFrom<&'a T> for T {
     fn borrow_from<'b>(owned: &'b &'a T) -> &'b T { &**owned }
 }
 
-impl<'a, Sized? T> BorrowFrom<&'a mut T> for T {
+impl<'a, T: ?Sized> BorrowFrom<&'a mut T> for T {
     fn borrow_from<'b>(owned: &'b &'a mut T) -> &'b T { &**owned }
 }
 
-impl<'a, Sized? T> BorrowFromMut<&'a mut T> for T {
+impl<'a, T: ?Sized> BorrowFromMut<&'a mut T> for T {
     fn borrow_from_mut<'b>(owned: &'b mut &'a mut T) -> &'b mut T { &mut **owned }
 }
 
-impl<'a, T, Sized? B> BorrowFrom<Cow<'a, T, B>> for B where B: ToOwned<T> {
+impl<'a, T, B: ?Sized> BorrowFrom<Cow<'a, T, B>> for B where B: ToOwned<T> {
     fn borrow_from<'b>(owned: &'b Cow<'a, T, B>) -> &'b B {
         &**owned
     }
 }
 
 /// Trait for moving into a `Cow`
-pub trait IntoCow<'a, T, Sized? B> {
+pub trait IntoCow<'a, T, B: ?Sized> {
     /// Moves `self` into `Cow`
     fn into_cow(self) -> Cow<'a, T, B>;
 }
 
-impl<'a, T, Sized? B> IntoCow<'a, T, B> for Cow<'a, T, B> where B: ToOwned<T> {
+impl<'a, T, B: ?Sized> IntoCow<'a, T, B> for Cow<'a, T, B> where B: ToOwned<T> {
     fn into_cow(self) -> Cow<'a, T, B> {
         self
     }
@@ -129,7 +129,7 @@ fn to_owned(&self) -> T { self.clone() }
 ///     }
 /// }
 /// ```
-pub enum Cow<'a, T, Sized? B: 'a> where B: ToOwned<T> {
+pub enum Cow<'a, T, B: ?Sized + 'a> where B: ToOwned<T> {
     /// Borrowed data.
     Borrowed(&'a B),
 
@@ -138,7 +138,7 @@ pub enum Cow<'a, T, Sized? B: 'a> where B: ToOwned<T> {
 }
 
 #[stable]
-impl<'a, T, Sized? B> Clone for Cow<'a, T, B> where B: ToOwned<T> {
+impl<'a, T, B: ?Sized> Clone for Cow<'a, T, B> where B: ToOwned<T> {
     fn clone(&self) -> Cow<'a, T, B> {
         match *self {
             Borrowed(b) => Borrowed(b),
@@ -150,7 +150,7 @@ fn clone(&self) -> Cow<'a, T, B> {
     }
 }
 
-impl<'a, T, Sized? B> Cow<'a, T, B> where B: ToOwned<T> {
+impl<'a, T, B: ?Sized> Cow<'a, T, B> where B: ToOwned<T> {
     /// Acquire a mutable reference to the owned form of the data.
     ///
     /// Copies the data if it is not already owned.
@@ -191,7 +191,7 @@ pub fn is_owned(&self) -> bool {
     }
 }
 
-impl<'a, T, Sized? B> Deref for Cow<'a, T, B> where B: ToOwned<T>  {
+impl<'a, T, B: ?Sized> Deref for Cow<'a, T, B> where B: ToOwned<T>  {
     type Target = B;
 
     fn deref(&self) -> &B {
@@ -203,10 +203,10 @@ fn deref(&self) -> &B {
 }
 
 #[stable]
-impl<'a, T, Sized? B> Eq for Cow<'a, T, B> where B: Eq + ToOwned<T> {}
+impl<'a, T, B: ?Sized> Eq for Cow<'a, T, B> where B: Eq + ToOwned<T> {}
 
 #[stable]
-impl<'a, T, Sized? B> Ord for Cow<'a, T, B> where B: Ord + ToOwned<T> {
+impl<'a, T, B: ?Sized> Ord for Cow<'a, T, B> where B: Ord + ToOwned<T> {
     #[inline]
     fn cmp(&self, other: &Cow<'a, T, B>) -> Ordering {
         Ord::cmp(&**self, &**other)
@@ -214,7 +214,7 @@ fn cmp(&self, other: &Cow<'a, T, B>) -> Ordering {
 }
 
 #[stable]
-impl<'a, 'b, T, U, Sized? B, Sized? C> PartialEq<Cow<'b, U, C>> for Cow<'a, T, B> where
+impl<'a, 'b, T, U, B: ?Sized, C: ?Sized> PartialEq<Cow<'b, U, C>> for Cow<'a, T, B> where
     B: PartialEq<C> + ToOwned<T>,
     C: ToOwned<U>,
 {
@@ -225,14 +225,14 @@ fn eq(&self, other: &Cow<'b, U, C>) -> bool {
 }
 
 #[stable]
-impl<'a, T, Sized? B> PartialOrd for Cow<'a, T, B> where B: PartialOrd + ToOwned<T> {
+impl<'a, T, B: ?Sized> PartialOrd for Cow<'a, T, B> where B: PartialOrd + ToOwned<T> {
     #[inline]
     fn partial_cmp(&self, other: &Cow<'a, T, B>) -> Option<Ordering> {
         PartialOrd::partial_cmp(&**self, &**other)
     }
 }
 
-impl<'a, T, Sized? B> fmt::Show for Cow<'a, T, B> where B: fmt::Show + ToOwned<T>, T: fmt::Show {
+impl<'a, T, B: ?Sized> fmt::Show for Cow<'a, T, B> where B: fmt::Show + ToOwned<T>, T: fmt::Show {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         match *self {
             Borrowed(ref b) => fmt::Show::fmt(b, f),
index 159c2a505d51b89c1b06b062b4b7d6ab70e41872..17991659f97899c6027021eae8a8dceecccd54a6 100644 (file)
@@ -43,7 +43,7 @@ fn clone_from(&mut self, source: &Self) {
 }
 
 #[stable]
-impl<'a, Sized? T> Clone for &'a T {
+impl<'a, T: ?Sized> Clone for &'a T {
     /// Return a shallow copy of the reference.
     #[inline]
     fn clone(&self) -> &'a T { *self }
index 13f9f5ccee9161b180ca4904abeb2af2c92b02bf..933088f276528c01de4ac7ccfdbf2928fd504784 100644 (file)
@@ -69,7 +69,7 @@
 /// only if `a != b`.
 #[lang="eq"]
 #[stable]
-pub trait PartialEq<Sized? Rhs = Self> for Sized? {
+pub trait PartialEq<Rhs: ?Sized = Self> for Sized? {
     /// This method tests for `self` and `other` values to be equal, and is used by `==`.
     #[stable]
     fn eq(&self, other: &Rhs) -> bool;
@@ -224,7 +224,7 @@ fn partial_cmp(&self, other: &Ordering) -> Option<Ordering> {
 /// 5.11).
 #[lang="ord"]
 #[stable]
-pub trait PartialOrd<Sized? Rhs = Self> for Sized?: PartialEq<Rhs> {
+pub trait PartialOrd<Rhs: ?Sized = Self> for Sized?: PartialEq<Rhs> {
     /// This method returns an ordering between `self` and `other` values
     /// if one exists.
     #[stable]
@@ -428,14 +428,14 @@ fn cmp(&self, other: &bool) -> Ordering {
     // & pointers
 
     #[stable]
-    impl<'a, 'b, Sized? A, Sized? B> PartialEq<&'b B> for &'a A where A: PartialEq<B> {
+    impl<'a, 'b, A: ?Sized, B: ?Sized> PartialEq<&'b B> for &'a A where A: PartialEq<B> {
         #[inline]
         fn eq(&self, other: & &'b B) -> bool { PartialEq::eq(*self, *other) }
         #[inline]
         fn ne(&self, other: & &'b B) -> bool { PartialEq::ne(*self, *other) }
     }
     #[stable]
-    impl<'a, 'b, Sized? A, Sized? B> PartialOrd<&'b B> for &'a A where A: PartialOrd<B> {
+    impl<'a, 'b, A: ?Sized, B: ?Sized> PartialOrd<&'b B> for &'a A where A: PartialOrd<B> {
         #[inline]
         fn partial_cmp(&self, other: &&'b B) -> Option<Ordering> {
             PartialOrd::partial_cmp(*self, *other)
@@ -450,24 +450,24 @@ fn ge(&self, other: & &'b B) -> bool { PartialOrd::ge(*self, *other) }
         fn gt(&self, other: & &'b B) -> bool { PartialOrd::gt(*self, *other) }
     }
     #[stable]
-    impl<'a, Sized? A> Ord for &'a A where A: Ord {
+    impl<'a, A: ?Sized> Ord for &'a A where A: Ord {
         #[inline]
         fn cmp(&self, other: & &'a A) -> Ordering { Ord::cmp(*self, *other) }
     }
     #[stable]
-    impl<'a, Sized? A> Eq for &'a A where A: Eq {}
+    impl<'a, A: ?Sized> Eq for &'a A where A: Eq {}
 
     // &mut pointers
 
     #[stable]
-    impl<'a, 'b, Sized? A, Sized? B> PartialEq<&'b mut B> for &'a mut A where A: PartialEq<B> {
+    impl<'a, 'b, A: ?Sized, B: ?Sized> PartialEq<&'b mut B> for &'a mut A where A: PartialEq<B> {
         #[inline]
         fn eq(&self, other: &&'b mut B) -> bool { PartialEq::eq(*self, *other) }
         #[inline]
         fn ne(&self, other: &&'b mut B) -> bool { PartialEq::ne(*self, *other) }
     }
     #[stable]
-    impl<'a, 'b, Sized? A, Sized? B> PartialOrd<&'b mut B> for &'a mut A where A: PartialOrd<B> {
+    impl<'a, 'b, A: ?Sized, B: ?Sized> PartialOrd<&'b mut B> for &'a mut A where A: PartialOrd<B> {
         #[inline]
         fn partial_cmp(&self, other: &&'b mut B) -> Option<Ordering> {
             PartialOrd::partial_cmp(*self, *other)
@@ -482,15 +482,15 @@ fn ge(&self, other: &&'b mut B) -> bool { PartialOrd::ge(*self, *other) }
         fn gt(&self, other: &&'b mut B) -> bool { PartialOrd::gt(*self, *other) }
     }
     #[stable]
-    impl<'a, Sized? A> Ord for &'a mut A where A: Ord {
+    impl<'a, A: ?Sized> Ord for &'a mut A where A: Ord {
         #[inline]
         fn cmp(&self, other: &&'a mut A) -> Ordering { Ord::cmp(*self, *other) }
     }
     #[stable]
-    impl<'a, Sized? A> Eq for &'a mut A where A: Eq {}
+    impl<'a, A: ?Sized> Eq for &'a mut A where A: Eq {}
 
     #[stable]
-    impl<'a, 'b, Sized? A, Sized? B> PartialEq<&'b mut B> for &'a A where A: PartialEq<B> {
+    impl<'a, 'b, A: ?Sized, B: ?Sized> PartialEq<&'b mut B> for &'a A where A: PartialEq<B> {
         #[inline]
         fn eq(&self, other: &&'b mut B) -> bool { PartialEq::eq(*self, *other) }
         #[inline]
@@ -498,7 +498,7 @@ fn ne(&self, other: &&'b mut B) -> bool { PartialEq::ne(*self, *other) }
     }
 
     #[stable]
-    impl<'a, 'b, Sized? A, Sized? B> PartialEq<&'b B> for &'a mut A where A: PartialEq<B> {
+    impl<'a, 'b, A: ?Sized, B: ?Sized> PartialEq<&'b B> for &'a mut A where A: PartialEq<B> {
         #[inline]
         fn eq(&self, other: &&'b B) -> bool { PartialEq::eq(*self, *other) }
         #[inline]
index 102836f8d3024831044766fe17c0ec2062f66af3..9e9e2b92bb7ad9d8ee88a737d1d15a9090447f6b 100644 (file)
@@ -78,9 +78,9 @@ fn write_fmt(&mut self, args: Arguments) -> Result {
         // This Adapter is needed to allow `self` (of type `&mut
         // Self`) to be cast to a FormatWriter (below) without
         // requiring a `Sized` bound.
-        struct Adapter<'a,Sized? T:'a>(&'a mut T);
+        struct Adapter<'a,T: ?Sized +'a>(&'a mut T);
 
-        impl<'a, Sized? T> Writer for Adapter<'a, T>
+        impl<'a, T: ?Sized> Writer for Adapter<'a, T>
             where T: Writer
         {
             fn write_str(&mut self, s: &str) -> Result {
@@ -592,10 +592,10 @@ pub fn argumentuint<'a>(s: &'a uint) -> Argument<'a> {
 
 // Implementations of the core formatting traits
 
-impl<'a, Sized? T: Show> Show for &'a T {
+impl<'a, T: ?Sized + Show> Show for &'a T {
     fn fmt(&self, f: &mut Formatter) -> Result { (**self).fmt(f) }
 }
-impl<'a, Sized? T: Show> Show for &'a mut T {
+impl<'a, T: ?Sized + Show> Show for &'a mut T {
     fn fmt(&self, f: &mut Formatter) -> Result { (**self).fmt(f) }
 }
 
index b0a5ec9fe12ed5caf7650cf5ac4eb0c1034d90b6..aaae5c2717c7b28a38c44ca5d14268ee34c1231d 100644 (file)
@@ -85,7 +85,7 @@ pub trait Hash<S = sip::SipState> for Sized? {
 /// containers like `HashMap`, which need a generic way hash multiple types.
 pub trait Hasher<S> {
     /// Compute the hash of a value.
-    fn hash<Sized? T: Hash<S>>(&self, value: &T) -> u64;
+    fn hash<T: ?Sized + Hash<S>>(&self, value: &T) -> u64;
 }
 
 #[allow(missing_docs)]
@@ -194,14 +194,14 @@ fn hash(&self, state: &mut S) {
 }
 
 
-impl<'a, S: Writer, Sized? T: Hash<S>> Hash<S> for &'a T {
+impl<'a, S: Writer, T: ?Sized + Hash<S>> Hash<S> for &'a T {
     #[inline]
     fn hash(&self, state: &mut S) {
         (**self).hash(state);
     }
 }
 
-impl<'a, S: Writer, Sized? T: Hash<S>> Hash<S> for &'a mut T {
+impl<'a, S: Writer, T: ?Sized + Hash<S>> Hash<S> for &'a mut T {
     #[inline]
     fn hash(&self, state: &mut S) {
         (**self).hash(state);
@@ -233,7 +233,7 @@ fn hash(&self, state: &mut S) {
     }
 }
 
-impl<'a, T, Sized? B, S> Hash<S> for Cow<'a, T, B> where B: Hash<S> + ToOwned<T> {
+impl<'a, T, B: ?Sized, S> Hash<S> for Cow<'a, T, B> where B: Hash<S> + ToOwned<T> {
     #[inline]
     fn hash(&self, state: &mut S) {
         Hash::hash(&**self, state)
index f9da0493f3edb0761629e65a3d32169aecae7b44..c4d45e9c2c80454802496457b1f8e3b17dc3762f 100644 (file)
@@ -239,7 +239,7 @@ pub fn new_with_keys(key0: u64, key1: u64) -> SipHasher {
 
 impl Hasher<SipState> for SipHasher {
     #[inline]
-    fn hash<Sized? T: Hash<SipState>>(&self, value: &T) -> u64 {
+    fn hash<T: ?Sized + Hash<SipState>>(&self, value: &T) -> u64 {
         let mut state = SipState::new_with_keys(self.k0, self.k1);
         value.hash(&mut state);
         state.result()
@@ -255,7 +255,7 @@ fn default() -> SipHasher {
 
 /// Hashes a value using the SipHash algorithm.
 #[inline]
-pub fn hash<Sized? T: Hash<SipState>>(value: &T) -> u64 {
+pub fn hash<T: ?Sized + Hash<SipState>>(value: &T) -> u64 {
     let mut state = SipState::new();
     value.hash(&mut state);
     state.result()
@@ -263,7 +263,7 @@ pub fn hash<Sized? T: Hash<SipState>>(value: &T) -> u64 {
 
 /// Hashes a value with the SipHash algorithm with the provided keys.
 #[inline]
-pub fn hash_with_keys<Sized? T: Hash<SipState>>(k0: u64, k1: u64, value: &T) -> u64 {
+pub fn hash_with_keys<T: ?Sized + Hash<SipState>>(k0: u64, k1: u64, value: &T) -> u64 {
     let mut state = SipState::new_with_keys(k0, k1);
     value.hash(&mut state);
     state.result()
index e50aaef5f09f3de77ebfb3d0a10a39a84fecddfc..1911641034c945a1d026ea3290afe1c8a7d5edd8 100644 (file)
@@ -133,10 +133,10 @@ pub mod marker {
     /// for some lifetime `'a`, but not the other way around).
     #[lang="covariant_type"]
     #[derive(PartialEq, Eq, PartialOrd, Ord)]
-    pub struct CovariantType<Sized? T>;
+    pub struct CovariantType<T: ?Sized>;
 
-    impl<Sized? T> Copy for CovariantType<T> {}
-    impl<Sized? T> Clone for CovariantType<T> {
+    impl<T: ?Sized> Copy for CovariantType<T> {}
+    impl<T: ?Sized> Clone for CovariantType<T> {
         fn clone(&self) -> CovariantType<T> { *self }
     }
 
@@ -181,10 +181,10 @@ fn clone(&self) -> CovariantType<T> { *self }
     /// arguments of type `U`, hence such a conversion is safe.
     #[lang="contravariant_type"]
     #[derive(PartialEq, Eq, PartialOrd, Ord)]
-    pub struct ContravariantType<Sized? T>;
+    pub struct ContravariantType<T: ?Sized>;
 
-    impl<Sized? T> Copy for ContravariantType<T> {}
-    impl<Sized? T> Clone for ContravariantType<T> {
+    impl<T: ?Sized> Copy for ContravariantType<T> {}
+    impl<T: ?Sized> Clone for ContravariantType<T> {
         fn clone(&self) -> ContravariantType<T> { *self }
     }
 
@@ -211,10 +211,10 @@ fn clone(&self) -> ContravariantType<T> { *self }
     /// interior mutability.
     #[lang="invariant_type"]
     #[derive(PartialEq, Eq, PartialOrd, Ord)]
-    pub struct InvariantType<Sized? T>;
+    pub struct InvariantType<T: ?Sized>;
 
-    impl<Sized? T> Copy for InvariantType<T> {}
-    impl<Sized? T> Clone for InvariantType<T> {
+    impl<T: ?Sized> Copy for InvariantType<T> {}
+    impl<T: ?Sized> Clone for InvariantType<T> {
         fn clone(&self) -> InvariantType<T> { *self }
     }
 
index 2620928acc1acca5070786ac304568f20dbb194d..c60569161213f68949bed4524688bc4978982d93 100644 (file)
@@ -320,7 +320,7 @@ pub unsafe fn transmute_copy<T, U>(src: &T) -> U {
 #[inline]
 #[unstable = "this function may be removed in the future due to its \
               questionable utility"]
-pub unsafe fn copy_lifetime<'a, Sized? S, Sized? T: 'a>(_ptr: &'a S,
+pub unsafe fn copy_lifetime<'a, S: ?Sized, T: ?Sized + 'a>(_ptr: &'a S,
                                                         ptr: &T) -> &'a T {
     transmute(ptr)
 }
@@ -329,7 +329,7 @@ pub unsafe fn copy_lifetime<'a, Sized? S, Sized? T: 'a>(_ptr: &'a S,
 #[inline]
 #[unstable = "this function may be removed in the future due to its \
               questionable utility"]
-pub unsafe fn copy_mut_lifetime<'a, Sized? S, Sized? T: 'a>(_ptr: &'a mut S,
+pub unsafe fn copy_mut_lifetime<'a, S: ?Sized, T: ?Sized + 'a>(_ptr: &'a mut S,
                                                             ptr: &mut T)
                                                             -> &'a mut T {
     transmute(ptr)
index c9b71092f9072597a8fddb8ad52c943dc30864a1..d7f6d3bc153570a560812199cffd90d53e422c3a 100644 (file)
@@ -721,7 +721,7 @@ fn shr(self, other: uint) -> $t { self >> other }
 #[cfg(stage0)]
 #[allow(missing_docs)]
 #[lang="index"]
-pub trait Index<Sized? Index, Sized? Result> for Sized? {
+pub trait Index<Index: ?Sized, Result: ?Sized> for Sized? {
     /// The method for the indexing (`Foo[Bar]`) operation
     fn index<'a>(&'a self, index: &Index) -> &'a Result;
 }
@@ -757,8 +757,8 @@ pub trait Index<Sized? Index, Sized? Result> for Sized? {
 /// ```
 #[cfg(not(stage0))]  // NOTE(stage0) remove cfg after a snapshot
 #[lang="index"]
-pub trait Index<Sized? Index> for Sized? {
-    type Sized? Output;
+pub trait Index<Index: ?Sized> for Sized? {
+    type Output: ?Sized;
 
     /// The method for the indexing (`Foo[Bar]`) operation
     fn index<'a>(&'a self, index: &Index) -> &'a Self::Output;
@@ -768,7 +768,7 @@ pub trait Index<Sized? Index> for Sized? {
 #[cfg(stage0)]
 #[allow(missing_docs)]
 #[lang="index_mut"]
-pub trait IndexMut<Sized? Index, Sized? Result> for Sized? {
+pub trait IndexMut<Index: ?Sized, Result: ?Sized> for Sized? {
     /// The method for the indexing (`Foo[Bar]`) operation
     fn index_mut<'a>(&'a mut self, index: &Index) -> &'a mut Result;
 }
@@ -804,8 +804,8 @@ pub trait IndexMut<Sized? Index, Sized? Result> for Sized? {
 /// ```
 #[cfg(not(stage0))]  // NOTE(stage0) remove cfg after a snapshot
 #[lang="index_mut"]
-pub trait IndexMut<Sized? Index> for Sized? {
-    type Sized? Output;
+pub trait IndexMut<Index: ?Sized> for Sized? {
+    type Output: ?Sized;
 
     /// The method for the indexing (`Foo[Bar]`) operation
     fn index_mut<'a>(&'a mut self, index: &Index) -> &'a mut Self::Output;
@@ -849,7 +849,7 @@ pub trait IndexMut<Sized? Index> for Sized? {
 /// }
 /// ```
 #[lang="slice"]
-pub trait Slice<Sized? Idx, Sized? Result> for Sized? {
+pub trait Slice<Idx: ?Sized, Result: ?Sized> for Sized? {
     /// 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<Sized? Idx, Sized? Result> for Sized? {
 /// }
 /// ```
 #[lang="slice_mut"]
-pub trait SliceMut<Sized? Idx, Sized? Result> for Sized? {
+pub trait SliceMut<Idx: ?Sized, Result: ?Sized> for Sized? {
     /// 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..]
@@ -1026,19 +1026,19 @@ pub struct RangeTo<Idx> {
 /// ```
 #[lang="deref"]
 pub trait Deref for Sized? {
-    type Sized? Target;
+    type Target: ?Sized;
 
     /// The method called to dereference a value
     fn deref<'a>(&'a self) -> &'a Self::Target;
 }
 
-impl<'a, Sized? T> Deref for &'a T {
+impl<'a, T: ?Sized> Deref for &'a T {
     type Target = T;
 
     fn deref(&self) -> &T { *self }
 }
 
-impl<'a, Sized? T> Deref for &'a mut T {
+impl<'a, T: ?Sized> Deref for &'a mut T {
     type Target = T;
 
     fn deref(&self) -> &T { *self }
@@ -1087,7 +1087,7 @@ pub trait DerefMut for Sized? : Deref {
     fn deref_mut<'a>(&'a mut self) -> &'a mut <Self as Deref>::Target;
 }
 
-impl<'a, Sized? T> DerefMut for &'a mut T {
+impl<'a, T: ?Sized> DerefMut for &'a mut T {
     fn deref_mut(&mut self) -> &mut T { *self }
 }
 
@@ -1112,8 +1112,8 @@ pub trait FnOnce<Args,Result> {
     extern "rust-call" fn call_once(self, args: Args) -> Result;
 }
 
-impl<Sized? F,A,R> FnMut<A,R> for F
-    where F : Fn<A,R>
+impl<F: ?Sized, A, R> FnMut<A, R> for F
+    where F : Fn<A, R>
 {
     extern "rust-call" fn call_mut(&mut self, args: A) -> R {
         self.call(args)
index f17a775cf42407e2981e45b440793cf783c5a33c..de57136d593a4f288d2e170e957cc84191355db0 100644 (file)
@@ -648,13 +648,13 @@ fn as_slice<'a>(&'a self) -> &'a [T] { self }
 }
 
 #[experimental = "trait is experimental"]
-impl<'a, T, Sized? U: AsSlice<T>> AsSlice<T> for &'a U {
+impl<'a, T, U: ?Sized + AsSlice<T>> AsSlice<T> for &'a U {
     #[inline(always)]
     fn as_slice(&self) -> &[T] { AsSlice::as_slice(*self) }
 }
 
 #[experimental = "trait is experimental"]
-impl<'a, T, Sized? U: AsSlice<T>> AsSlice<T> for &'a mut U {
+impl<'a, T, U: ?Sized + AsSlice<T>> AsSlice<T> for &'a mut U {
     #[inline(always)]
     fn as_slice(&self) -> &[T] { AsSlice::as_slice(*self) }
 }
index d069744f8da54f109bba4c957240999bbbfa8258..74fac6b76783872dac9b2eacb76fddea69d71f5d 100644 (file)
@@ -1140,7 +1140,7 @@ impl Str for str {
     fn as_slice<'a>(&'a self) -> &'a str { self }
 }
 
-impl<'a, Sized? S> Str for &'a S where S: Str {
+impl<'a, S: ?Sized> Str for &'a S where S: Str {
     #[inline]
     fn as_slice(&self) -> &str { Str::as_slice(*self) }
 }
index 23f9be124dadb74f86c3ca5eee52eb2833e01a41..a4bafe754ffdd812c011fafbb03f6a02fb57494f 100644 (file)
@@ -16,7 +16,7 @@
 struct MyWriterHasher;
 
 impl Hasher<MyWriter> for MyWriterHasher {
-    fn hash<Sized? T: Hash<MyWriter>>(&self, value: &T) -> u64 {
+    fn hash<T: ?Sized + Hash<MyWriter>>(&self, value: &T) -> u64 {
         let mut state = MyWriter { hash: 0 };
         value.hash(&mut state);
         state.hash
index 04aa6d1649538019d2ba85b10824ff0641fa1cd4..567fe04c5afbc659df4ccb13f6b344b385bdb969 100644 (file)
@@ -25,7 +25,7 @@
 
 // Note 2: Once Dynamically Sized Types (DST) lands, it might be
 // reasonable to replace this with something like `enum MaybeOwned<'a,
-// Sized? U>{ Owned(Box<U>), Borrowed(&'a U) }`; and then `U` could be
+// U: ?Sized>{ Owned(Box<U>), Borrowed(&'a U) }`; and then `U` could be
 // instantiated with `[T]` or `str`, etc.  Of course, that would imply
 // removing the `Growable` variant, which relates to note 1 above.
 // Alternatively, we might add `MaybeOwned` for the general case but
index e3763689ef41a46f3995257b906979a4f2ef7ecd..a83416667abdc331eaf8534011977c4826e8fa00 100644 (file)
@@ -121,7 +121,7 @@ fn check_transmute(&self, span: Span, from: Ty<'tcx>, to: Ty<'tcx>, id: ast::Nod
         // However, it's not as simple as checking whether `T :
         // Sized`, because even if `T : Sized` does not hold, that
         // just means that `T` *may* not be sized.  After all, even a
-        // type parameter `Sized? T` could be bound to a sized
+        // type parameter `T: ?Sized` could be bound to a sized
         // type. (Issue #20116)
         //
         // To handle this, we first check for "interior" type
@@ -139,16 +139,16 @@ fn check_transmute(&self, span: Span, from: Ty<'tcx>, to: Ty<'tcx>, id: ast::Nod
         // exhaustively checking all possible combinations. Here are some examples:
         //
         // ```
-        // fn foo<T,U>() {
+        // fn foo<T, U>() {
         //     // T=int, U=int
         // }
         //
-        // fn bar<Sized? T,U>() {
+        // fn bar<T: ?Sized, U>() {
         //     // T=int, U=int
         //     // T=[int], U=int
         // }
         //
-        // fn baz<Sized? T, Sized?U>() {
+        // fn baz<T: ?Sized, U: ?Sized>() {
         //     // T=int, U=int
         //     // T=[int], U=int
         //     // T=int, U=[int]
index 0da01cd358953581a9d9172fd09ff35104cc64fe..ee224d1ec80fe0361a1b52506accf6e55c1f08a4 100644 (file)
@@ -75,7 +75,7 @@ pub fn new() -> super::DefIdSet {
 pub struct FnvState(u64);
 
 impl Hasher<FnvState> for FnvHasher {
-    fn hash<Sized? T: Hash<FnvState>>(&self, t: &T) -> u64 {
+    fn hash<T: ?Sized + Hash<FnvState>>(&self, t: &T) -> u64 {
         let mut state = FnvState(0xcbf29ce484222325);
         t.hash(&mut state);
         let FnvState(ret) = state;
index 9639af5ca1cd53ec49789ac81ed9f31d5fd64d6e..ffb7fd9e71b3c4059bffe9d5d0fb69c787d903de 100644 (file)
@@ -604,7 +604,7 @@ fn repr(&self, _tcx: &ctxt) -> String {
     }
 }
 
-impl<'a, 'tcx, Sized? T:Repr<'tcx>> Repr<'tcx> for &'a T {
+impl<'a, 'tcx, T: ?Sized +Repr<'tcx>> Repr<'tcx> for &'a T {
     fn repr(&self, tcx: &ctxt<'tcx>) -> String {
         Repr::repr(*self, tcx)
     }
index 0646ee1758fc0f6b19af44260ab55a5479d14132..c317b9674897c1f8507a0eb7f97b2032e8219c33 100644 (file)
@@ -396,13 +396,13 @@ fn decode<D: Decoder>(d: &mut D) -> Result<(), D::Error> {
     }
 }
 
-impl<'a, Sized? T: Encodable> Encodable for &'a T {
+impl<'a, T: ?Sized + Encodable> Encodable for &'a T {
     fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error> {
         (**self).encode(s)
     }
 }
 
-impl<Sized? T: Encodable> Encodable for Box<T> {
+impl<T: ?Sized + Encodable> Encodable for Box<T> {
     fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error> {
         (**self).encode(s)
     }
index 558f9e603e15989fd8ccbd1607761883ffe6d235..c4317b99dce06c085522b724d35013a47d99983a 100644 (file)
@@ -378,13 +378,13 @@ fn decode(d: &mut D) -> Result<(), E> {
     }
 }
 
-impl<'a, E, S: Encoder<E>, Sized? T: Encodable<S, E>> Encodable<S, E> for &'a T {
+impl<'a, E, S: Encoder<E>, T: ?Sized + Encodable<S, E>> Encodable<S, E> for &'a T {
     fn encode(&self, s: &mut S) -> Result<(), E> {
         (**self).encode(s)
     }
 }
 
-impl<E, S: Encoder<E>, Sized? T: Encodable<S, E>> Encodable<S, E> for Box<T> {
+impl<E, S: Encoder<E>, T: ?Sized + Encodable<S, E>> Encodable<S, E> for Box<T> {
     fn encode(&self, s: &mut S) -> Result<(), E> {
         (**self).encode(s)
     }
index 9c96a9cac78310d5c0d91a3253599b4ea08abd85..c8a59ce6bba4c069998b1b970966135b468d07b5 100644 (file)
@@ -430,7 +430,7 @@ unsafe fn with_c_str_unchecked<T, F>(&self, f: F) -> T where
     }
 }
 
-impl<'a, Sized? T: ToCStr> ToCStr for &'a T {
+impl<'a, T: ?Sized + ToCStr> ToCStr for &'a T {
     #[inline]
     fn to_c_str(&self) -> CString {
         (**self).to_c_str()
index a6532707f3e367d74237d5f673e9ae78806bd22e..300fc849ace284436299fc1a3b71fc13939b5fbb 100644 (file)
@@ -440,14 +440,14 @@ fn into_option(self) -> Option<FullBucket<K, V, M>> {
 }
 
 impl<K: Eq + Hash<S>, V, S, H: Hasher<S>> HashMap<K, V, H> {
-    fn make_hash<Sized? X: Hash<S>>(&self, x: &X) -> SafeHash {
+    fn make_hash<X: ?Sized + Hash<S>>(&self, x: &X) -> SafeHash {
         table::make_hash(&self.hasher, x)
     }
 
     /// Search for a key, yielding the index if it's found in the hashtable.
     /// If you already have the hash for the key lying around, use
     /// search_hashed.
-    fn search<'a, Sized? Q>(&'a self, q: &Q) -> Option<FullBucketImm<'a, K, V>>
+    fn search<'a, Q: ?Sized>(&'a self, q: &Q) -> Option<FullBucketImm<'a, K, V>>
         where Q: BorrowFrom<K> + Eq + Hash<S>
     {
         let hash = self.make_hash(q);
@@ -455,7 +455,7 @@ fn search<'a, Sized? Q>(&'a self, q: &Q) -> Option<FullBucketImm<'a, K, V>>
             .into_option()
     }
 
-    fn search_mut<'a, Sized? Q>(&'a mut self, q: &Q) -> Option<FullBucketMut<'a, K, V>>
+    fn search_mut<'a, Q: ?Sized>(&'a mut self, q: &Q) -> Option<FullBucketMut<'a, K, V>>
         where Q: BorrowFrom<K> + Eq + Hash<S>
     {
         let hash = self.make_hash(q);
@@ -923,7 +923,7 @@ fn last_two<A, B, C>((_, b, c): (A, B, C)) -> (B, C) { (b, c) }
     #[stable]
     /// Gets the given key's corresponding entry in the map for in-place manipulation.
     /// Regardless of whether or not `to_owned()` has been called, the key must hash the same way.
-    pub fn entry<'a, Sized? Q>(&'a mut self, key: &'a Q) -> Entry<'a, Q, K, V>
+    pub fn entry<'a, Q: ?Sized>(&'a mut self, key: &'a Q) -> Entry<'a, Q, K, V>
         where Q: Eq + Hash<S> + ToOwned<K>
     {
         // Gotta resize now.
@@ -1030,7 +1030,7 @@ pub fn clear(&mut self) {
     /// assert_eq!(map.get(&2), None);
     /// ```
     #[stable]
-    pub fn get<Sized? Q>(&self, k: &Q) -> Option<&V>
+    pub fn get<Q: ?Sized>(&self, k: &Q) -> Option<&V>
         where Q: Hash<S> + Eq + BorrowFrom<K>
     {
         self.search(k).map(|bucket| bucket.into_refs().1)
@@ -1053,7 +1053,7 @@ pub fn get<Sized? Q>(&self, k: &Q) -> Option<&V>
     /// assert_eq!(map.contains_key(&2), false);
     /// ```
     #[stable]
-    pub fn contains_key<Sized? Q>(&self, k: &Q) -> bool
+    pub fn contains_key<Q: ?Sized>(&self, k: &Q) -> bool
         where Q: Hash<S> + Eq + BorrowFrom<K>
     {
         self.search(k).is_some()
@@ -1079,7 +1079,7 @@ pub fn contains_key<Sized? Q>(&self, k: &Q) -> bool
     /// assert_eq!(map[1], "b");
     /// ```
     #[stable]
-    pub fn get_mut<Sized? Q>(&mut self, k: &Q) -> Option<&mut V>
+    pub fn get_mut<Q: ?Sized>(&mut self, k: &Q) -> Option<&mut V>
         where Q: Hash<S> + Eq + BorrowFrom<K>
     {
         self.search_mut(k).map(|bucket| bucket.into_mut_refs().1)
@@ -1131,7 +1131,7 @@ pub fn insert(&mut self, k: K, v: V) -> Option<V> {
     /// assert_eq!(map.remove(&1), None);
     /// ```
     #[stable]
-    pub fn remove<Sized? Q>(&mut self, k: &Q) -> Option<V>
+    pub fn remove<Q: ?Sized>(&mut self, k: &Q) -> Option<V>
         where Q: Hash<S> + Eq + BorrowFrom<K>
     {
         if self.table.size() == 0 {
@@ -1142,7 +1142,7 @@ pub fn remove<Sized? Q>(&mut self, k: &Q) -> Option<V>
     }
 }
 
-fn search_entry_hashed<'a, K, V, Sized? Q>(table: &'a mut RawTable<K,V>, hash: SafeHash, k: &'a Q)
+fn search_entry_hashed<'a, K, V, Q: ?Sized>(table: &'a mut RawTable<K,V>, hash: SafeHash, k: &'a Q)
         -> Entry<'a, Q, K, V>
     where Q: Eq + ToOwned<K>
 {
@@ -1229,7 +1229,7 @@ fn default() -> HashMap<K, V, H> {
 // NOTE(stage0): remove impl after a snapshot
 #[cfg(stage0)]
 #[stable]
-impl<K: Hash<S> + Eq, Sized? Q, V, S, H: Hasher<S>> Index<Q, V> for HashMap<K, V, H>
+impl<K: Hash<S> + Eq, Q: ?Sized, V, S, H: Hasher<S>> Index<Q, V> for HashMap<K, V, H>
     where Q: BorrowFrom<K> + Hash<S> + Eq
 {
     #[inline]
@@ -1240,7 +1240,7 @@ fn index<'a>(&'a self, index: &Q) -> &'a V {
 
 #[cfg(not(stage0))]  // NOTE(stage0): remove cfg after a snapshot
 #[stable]
-impl<K: Hash<S> + Eq, Sized? Q, V, S, H: Hasher<S>> Index<Q> for HashMap<K, V, H>
+impl<K: Hash<S> + Eq, Q: ?Sized, V, S, H: Hasher<S>> Index<Q> for HashMap<K, V, H>
     where Q: BorrowFrom<K> + Hash<S> + Eq
 {
     type Output = V;
@@ -1254,7 +1254,7 @@ fn index<'a>(&'a self, index: &Q) -> &'a V {
 // NOTE(stage0): remove impl after a snapshot
 #[cfg(stage0)]
 #[stable]
-impl<K: Hash<S> + Eq, Sized? Q, V, S, H: Hasher<S>> IndexMut<Q, V> for HashMap<K, V, H>
+impl<K: Hash<S> + Eq, Q: ?Sized, V, S, H: Hasher<S>> IndexMut<Q, V> for HashMap<K, V, H>
     where Q: BorrowFrom<K> + Hash<S> + Eq
 {
     #[inline]
@@ -1265,7 +1265,7 @@ fn index_mut<'a>(&'a mut self, index: &Q) -> &'a mut V {
 
 #[cfg(not(stage0))]  // NOTE(stage0): remove cfg after a snapshot
 #[stable]
-impl<K: Hash<S> + Eq, Sized? Q, V, S, H: Hasher<S>> IndexMut<Q> for HashMap<K, V, H>
+impl<K: Hash<S> + Eq, Q: ?Sized, V, S, H: Hasher<S>> IndexMut<Q> for HashMap<K, V, H>
     where Q: BorrowFrom<K> + Hash<S> + Eq
 {
     type Output = V;
@@ -1357,7 +1357,7 @@ pub struct OccupiedEntry<'a, K: 'a, V: 'a> {
 
 #[stable]
 /// A view into a single empty location in a HashMap
-pub struct VacantEntry<'a, Sized? Q: 'a, K: 'a, V: 'a> {
+pub struct VacantEntry<'a, Q: ?Sized + 'a, K: 'a, V: 'a> {
     hash: SafeHash,
     key: &'a Q,
     elem: VacantEntryState<K, V, &'a mut RawTable<K, V>>,
@@ -1365,7 +1365,7 @@ pub struct VacantEntry<'a, Sized? Q: 'a, K: 'a, V: 'a> {
 
 #[stable]
 /// A view into a single location in a map, which may be vacant or occupied
-pub enum Entry<'a, Sized? Q: 'a, K: 'a, V: 'a> {
+pub enum Entry<'a, Q: ?Sized + 'a, K: 'a, V: 'a> {
     /// An occupied Entry
     Occupied(OccupiedEntry<'a, K, V>),
     /// A vacant Entry
@@ -1435,7 +1435,7 @@ fn size_hint(&self) -> (uint, Option<uint>) {
     }
 }
 
-impl<'a, Sized? Q, K, V> Entry<'a, Q, K, V> {
+impl<'a, Q: ?Sized, K, V> Entry<'a, Q, K, V> {
     #[unstable = "matches collection reform v2 specification, waiting for dust to settle"]
     /// Returns a mutable reference to the entry if occupied, or the VacantEntry if vacant
     pub fn get(self) -> Result<&'a mut V, VacantEntry<'a, Q, K, V>> {
@@ -1481,7 +1481,7 @@ pub fn remove(self) -> V {
     }
 }
 
-impl<'a, Sized? Q: 'a + ToOwned<K>, K: 'a, V: 'a> VacantEntry<'a, Q, K, V> {
+impl<'a, Q: ?Sized + 'a + ToOwned<K>, K: 'a, V: 'a> VacantEntry<'a, Q, K, V> {
     #[stable]
     /// Sets the value of the entry with the VacantEntry's key,
     /// and returns a mutable reference to it
index b1824db93aad120faec507751c130125ad431919..f77eaa237c1ddece14d1968c8431cde74405b829 100644 (file)
@@ -451,7 +451,7 @@ pub fn clear(&mut self) { self.map.clear() }
     /// assert_eq!(set.contains(&4), false);
     /// ```
     #[stable]
-    pub fn contains<Sized? Q>(&self, value: &Q) -> bool
+    pub fn contains<Q: ?Sized>(&self, value: &Q) -> bool
         where Q: BorrowFrom<T> + Hash<S> + Eq
     {
         self.map.contains_key(value)
@@ -561,7 +561,7 @@ pub fn insert(&mut self, value: T) -> bool { self.map.insert(value, ()).is_none(
     /// assert_eq!(set.remove(&2), false);
     /// ```
     #[stable]
-    pub fn remove<Sized? Q>(&mut self, value: &Q) -> bool
+    pub fn remove<Q: ?Sized>(&mut self, value: &Q) -> bool
         where Q: BorrowFrom<T> + Hash<S> + Eq
     {
         self.map.remove(value).is_some()
index ab91beb4f9be1bb450e2bc192953178f33b90350..1eb4408eedc403d4d4fb0e273e9bd9d52ad88eeb 100644 (file)
@@ -138,7 +138,7 @@ pub fn inspect(&self) -> u64 { self.hash }
 /// We need to remove hashes of 0. That's reserved for empty buckets.
 /// This function wraps up `hash_keyed` to be the only way outside this
 /// module to generate a SafeHash.
-pub fn make_hash<Sized? T: Hash<S>, S, H: Hasher<S>>(hasher: &H, t: &T) -> SafeHash {
+pub fn make_hash<T: ?Sized + Hash<S>, S, H: Hasher<S>>(hasher: &H, t: &T) -> SafeHash {
     // We need to avoid 0u64 in order to prevent collisions with
     // EMPTY_HASH. We can maintain our precious uniform distribution
     // of initial indexes by unconditionally setting the MSB,
index cdd0e9bf76f86dfa91f1ca536d80810b2c10ff31..ac2b01e995e2c62b5b17cea4e589659149bff133 100644 (file)
@@ -90,7 +90,7 @@ pub fn new() -> RandomSipHasher {
 
 impl Hasher<sip::SipState> for RandomSipHasher {
     #[inline]
-    fn hash<Sized? T: Hash<sip::SipState>>(&self, value: &T) -> u64 {
+    fn hash<T: ?Sized + Hash<sip::SipState>>(&self, value: &T) -> u64 {
         self.hasher.hash(value)
     }
 }
index 3fa0b5645c5288fba7b0ccc61a802ac7b20e88d8..66416a21dd9a449e87fe9f5de7ffa31a5922ec3e 100644 (file)
@@ -1012,12 +1012,12 @@ fn flush(&mut self) -> IoResult<()> { Ok(()) }
     fn write_fmt(&mut self, fmt: fmt::Arguments) -> IoResult<()> {
         // Create a shim which translates a Writer to a fmt::Writer and saves
         // off I/O errors. instead of discarding them
-        struct Adaptor<'a, Sized? T:'a> {
+        struct Adaptor<'a, T: ?Sized +'a> {
             inner: &'a mut T,
             error: IoResult<()>,
         }
 
-        impl<'a, Sized? T: Writer> fmt::Writer for Adaptor<'a, T> {
+        impl<'a, T: ?Sized + Writer> fmt::Writer for Adaptor<'a, T> {
             fn write_str(&mut self, s: &str) -> fmt::Result {
                 match self.inner.write(s.as_bytes()) {
                     Ok(()) => Ok(()),
@@ -1597,11 +1597,11 @@ fn incoming<'r>(&'r mut self) -> IncomingConnections<'r, Self> {
 /// `Some`. The `Some` contains the `IoResult` representing whether the
 /// connection attempt was successful.  A successful connection will be wrapped
 /// in `Ok`. A failed connection is represented as an `Err`.
-pub struct IncomingConnections<'a, Sized? A:'a> {
+pub struct IncomingConnections<'a, A: ?Sized +'a> {
     inc: &'a mut A,
 }
 
-impl<'a, T, Sized? A: Acceptor<T>> Iterator for IncomingConnections<'a, A> {
+impl<'a, T, A: ?Sized + Acceptor<T>> Iterator for IncomingConnections<'a, A> {
     type Item = IoResult<T>;
 
     fn next(&mut self) -> Option<IoResult<T>> {
index bf9ffbffe7d508b1f26bd331875b71493222943c..4f37e8a978aa98a70be8aae759f9512512441e39 100644 (file)
@@ -896,7 +896,7 @@ fn container_as_bytes<'a>(&'a self) -> &'a [u8] {
     }
 }
 
-impl<'a, Sized? T: BytesContainer> BytesContainer for &'a T {
+impl<'a, T: ?Sized + BytesContainer> BytesContainer for &'a T {
     #[inline]
     fn container_as_bytes(&self) -> &[u8] {
         (**self).container_as_bytes()
index ae82e201cb8555793b4f33efd2366c98fecfad5e..777315b3ed66d73aeeb6bff6c91dc383cfebc120 100644 (file)
@@ -344,7 +344,7 @@ pub fn new_opt<T: BytesContainer>(path: T) -> Option<Path> {
 
     /// Returns a normalized byte vector representation of a path, by removing all empty
     /// components, and unnecessary . and .. components.
-    fn normalize<Sized? V: AsSlice<u8>>(v: &V) -> Vec<u8> {
+    fn normalize<V: ?Sized + AsSlice<u8>>(v: &V) -> Vec<u8> {
         // borrowck is being very picky
         let val = {
             let is_abs = !v.as_slice().is_empty() && v.as_slice()[0] == SEP_BYTE;
index d1b6034457d3ab60ccaa7456904569b96a9f397c..299cf7e941b4ed5199ce566717989753e52aa655 100644 (file)
@@ -95,7 +95,7 @@ fn obsolete(&mut self, sp: Span, kind: ObsoleteSyntax) {
                 "write `extern crate bar as foo` instead"
             ),
             ObsoleteSyntax::Sized => (
-                "`Sized? T` syntax for removing the `Sized` bound",
+                "`T: ?Sized` syntax for removing the `Sized` bound",
                 "write `T: ?Sized` instead"
             ),
         };
index 5f416a867e8bdb892e4b299f52ba6b9a03036dd0..85eea2d9daf27226f889f7c80b4c3643587fbd48 100644 (file)
@@ -77,7 +77,7 @@ pub fn len(&self) -> uint {
         (*vect).len()
     }
 
-    pub fn find<Sized? Q>(&self, val: &Q) -> Option<Name>
+    pub fn find<Q: ?Sized>(&self, val: &Q) -> Option<Name>
     where Q: BorrowFrom<T> + Eq + Hash {
         let map = self.map.borrow();
         match (*map).get(val) {
@@ -202,7 +202,7 @@ pub fn len(&self) -> uint {
         self.vect.borrow().len()
     }
 
-    pub fn find<Sized? Q>(&self, val: &Q) -> Option<Name>
+    pub fn find<Q: ?Sized>(&self, val: &Q) -> Option<Name>
     where Q: BorrowFrom<RcStr> + Eq + Hash {
         match (*self.map.borrow()).get(val) {
             Some(v) => Some(*v),
index 47ab09d279f62ab773d6bca5051af0ca9c80c307..2ab3ec1aeadd7bd309a2c40bc480c4c2f6a1e1e8 100644 (file)
@@ -11,7 +11,7 @@
 #![feature(associated_types)]
 
 trait Get {
-    type Sized? Value;
+    type Value: ?Sized;
     fn get(&self) -> <Self as Get>::Value;
 }
 
index fcc08cfcb168035d9204374a1a10324713af80ff..5e360b6ab9bad8fa2d4e40dd5fbdc022bc7ee17b 100644 (file)
@@ -10,7 +10,7 @@
 
 // Forbid assignment into a dynamically sized type.
 
-struct Fat<Sized? T> {
+struct Fat<T: ?Sized> {
     f1: int,
     f2: &'static str,
     ptr: T
index eb54f3f8e781fbcc38a7f3ec841e86d7cb3a16ab..cc709be99002ea2a35ca44d04f6c9823409a30fd 100644 (file)
@@ -10,7 +10,7 @@
 
 // Forbid assignment into a dynamically sized type.
 
-struct Fat<Sized? T> {
+struct Fat<T: ?Sized> {
     f1: int,
     f2: &'static str,
     ptr: T
index c77ae25e0cf519db4ff4c5a8fa95d9dd8b054228..75bd94331b11d591b431c31d1872106fd2d839b9 100644 (file)
@@ -10,7 +10,7 @@
 
 // Attempt to change the type as well as unsizing.
 
-struct Fat<Sized? T> {
+struct Fat<T: ?Sized> {
     ptr: T
 }
 
index 6eb650e97811786065d054b8e208b480126fbca5..54c625221ba7d0216270ca705c30179ec57b1450 100644 (file)
@@ -10,7 +10,7 @@
 
 // Attempt to change the mutability as well as unsizing.
 
-struct Fat<Sized? T> {
+struct Fat<T: ?Sized> {
     ptr: T
 }
 
index b0bd517637464891a47ab5826900c13b325b9057..192d43e32fd27523dc43d60fb41dbe53a2eb55d3 100644 (file)
@@ -10,7 +10,7 @@
 
 // Attempt to extend the lifetime as well as unsizing.
 
-struct Fat<Sized? T> {
+struct Fat<T: ?Sized> {
     ptr: T
 }
 
index 783a32d63028a9bb0492605e92b1938041c06c5c..53ce18c73a08845e011927466a983e99f822653e 100644 (file)
@@ -10,7 +10,7 @@
 
 // Attempt to coerce from unsized to sized.
 
-struct Fat<Sized? T> {
+struct Fat<T: ?Sized> {
     ptr: T
 }
 
index c3a814e3f44ff12b7f5b093461fee4f70b00c9a4..b30eada162b84707134573888de917956f8ca50c 100644 (file)
@@ -14,7 +14,7 @@
 trait T {}
 impl T for S {}
 
-struct Foo<Sized? T> {
+struct Foo<T: ?Sized> {
     f: T
 }
 
index 0833a74f1daf95f40033f642d8200e02b79ceefa..b169824cb3aca2e40a44473aca31a23bee64e319 100644 (file)
@@ -13,7 +13,7 @@
 // because it would require stack allocation of an unsized temporary (*g in the
 // test).
 
-struct Fat<Sized? T> {
+struct Fat<T: ?Sized> {
     ptr: T
 }
 
index 99c63c3c6e95e01c0b4f7e68f96997a670333864..c331b02c7ccdc112bc74c8b239232a67cdf2cadc 100644 (file)
 trait Foo for Sized? {}
 impl Foo for str {}
 
-fn test1<Sized? T: Foo>(t: &T) {
+fn test1<T: ?Sized + Foo>(t: &T) {
     let u: &Foo = t;
     //~^ ERROR `core::kinds::Sized` is not implemented for the type `T`
 }
 
-fn test2<Sized? T: Foo>(t: &T) {
+fn test2<T: ?Sized + Foo>(t: &T) {
     let v: &Foo = t as &Foo;
     //~^ ERROR `core::kinds::Sized` is not implemented for the type `T`
 }
index 5e81a4cec2284b915ad942b53294dfbc8ca9b0d2..31456853e1c0f1543207f7c0776e36861700fe91 100644 (file)
 
 use std::mem::transmute;
 
-fn a<T, Sized? U>(x: &[T]) -> &U {
+fn a<T, U: ?Sized>(x: &[T]) -> &U {
     unsafe { transmute(x) } //~ ERROR transmute called on types with potentially different sizes
 }
 
-fn b<Sized? T, Sized? U>(x: &T) -> &U {
+fn b<T: ?Sized, U: ?Sized>(x: &T) -> &U {
     unsafe { transmute(x) } //~ ERROR transmute called on types with potentially different sizes
 }
 
@@ -30,11 +30,11 @@ fn d<T, U>(x: &[T]) -> &[U] {
     unsafe { transmute(x) }
 }
 
-fn e<Sized? T, U>(x: &T) -> &U {
+fn e<T: ?Sized, U>(x: &T) -> &U {
     unsafe { transmute(x) } //~ ERROR transmute called on types with potentially different sizes
 }
 
-fn f<T, Sized? U>(x: &T) -> &U {
+fn f<T, U: ?Sized>(x: &T) -> &U {
     unsafe { transmute(x) } //~ ERROR transmute called on types with potentially different sizes
 }
 
index 8b5a8c679b245b6392883f23c1cda222c5038fa5..a68bba285df29b39741ca7db9a78a5c4771715e4 100644 (file)
 
 use std::mem::transmute;
 
-struct Foo<Sized? T> {
+struct Foo<T: ?Sized> {
     t: Box<T>
 }
 
-impl<Sized? T> Foo<T> {
+impl<T: ?Sized> Foo<T> {
     fn m(x: &T) -> &int where T : Sized {
         // OK here, because T : Sized is in scope.
         unsafe { transmute(x) }
index 06a934063927a8b06620e294d7f1fad034088d0a..81cfcf5cde9188b1f3a037e827febed63b14d3dc 100644 (file)
@@ -18,9 +18,9 @@ trait Foo<T,U,V=T> {
     fn dummy(&self, t: T, u: U, v: V);
 }
 
-trait Eq<Sized? X> for Sized? { }
-impl<Sized? X> Eq<X> for X { }
-fn eq<Sized? A,Sized? B>() where A : Eq<B> { }
+trait Eq<X: ?Sized> for Sized? { }
+impl<X: ?Sized> Eq<X> for X { }
+fn eq<A: ?Sized,B: ?Sized>() where A : Eq<B> { }
 
 fn test<'a,'b>() {
     // Parens are equivalent to omitting default in angle.
index 16d6b217872ae8b2403396115e7394a4ba0d2932..368cb189907fe98fe3bcf9cd6fcd6498029c4626 100644 (file)
@@ -20,9 +20,9 @@ trait Foo<T,U> {
     fn dummy(&self, t: T, u: U);
 }
 
-trait Eq<Sized? X> for Sized? { }
-impl<Sized? X> Eq<X> for X { }
-fn eq<Sized? A,Sized? B:Eq<A>>() { }
+trait Eq<X: ?Sized> for Sized? { }
+impl<X: ?Sized> Eq<X> for X { }
+fn eq<A: ?Sized,B: ?Sized +Eq<A>>() { }
 
 fn test<'a,'b>() {
     // No errors expected:
index e08d84944c02a58beaa20727a81154ccb9897fe6..8c85382f45e0ec08c9ac98735541cc17d26c501c 100644 (file)
@@ -20,9 +20,9 @@ trait Foo<T,U> {
     fn dummy(&self, t: T, u: U);
 }
 
-trait Eq<Sized? X> for Sized? { }
-impl<Sized? X> Eq<X> for X { }
-fn eq<Sized? A,Sized? B:Eq<A>>() { }
+trait Eq<X: ?Sized> for Sized? { }
+impl<X: ?Sized> Eq<X> for X { }
+fn eq<A: ?Sized,B: ?Sized +Eq<A>>() { }
 
 fn main() {
     eq::< for<'a> Foo<(&'a int,), &'a int>,
index a938f126c16077f6925c4a65a7fda0825d8029ed..c99e7a116323f319831e6c88c436d2b4065b337a 100644 (file)
@@ -21,9 +21,9 @@ trait Foo<'a,T,U> {
     fn dummy(&'a self) -> &'a (T,U);
 }
 
-trait Eq<Sized? X> for Sized? { }
-impl<Sized? X> Eq<X> for X { }
-fn eq<Sized? A,Sized? B:Eq<A>>() { }
+trait Eq<X: ?Sized> for Sized? { }
+impl<X: ?Sized> Eq<X> for X { }
+fn eq<A: ?Sized,B: ?Sized +Eq<A>>() { }
 
 fn same_type<A,B:Eq<A>>(a: A, b: B) { }
 
index 7b5d42954117cb313ba9f28cb26791f616c48405..2de490e018b44de240f5a898585840aac5946ce5 100644 (file)
@@ -9,5 +9,5 @@
 // except according to those terms.
 
 fn bar<T: Sized>() { }
-fn foo<Sized? T>() { bar::<T>() } //~ ERROR the trait `core::kinds::Sized` is not implemented
+fn foo<T: ?Sized>() { bar::<T>() } //~ ERROR the trait `core::kinds::Sized` is not implemented
 fn main() { }
index 0462a2025d2ce72dac239bede11451bbe31b6242..aea236c9268157928593407a3e2bc85a4ccd4bbe 100644 (file)
 
 
 fn is_sized<T:Sized>() { }
-fn not_sized<Sized? T>() { }
+fn not_sized<T: ?Sized>() { }
 
 enum Foo<U> { FooSome(U), FooNone }
 fn foo1<T>() { not_sized::<Foo<T>>() } // Hunky dory.
-fn foo2<Sized? T>() { not_sized::<Foo<T>>() }
+fn foo2<T: ?Sized>() { not_sized::<Foo<T>>() }
 //~^ ERROR the trait `core::kinds::Sized` is not implemented
 //
 // Not OK: `T` is not sized.
 
-enum Bar<Sized? U> { BarSome(U), BarNone }
-fn bar1<Sized? T>() { not_sized::<Bar<T>>() }
-fn bar2<Sized? T>() { is_sized::<Bar<T>>() }
+enum Bar<U: ?Sized> { BarSome(U), BarNone }
+fn bar1<T: ?Sized>() { not_sized::<Bar<T>>() }
+fn bar2<T: ?Sized>() { is_sized::<Bar<T>>() }
 //~^ ERROR the trait `core::kinds::Sized` is not implemented
 //
 // Not OK: `Bar<T>` is not sized, but it should be.
index 2c8a2b361d596be0a6e15ade8dff5ea4d9f19143..8740346a21750c8918af9545e4ceda6d20a0286b 100644 (file)
@@ -14,7 +14,7 @@
 
 struct S5<Y>;
 
-impl<Sized? X> S5<X> { //~ ERROR not implemented
+impl<X: ?Sized> S5<X> { //~ ERROR not implemented
 }
 
 fn main() { }
index db2e9cb932800d5d4aa7c1f2482e6303874dad98..89c711036977a68addd796bfedd63652ad312293 100644 (file)
 
 
 fn is_sized<T:Sized>() { }
-fn not_sized<Sized? T>() { }
+fn not_sized<T: ?Sized>() { }
 
 struct Foo<T> { data: T }
 fn foo1<T>() { not_sized::<Foo<T>>() } // Hunky dory.
-fn foo2<Sized? T>() { not_sized::<Foo<T>>() }
+fn foo2<T: ?Sized>() { not_sized::<Foo<T>>() }
 //~^ ERROR the trait `core::kinds::Sized` is not implemented
 //
 // Not OK: `T` is not sized.
 
-struct Bar<Sized? T> { data: T }
-fn bar1<Sized? T>() { not_sized::<Bar<T>>() }
-fn bar2<Sized? T>() { is_sized::<Bar<T>>() }
+struct Bar<T: ?Sized> { data: T }
+fn bar1<T: ?Sized>() { not_sized::<Bar<T>>() }
+fn bar2<T: ?Sized>() { is_sized::<Bar<T>>() }
 //~^ ERROR the trait `core::kinds::Sized` is not implemented
 //
 // Not OK: `Bar<T>` is not sized, but it should be.
index 0f0a97fab4d7580560e214803861d4d8b99f3953..3dd55b0ba7d23401d7c75e5922efd5c2f23038b5 100644 (file)
 // Test sized-ness checking in substitution in impls.
 
 // impl - struct
-trait T3<Sized? Z> {
+trait T3<Z: ?Sized> {
 }
 
 struct S5<Y>;
 
-impl<Sized? X> T3<X> for S5<X> { //~ ERROR not implemented
+impl<X: ?Sized> T3<X> for S5<X> { //~ ERROR not implemented
 }
 
 fn main() { }
index bdb652b168a8c5fac1bd12379f53bb7d416b3c3c..7ae74fc2600c84d71416e431f997c6840278b901 100644 (file)
@@ -13,8 +13,8 @@
 // impl - unbounded
 trait T2<Z> {
 }
-struct S4<Sized? Y>;
-impl<Sized? X> T2<X> for S4<X> {
+struct S4<Y: ?Sized>;
+impl<X: ?Sized> T2<X> for S4<X> {
     //~^ ERROR `core::kinds::Sized` is not implemented for the type `X`
 }
 
index 0a75240f2d89df613224e0d8fd16e8299df98441..02c0fd618927d61b97d44b70c1bd72a73c8948b9 100644 (file)
@@ -12,7 +12,7 @@
 
 
 // Unbounded.
-fn f1<Sized? X>(x: &X) {
+fn f1<X: ?Sized>(x: &X) {
     f2::<X>(x);
     //~^ ERROR the trait `core::kinds::Sized` is not implemented
 }
@@ -21,7 +21,7 @@ fn f2<X>(x: &X) {
 
 // Bounded.
 trait T for Sized? {}
-fn f3<Sized? X: T>(x: &X) {
+fn f3<X: ?Sized + T>(x: &X) {
     f4::<X>(x);
     //~^ ERROR the trait `core::kinds::Sized` is not implemented
 }
@@ -29,13 +29,13 @@ fn f4<X: T>(x: &X) {
 }
 
 // Test with unsized enum.
-enum E<Sized? X> {
+enum E<X: ?Sized> {
     V(X),
 }
 
 fn f5<Y>(x: &Y) {}
-fn f6<Sized? X>(x: &X) {}
-fn f7<Sized? X>(x1: &E<X>, x2: &E<X>) {
+fn f6<X: ?Sized>(x: &X) {}
+fn f7<X: ?Sized>(x1: &E<X>, x2: &E<X>) {
     f5(x1);
     //~^ ERROR the trait `core::kinds::Sized` is not implemented
     f6(x2); // ok
@@ -43,23 +43,23 @@ fn f7<Sized? X>(x1: &E<X>, x2: &E<X>) {
 
 
 // Test with unsized struct.
-struct S<Sized? X> {
+struct S<X: ?Sized> {
     x: X,
 }
 
-fn f8<Sized? X>(x1: &S<X>, x2: &S<X>) {
+fn f8<X: ?Sized>(x1: &S<X>, x2: &S<X>) {
     f5(x1);
     //~^ ERROR the trait `core::kinds::Sized` is not implemented
     f6(x2); // ok
 }
 
 // Test some tuples.
-fn f9<Sized? X>(x1: Box<S<X>>, x2: Box<E<X>>) {
+fn f9<X: ?Sized>(x1: Box<S<X>>, x2: Box<E<X>>) {
     f5(&(*x1, 34i));
     //~^ ERROR the trait `core::kinds::Sized` is not implemented
 }
 
-fn f10<Sized? X>(x1: Box<S<X>>, x2: Box<E<X>>) {
+fn f10<X: ?Sized>(x1: Box<S<X>>, x2: Box<E<X>>) {
     f5(&(32i, *x2));
     //~^ ERROR the trait `core::kinds::Sized` is not implemented
 }
index f9ece8e6843db8756d0c6cbd4a80d4d28d229577..f8b8ad2bf2efa4ee0b749ec7393599ba57e032c7 100644 (file)
@@ -11,7 +11,7 @@
 // Test that bounds are sized-compatible.
 
 trait T : Sized {}
-fn f<Sized? Y: T>() {
+fn f<Y: ?Sized + T>() {
 //~^ERROR incompatible bounds on `Y`, bound `T` does not allow unsized type
 }
 
index d9d7a86889f5771f741b6a76cf458000ae01bd42..f7477d746fae42faac883697deb0af0e5b681b28 100644 (file)
 
 // Test `Sized?` types not allowed in fields (except the last one).
 
-struct S1<Sized? X> {
+struct S1<X: ?Sized> {
     f1: X, //~ ERROR `core::kinds::Sized` is not implemented
     f2: int,
 }
-struct S2<Sized? X> {
+struct S2<X: ?Sized> {
     f: int,
     g: X, //~ ERROR `core::kinds::Sized` is not implemented
     h: int,
@@ -27,10 +27,10 @@ struct S4 {
     f: str, //~ ERROR `core::kinds::Sized` is not implemented
     g: uint
 }
-enum E<Sized? X> {
+enum E<X: ?Sized> {
     V1(X, int), //~ERROR `core::kinds::Sized` is not implemented
 }
-enum F<Sized? X> {
+enum F<X: ?Sized> {
     V2{f1: X, f: int}, //~ERROR `core::kinds::Sized` is not implemented
 }
 
index 0efd178f75b8c479a831a9f6e8456d773ac26c5a..019d3475502535168d7265866c2266f0379d4ac7 100644 (file)
 
 trait T for Sized? {}
 
-fn f1<Sized? X>(x: &X) {
+fn f1<X: ?Sized>(x: &X) {
     let _: X; // <-- this is OK, no bindings created, no initializer.
     let _: (int, (X, int)); // same
     let y: X; //~ERROR the trait `core::kinds::Sized` is not implemented
     let y: (int, (X, int)); //~ERROR the trait `core::kinds::Sized` is not implemented
 }
-fn f2<Sized? X: T>(x: &X) {
+fn f2<X: ?Sized + T>(x: &X) {
     let y: X; //~ERROR the trait `core::kinds::Sized` is not implemented
     let y: (int, (X, int)); //~ERROR the trait `core::kinds::Sized` is not implemented
 }
 
-fn f3<Sized? X>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
+fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
     let y: X = *x1; //~ERROR the trait `core::kinds::Sized` is not implemented
     let y = *x2; //~ERROR the trait `core::kinds::Sized` is not implemented
     let (y, z) = (*x3, 4i); //~ERROR the trait `core::kinds::Sized` is not implemented
 }
-fn f4<Sized? X: T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
+fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
     let y: X = *x1;         //~ERROR the trait `core::kinds::Sized` is not implemented
     let y = *x2;            //~ERROR the trait `core::kinds::Sized` is not implemented
     let (y, z) = (*x3, 4i); //~ERROR the trait `core::kinds::Sized` is not implemented
 }
 
-fn g1<Sized? X>(x: X) {} //~ERROR the trait `core::kinds::Sized` is not implemented
-fn g2<Sized? X: T>(x: X) {} //~ERROR the trait `core::kinds::Sized` is not implemented
+fn g1<X: ?Sized>(x: X) {} //~ERROR the trait `core::kinds::Sized` is not implemented
+fn g2<X: ?Sized + T>(x: X) {} //~ERROR the trait `core::kinds::Sized` is not implemented
 
 pub fn main() {
 }
index c0e6ae1db92c4aacc0a8b914eb81a81fe14b8c38..af64afb23b9454dd21c7de800b5e4bac11881e40 100644 (file)
@@ -16,8 +16,8 @@ trait T for Sized? {}
 // impl - bounded
 trait T1<Z: T> {
 }
-struct S3<Sized? Y>;
-impl<Sized? X: T> T1<X> for S3<X> {
+struct S3<Y: ?Sized>;
+impl<X: ?Sized + T> T1<X> for S3<X> {
     //~^ ERROR `core::kinds::Sized` is not implemented for the type `X`
 }
 
index 6e2ae117ce7ae97d44728a4c6aa60a9cf0c49213..8b8b7f169c5a0274f85fcfadea6add6dc98bb225 100644 (file)
@@ -20,7 +20,7 @@ fn drop(&mut self) {
 trait Trait {}
 impl Trait for Foo {}
 
-struct Fat<Sized? T> {
+struct Fat<T: ?Sized> {
     f: T
 }
 
index deaf49228bc842810c92f671134d5dcb7843f530..743293c23f6adbb0c1e6ad8c55f19015fb4e99e9 100644 (file)
@@ -17,7 +17,7 @@ fn drop(&mut self) {
     }
 }
 
-struct Fat<Sized? T> {
+struct Fat<T: ?Sized> {
     f: T
 }
 
index 3b53203d218e047bb746e24d8764fd89c0a98e3d..f7032da82a169f5317aeef66e99ddb60282b5a0d 100644 (file)
@@ -18,7 +18,7 @@
 
 use std::ops::Deref;
 
-pub trait MyEq<Sized? U=Self> for Sized? {
+pub trait MyEq<U: ?Sized=Self> for Sized? {
     fn eq(&self, u: &U) -> bool;
 }
 
index e82359bc168e671f12e584cc156fce55293c4c16..11ffb4198dad8c6b838a3ad1f0dcab79eb4ba9d5 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-pub trait Borrow<Sized? Borrowed> {
+pub trait Borrow<Borrowed: ?Sized> {
         fn borrow(&self) -> &Borrowed;
 }