From e0684e876954ad5a713e6f985570162cedcae8df Mon Sep 17 00:00:00 2001 From: Nick Cameron Date: Tue, 6 Jan 2015 10:16:49 +1300 Subject: [PATCH] Fallout --- src/liballoc/boxed.rs | 16 ++++---- src/libcollections/btree/map.rs | 26 ++++++------- src/libcollections/btree/node.rs | 4 +- src/libcollections/btree/set.rs | 4 +- src/libcollections/slice.rs | 2 +- src/libcore/borrow.rs | 38 +++++++++---------- src/libcore/clone.rs | 2 +- src/libcore/cmp.rs | 24 ++++++------ src/libcore/fmt/mod.rs | 8 ++-- src/libcore/hash/mod.rs | 8 ++-- src/libcore/hash/sip.rs | 6 +-- src/libcore/kinds.rs | 18 ++++----- src/libcore/mem.rs | 4 +- src/libcore/ops.rs | 28 +++++++------- src/libcore/slice.rs | 4 +- src/libcore/str/mod.rs | 2 +- src/libcoretest/hash/mod.rs | 2 +- src/libgraphviz/maybe_owned_vec.rs | 2 +- src/librustc/middle/intrinsicck.rs | 8 ++-- src/librustc/util/nodemap.rs | 2 +- src/librustc/util/ppaux.rs | 2 +- src/libserialize/serialize.rs | 4 +- src/libserialize/serialize_stage0.rs | 4 +- src/libstd/c_str.rs | 2 +- src/libstd/collections/hash/map.rs | 34 ++++++++--------- src/libstd/collections/hash/set.rs | 4 +- src/libstd/collections/hash/table.rs | 2 +- src/libstd/hash.rs | 2 +- src/libstd/io/mod.rs | 8 ++-- src/libstd/path/mod.rs | 2 +- src/libstd/path/posix.rs | 2 +- src/libsyntax/parse/obsolete.rs | 2 +- src/libsyntax/util/interner.rs | 4 +- .../compile-fail/associated-types-unsized.rs | 2 +- src/test/compile-fail/dst-bad-assign-2.rs | 2 +- src/test/compile-fail/dst-bad-assign.rs | 2 +- src/test/compile-fail/dst-bad-coerce1.rs | 2 +- src/test/compile-fail/dst-bad-coerce2.rs | 2 +- src/test/compile-fail/dst-bad-coerce3.rs | 2 +- src/test/compile-fail/dst-bad-coerce4.rs | 2 +- src/test/compile-fail/dst-bad-coercions.rs | 2 +- src/test/compile-fail/dst-bad-deep.rs | 2 +- .../dst-object-from-unsized-type.rs | 4 +- .../compile-fail/transmute-fat-pointers.rs | 8 ++-- src/test/compile-fail/transmute-impl.rs | 4 +- .../unboxed-closure-sugar-default.rs | 6 +-- .../unboxed-closure-sugar-equiv.rs | 6 +-- .../unboxed-closure-sugar-lifetime-elision.rs | 6 +-- .../unboxed-closure-sugar-region.rs | 6 +-- src/test/compile-fail/unsized-bare-typaram.rs | 2 +- src/test/compile-fail/unsized-enum.rs | 10 ++--- .../unsized-inherent-impl-self-type.rs | 2 +- src/test/compile-fail/unsized-struct.rs | 10 ++--- .../unsized-trait-impl-self-type.rs | 4 +- .../unsized-trait-impl-trait-arg.rs | 4 +- src/test/compile-fail/unsized3.rs | 18 ++++----- src/test/compile-fail/unsized4.rs | 2 +- src/test/compile-fail/unsized5.rs | 8 ++-- src/test/compile-fail/unsized6.rs | 12 +++--- src/test/compile-fail/unsized7.rs | 4 +- src/test/run-pass-valgrind/dst-dtor-1.rs | 2 +- src/test/run-pass-valgrind/dst-dtor-2.rs | 2 +- .../associated-types-conditional-dispatch.rs | 2 +- src/test/run-pass/issue-18906.rs | 2 +- 64 files changed, 211 insertions(+), 211 deletions(-) diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs index 2c318181b09..a574367ccf4 100644 --- a/src/liballoc/boxed.rs +++ b/src/liballoc/boxed.rs @@ -75,14 +75,14 @@ impl Clone for Box { } #[stable] -impl PartialEq for Box { +impl PartialEq for Box { #[inline] fn eq(&self, other: &Box) -> bool { PartialEq::eq(&**self, &**other) } #[inline] fn ne(&self, other: &Box) -> bool { PartialEq::ne(&**self, &**other) } } #[stable] -impl PartialOrd for Box { +impl PartialOrd for Box { #[inline] fn partial_cmp(&self, other: &Box) -> Option { PartialOrd::partial_cmp(&**self, &**other) @@ -97,16 +97,16 @@ impl PartialOrd for Box { fn gt(&self, other: &Box) -> bool { PartialOrd::gt(&**self, &**other) } } #[stable] -impl Ord for Box { +impl Ord for Box { #[inline] fn cmp(&self, other: &Box) -> Ordering { Ord::cmp(&**self, &**other) } #[stable]} -impl Eq for Box {} +impl Eq for Box {} -impl> Hash for Box { +impl> Hash for Box { #[inline] fn hash(&self, state: &mut S) { (**self).hash(state); @@ -143,7 +143,7 @@ impl BoxAny for Box { } } -impl fmt::Show for Box { +impl fmt::Show for Box { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { (**self).fmt(f) } @@ -155,13 +155,13 @@ impl fmt::Show for Box { } } -impl Deref for Box { +impl Deref for Box { type Target = T; fn deref(&self) -> &T { &**self } } -impl DerefMut for Box { +impl DerefMut for Box { fn deref_mut(&mut self) -> &mut T { &mut **self } } diff --git a/src/libcollections/btree/map.rs b/src/libcollections/btree/map.rs index a9e09a584d6..43b3f342140 100644 --- a/src/libcollections/btree/map.rs +++ b/src/libcollections/btree/map.rs @@ -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 @@ impl BTreeMap { /// assert_eq!(map.get(&2), None); /// ``` #[stable] - pub fn get(&self, key: &Q) -> Option<&V> where Q: BorrowFrom + Ord { + pub fn get(&self, key: &Q) -> Option<&V> where Q: BorrowFrom + Ord { let mut cur_node = &self.root; loop { match Node::search(cur_node, key) { @@ -246,7 +246,7 @@ impl BTreeMap { /// assert_eq!(map.contains_key(&2), false); /// ``` #[stable] - pub fn contains_key(&self, key: &Q) -> bool where Q: BorrowFrom + Ord { + pub fn contains_key(&self, key: &Q) -> bool where Q: BorrowFrom + Ord { self.get(key).is_some() } @@ -270,7 +270,7 @@ impl BTreeMap { /// ``` // See `get` for implementation notes, this is basically a copy-paste with mut's added #[stable] - pub fn get_mut(&mut self, key: &Q) -> Option<&mut V> where Q: BorrowFrom + Ord { + pub fn get_mut(&mut self, key: &Q) -> Option<&mut V> where Q: BorrowFrom + 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 @@ impl BTreeMap { /// assert_eq!(map.remove(&1), None); /// ``` #[stable] - pub fn remove(&mut self, key: &Q) -> Option where Q: BorrowFrom + Ord { + pub fn remove(&mut self, key: &Q) -> Option where Q: BorrowFrom + 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 @@ impl Show for BTreeMap { // NOTE(stage0): remove impl after a snapshot #[cfg(stage0)] #[stable] -impl Index for BTreeMap +impl Index for BTreeMap where Q: BorrowFrom + Ord { fn index(&self, key: &Q) -> &V { @@ -890,7 +890,7 @@ impl Index for BTreeMap #[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot #[stable] -impl Index for BTreeMap +impl Index for BTreeMap where Q: BorrowFrom + Ord { type Output = V; @@ -903,7 +903,7 @@ impl Index for BTreeMap // NOTE(stage0): remove impl after a snapshot #[cfg(stage0)] #[stable] -impl IndexMut for BTreeMap +impl IndexMut for BTreeMap where Q: BorrowFrom + Ord { fn index_mut(&mut self, key: &Q) -> &mut V { @@ -913,7 +913,7 @@ impl IndexMut for BTreeMap #[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot #[stable] -impl IndexMut for BTreeMap +impl IndexMut for BTreeMap where Q: BorrowFrom + Ord { type Output = V; @@ -1135,7 +1135,7 @@ impl<'a, K, V> DoubleEndedIterator for Values<'a, K, V> { #[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 @@ impl<'a, Sized? Q, K: Ord, V> Entry<'a, Q, K, V> { } } -impl<'a, Sized? Q: ToOwned, K: Ord, V> VacantEntry<'a, Q, K, V> { +impl<'a, Q: ?Sized + ToOwned, 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 BTreeMap { /// ``` /// 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 { // same basic logic of `swap` and `pop`, blended together diff --git a/src/libcollections/btree/node.rs b/src/libcollections/btree/node.rs index 1f719da590b..0a93bbf89c9 100644 --- a/src/libcollections/btree/node.rs +++ b/src/libcollections/btree/node.rs @@ -517,7 +517,7 @@ impl Node { /// 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>>(node: NodeRef, key: &Q) + pub fn search>>(node: NodeRef, key: &Q) -> SearchResult where Q: BorrowFrom + 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 @@ impl Node { } } - fn search_linear(&self, key: &Q) -> (bool, uint) where Q: BorrowFrom + Ord { + fn search_linear(&self, key: &Q) -> (bool, uint) where Q: BorrowFrom + Ord { for (i, k) in self.keys().iter().enumerate() { match key.cmp(BorrowFrom::borrow_from(k)) { Greater => {}, diff --git a/src/libcollections/btree/set.rs b/src/libcollections/btree/set.rs index 0406edcdd32..98f16332170 100644 --- a/src/libcollections/btree/set.rs +++ b/src/libcollections/btree/set.rs @@ -299,7 +299,7 @@ impl BTreeSet { /// assert_eq!(set.contains(&4), false); /// ``` #[stable] - pub fn contains(&self, value: &Q) -> bool where Q: BorrowFrom + Ord { + pub fn contains(&self, value: &Q) -> bool where Q: BorrowFrom + Ord { self.map.contains_key(value) } @@ -429,7 +429,7 @@ impl BTreeSet { /// assert_eq!(set.remove(&2), false); /// ``` #[stable] - pub fn remove(&mut self, value: &Q) -> bool where Q: BorrowFrom + Ord { + pub fn remove(&mut self, value: &Q) -> bool where Q: BorrowFrom + Ord { self.map.remove(value).is_some() } } diff --git a/src/libcollections/slice.rs b/src/libcollections/slice.rs index 3602bfc10c3..efb73e7d7c8 100644 --- a/src/libcollections/slice.rs +++ b/src/libcollections/slice.rs @@ -989,7 +989,7 @@ impl SliceExt for [T] { //////////////////////////////////////////////////////////////////////////////// #[unstable = "U should be an associated type"] /// An extension trait for concatenating slices -pub trait SliceConcatExt for Sized? { +pub trait SliceConcatExt for Sized? { /// Flattens a slice of `T` into a single value `U`. #[stable] fn concat(&self) -> U; diff --git a/src/libcore/borrow.rs b/src/libcore/borrow.rs index 7e4d73d598d..54621f59c2f 100644 --- a/src/libcore/borrow.rs +++ b/src/libcore/borrow.rs @@ -53,50 +53,50 @@ use option::Option; use self::Cow::*; /// A trait for borrowing data. -pub trait BorrowFrom for Sized? { +pub trait BorrowFrom for Sized? { /// 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 for Sized? : BorrowFrom { /// Mutably borrow from an owned value. fn borrow_from_mut(owned: &mut Owned) -> &mut Self; } -impl BorrowFrom for T { +impl BorrowFrom for T { fn borrow_from(owned: &T) -> &T { owned } } -impl BorrowFromMut for T { +impl BorrowFromMut 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> for B where B: ToOwned { +impl<'a, T, B: ?Sized> BorrowFrom> for B where B: ToOwned { 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 { +impl<'a, T, B: ?Sized> IntoCow<'a, T, B> for Cow<'a, T, B> where B: ToOwned { fn into_cow(self) -> Cow<'a, T, B> { self } @@ -129,7 +129,7 @@ impl ToOwned for T where T: Clone { /// } /// } /// ``` -pub enum Cow<'a, T, Sized? B: 'a> where B: ToOwned { +pub enum Cow<'a, T, B: ?Sized + 'a> where B: ToOwned { /// Borrowed data. Borrowed(&'a B), @@ -138,7 +138,7 @@ pub enum Cow<'a, T, Sized? B: 'a> where B: ToOwned { } #[stable] -impl<'a, T, Sized? B> Clone for Cow<'a, T, B> where B: ToOwned { +impl<'a, T, B: ?Sized> Clone for Cow<'a, T, B> where B: ToOwned { fn clone(&self) -> Cow<'a, T, B> { match *self { Borrowed(b) => Borrowed(b), @@ -150,7 +150,7 @@ impl<'a, T, Sized? B> Clone for Cow<'a, T, B> where B: ToOwned { } } -impl<'a, T, Sized? B> Cow<'a, T, B> where B: ToOwned { +impl<'a, T, B: ?Sized> Cow<'a, T, B> where B: ToOwned { /// Acquire a mutable reference to the owned form of the data. /// /// Copies the data if it is not already owned. @@ -191,7 +191,7 @@ impl<'a, T, Sized? B> Cow<'a, T, B> where B: ToOwned { } } -impl<'a, T, Sized? B> Deref for Cow<'a, T, B> where B: ToOwned { +impl<'a, T, B: ?Sized> Deref for Cow<'a, T, B> where B: ToOwned { type Target = B; fn deref(&self) -> &B { @@ -203,10 +203,10 @@ impl<'a, T, Sized? B> Deref for Cow<'a, T, B> where B: ToOwned { } #[stable] -impl<'a, T, Sized? B> Eq for Cow<'a, T, B> where B: Eq + ToOwned {} +impl<'a, T, B: ?Sized> Eq for Cow<'a, T, B> where B: Eq + ToOwned {} #[stable] -impl<'a, T, Sized? B> Ord for Cow<'a, T, B> where B: Ord + ToOwned { +impl<'a, T, B: ?Sized> Ord for Cow<'a, T, B> where B: Ord + ToOwned { #[inline] fn cmp(&self, other: &Cow<'a, T, B>) -> Ordering { Ord::cmp(&**self, &**other) @@ -214,7 +214,7 @@ impl<'a, T, Sized? B> Ord for Cow<'a, T, B> where B: Ord + ToOwned { } #[stable] -impl<'a, 'b, T, U, Sized? B, Sized? C> PartialEq> for Cow<'a, T, B> where +impl<'a, 'b, T, U, B: ?Sized, C: ?Sized> PartialEq> for Cow<'a, T, B> where B: PartialEq + ToOwned, C: ToOwned, { @@ -225,14 +225,14 @@ impl<'a, 'b, T, U, Sized? B, Sized? C> PartialEq> for Cow<'a, T, B } #[stable] -impl<'a, T, Sized? B> PartialOrd for Cow<'a, T, B> where B: PartialOrd + ToOwned { +impl<'a, T, B: ?Sized> PartialOrd for Cow<'a, T, B> where B: PartialOrd + ToOwned { #[inline] fn partial_cmp(&self, other: &Cow<'a, T, B>) -> Option { PartialOrd::partial_cmp(&**self, &**other) } } -impl<'a, T, Sized? B> fmt::Show for Cow<'a, T, B> where B: fmt::Show + ToOwned, T: fmt::Show { +impl<'a, T, B: ?Sized> fmt::Show for Cow<'a, T, B> where B: fmt::Show + ToOwned, T: fmt::Show { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match *self { Borrowed(ref b) => fmt::Show::fmt(b, f), diff --git a/src/libcore/clone.rs b/src/libcore/clone.rs index 159c2a505d5..17991659f97 100644 --- a/src/libcore/clone.rs +++ b/src/libcore/clone.rs @@ -43,7 +43,7 @@ pub trait Clone : Sized { } #[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 } diff --git a/src/libcore/cmp.rs b/src/libcore/cmp.rs index 13f9f5ccee9..933088f2765 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 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 @@ impl PartialOrd for Ordering { /// 5.11). #[lang="ord"] #[stable] -pub trait PartialOrd for Sized?: PartialEq { +pub trait PartialOrd for Sized?: PartialEq { /// This method returns an ordering between `self` and `other` values /// if one exists. #[stable] @@ -428,14 +428,14 @@ mod impls { // & pointers #[stable] - impl<'a, 'b, Sized? A, Sized? B> PartialEq<&'b B> for &'a A where A: PartialEq { + impl<'a, 'b, A: ?Sized, B: ?Sized> PartialEq<&'b B> for &'a A where A: PartialEq { #[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 { + impl<'a, 'b, A: ?Sized, B: ?Sized> PartialOrd<&'b B> for &'a A where A: PartialOrd { #[inline] fn partial_cmp(&self, other: &&'b B) -> Option { PartialOrd::partial_cmp(*self, *other) @@ -450,24 +450,24 @@ mod impls { 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 { + impl<'a, 'b, A: ?Sized, B: ?Sized> PartialEq<&'b mut B> for &'a mut A where A: PartialEq { #[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 { + impl<'a, 'b, A: ?Sized, B: ?Sized> PartialOrd<&'b mut B> for &'a mut A where A: PartialOrd { #[inline] fn partial_cmp(&self, other: &&'b mut B) -> Option { PartialOrd::partial_cmp(*self, *other) @@ -482,15 +482,15 @@ mod impls { 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 { + impl<'a, 'b, A: ?Sized, B: ?Sized> PartialEq<&'b mut B> for &'a A where A: PartialEq { #[inline] fn eq(&self, other: &&'b mut B) -> bool { PartialEq::eq(*self, *other) } #[inline] @@ -498,7 +498,7 @@ mod impls { } #[stable] - impl<'a, 'b, Sized? A, Sized? B> PartialEq<&'b B> for &'a mut A where A: PartialEq { + impl<'a, 'b, A: ?Sized, B: ?Sized> PartialEq<&'b B> for &'a mut A where A: PartialEq { #[inline] fn eq(&self, other: &&'b B) -> bool { PartialEq::eq(*self, *other) } #[inline] diff --git a/src/libcore/fmt/mod.rs b/src/libcore/fmt/mod.rs index 102836f8d30..9e9e2b92bb7 100644 --- a/src/libcore/fmt/mod.rs +++ b/src/libcore/fmt/mod.rs @@ -78,9 +78,9 @@ pub trait Writer { // 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) } } diff --git a/src/libcore/hash/mod.rs b/src/libcore/hash/mod.rs index b0a5ec9fe12..aaae5c2717c 100644 --- a/src/libcore/hash/mod.rs +++ b/src/libcore/hash/mod.rs @@ -85,7 +85,7 @@ pub trait Hash for Sized? { /// containers like `HashMap`, which need a generic way hash multiple types. pub trait Hasher { /// Compute the hash of a value. - fn hash>(&self, value: &T) -> u64; + fn hash>(&self, value: &T) -> u64; } #[allow(missing_docs)] @@ -194,14 +194,14 @@ impl> Hash for [T] { } -impl<'a, S: Writer, Sized? T: Hash> Hash for &'a T { +impl<'a, S: Writer, T: ?Sized + Hash> Hash for &'a T { #[inline] fn hash(&self, state: &mut S) { (**self).hash(state); } } -impl<'a, S: Writer, Sized? T: Hash> Hash for &'a mut T { +impl<'a, S: Writer, T: ?Sized + Hash> Hash for &'a mut T { #[inline] fn hash(&self, state: &mut S) { (**self).hash(state); @@ -233,7 +233,7 @@ impl Hash for TypeId { } } -impl<'a, T, Sized? B, S> Hash for Cow<'a, T, B> where B: Hash + ToOwned { +impl<'a, T, B: ?Sized, S> Hash for Cow<'a, T, B> where B: Hash + ToOwned { #[inline] fn hash(&self, state: &mut S) { Hash::hash(&**self, state) diff --git a/src/libcore/hash/sip.rs b/src/libcore/hash/sip.rs index f9da0493f3e..c4d45e9c2c8 100644 --- a/src/libcore/hash/sip.rs +++ b/src/libcore/hash/sip.rs @@ -239,7 +239,7 @@ impl SipHasher { impl Hasher for SipHasher { #[inline] - fn hash>(&self, value: &T) -> u64 { + fn hash>(&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 @@ impl Default for SipHasher { /// Hashes a value using the SipHash algorithm. #[inline] -pub fn hash>(value: &T) -> u64 { +pub fn hash>(value: &T) -> u64 { let mut state = SipState::new(); value.hash(&mut state); state.result() @@ -263,7 +263,7 @@ pub fn hash>(value: &T) -> u64 { /// Hashes a value with the SipHash algorithm with the provided keys. #[inline] -pub fn hash_with_keys>(k0: u64, k1: u64, value: &T) -> u64 { +pub fn hash_with_keys>(k0: u64, k1: u64, value: &T) -> u64 { let mut state = SipState::new_with_keys(k0, k1); value.hash(&mut state); state.result() diff --git a/src/libcore/kinds.rs b/src/libcore/kinds.rs index e50aaef5f09..1911641034c 100644 --- a/src/libcore/kinds.rs +++ b/src/libcore/kinds.rs @@ -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; + pub struct CovariantType; - impl Copy for CovariantType {} - impl Clone for CovariantType { + impl Copy for CovariantType {} + impl Clone for CovariantType { fn clone(&self) -> CovariantType { *self } } @@ -181,10 +181,10 @@ pub mod marker { /// arguments of type `U`, hence such a conversion is safe. #[lang="contravariant_type"] #[derive(PartialEq, Eq, PartialOrd, Ord)] - pub struct ContravariantType; + pub struct ContravariantType; - impl Copy for ContravariantType {} - impl Clone for ContravariantType { + impl Copy for ContravariantType {} + impl Clone for ContravariantType { fn clone(&self) -> ContravariantType { *self } } @@ -211,10 +211,10 @@ pub mod marker { /// interior mutability. #[lang="invariant_type"] #[derive(PartialEq, Eq, PartialOrd, Ord)] - pub struct InvariantType; + pub struct InvariantType; - impl Copy for InvariantType {} - impl Clone for InvariantType { + impl Copy for InvariantType {} + impl Clone for InvariantType { fn clone(&self) -> InvariantType { *self } } diff --git a/src/libcore/mem.rs b/src/libcore/mem.rs index 2620928acc1..c6056916121 100644 --- a/src/libcore/mem.rs +++ b/src/libcore/mem.rs @@ -320,7 +320,7 @@ pub unsafe fn transmute_copy(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) diff --git a/src/libcore/ops.rs b/src/libcore/ops.rs index c9b71092f90..d7f6d3bc153 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 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 for Sized? { /// ``` #[cfg(not(stage0))] // NOTE(stage0) remove cfg after a snapshot #[lang="index"] -pub trait Index for Sized? { - type Sized? Output; +pub trait Index 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 for Sized? { #[cfg(stage0)] #[allow(missing_docs)] #[lang="index_mut"] -pub trait IndexMut for Sized? { +pub trait IndexMut 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 for Sized? { /// ``` #[cfg(not(stage0))] // NOTE(stage0) remove cfg after a snapshot #[lang="index_mut"] -pub trait IndexMut for Sized? { - type Sized? Output; +pub trait IndexMut 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 for Sized? { /// } /// ``` #[lang="slice"] -pub trait Slice for Sized? { +pub trait Slice 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 for Sized? { /// } /// ``` #[lang="slice_mut"] -pub trait SliceMut for Sized? { +pub trait SliceMut 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 { /// ``` #[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 ::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 { extern "rust-call" fn call_once(self, args: Args) -> Result; } -impl FnMut for F - where F : Fn +impl FnMut for F + where F : Fn { extern "rust-call" fn call_mut(&mut self, args: A) -> R { self.call(args) diff --git a/src/libcore/slice.rs b/src/libcore/slice.rs index f17a775cf42..de57136d593 100644 --- a/src/libcore/slice.rs +++ b/src/libcore/slice.rs @@ -648,13 +648,13 @@ impl AsSlice for [T] { } #[experimental = "trait is experimental"] -impl<'a, T, Sized? U: AsSlice> AsSlice for &'a U { +impl<'a, T, U: ?Sized + AsSlice> AsSlice for &'a U { #[inline(always)] fn as_slice(&self) -> &[T] { AsSlice::as_slice(*self) } } #[experimental = "trait is experimental"] -impl<'a, T, Sized? U: AsSlice> AsSlice for &'a mut U { +impl<'a, T, U: ?Sized + AsSlice> AsSlice for &'a mut U { #[inline(always)] fn as_slice(&self) -> &[T] { AsSlice::as_slice(*self) } } diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs index d069744f8da..74fac6b7678 100644 --- a/src/libcore/str/mod.rs +++ b/src/libcore/str/mod.rs @@ -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) } } diff --git a/src/libcoretest/hash/mod.rs b/src/libcoretest/hash/mod.rs index 23f9be124da..a4bafe754ff 100644 --- a/src/libcoretest/hash/mod.rs +++ b/src/libcoretest/hash/mod.rs @@ -16,7 +16,7 @@ use core::hash::{Hash, Hasher, Writer}; struct MyWriterHasher; impl Hasher for MyWriterHasher { - fn hash>(&self, value: &T) -> u64 { + fn hash>(&self, value: &T) -> u64 { let mut state = MyWriter { hash: 0 }; value.hash(&mut state); state.hash diff --git a/src/libgraphviz/maybe_owned_vec.rs b/src/libgraphviz/maybe_owned_vec.rs index 04aa6d16495..567fe04c5af 100644 --- a/src/libgraphviz/maybe_owned_vec.rs +++ b/src/libgraphviz/maybe_owned_vec.rs @@ -25,7 +25,7 @@ use std::slice; // 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), Borrowed(&'a U) }`; and then `U` could be +// U: ?Sized>{ Owned(Box), 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 diff --git a/src/librustc/middle/intrinsicck.rs b/src/librustc/middle/intrinsicck.rs index e3763689ef4..a83416667ab 100644 --- a/src/librustc/middle/intrinsicck.rs +++ b/src/librustc/middle/intrinsicck.rs @@ -121,7 +121,7 @@ impl<'a, 'tcx> IntrinsicCheckingVisitor<'a, 'tcx> { // 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 @@ impl<'a, 'tcx> IntrinsicCheckingVisitor<'a, 'tcx> { // exhaustively checking all possible combinations. Here are some examples: // // ``` - // fn foo() { + // fn foo() { // // T=int, U=int // } // - // fn bar() { + // fn bar() { // // T=int, U=int // // T=[int], U=int // } // - // fn baz() { + // fn baz() { // // T=int, U=int // // T=[int], U=int // // T=int, U=[int] diff --git a/src/librustc/util/nodemap.rs b/src/librustc/util/nodemap.rs index 0da01cd3589..ee224d1ec80 100644 --- a/src/librustc/util/nodemap.rs +++ b/src/librustc/util/nodemap.rs @@ -75,7 +75,7 @@ pub struct FnvHasher; pub struct FnvState(u64); impl Hasher for FnvHasher { - fn hash>(&self, t: &T) -> u64 { + fn hash>(&self, t: &T) -> u64 { let mut state = FnvState(0xcbf29ce484222325); t.hash(&mut state); let FnvState(ret) = state; diff --git a/src/librustc/util/ppaux.rs b/src/librustc/util/ppaux.rs index 9639af5ca1c..ffb7fd9e71b 100644 --- a/src/librustc/util/ppaux.rs +++ b/src/librustc/util/ppaux.rs @@ -604,7 +604,7 @@ impl<'tcx> Repr<'tcx> for () { } } -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) } diff --git a/src/libserialize/serialize.rs b/src/libserialize/serialize.rs index 0646ee1758f..c317b967489 100644 --- a/src/libserialize/serialize.rs +++ b/src/libserialize/serialize.rs @@ -396,13 +396,13 @@ impl Decodable for () { } } -impl<'a, Sized? T: Encodable> Encodable for &'a T { +impl<'a, T: ?Sized + Encodable> Encodable for &'a T { fn encode(&self, s: &mut S) -> Result<(), S::Error> { (**self).encode(s) } } -impl Encodable for Box { +impl Encodable for Box { fn encode(&self, s: &mut S) -> Result<(), S::Error> { (**self).encode(s) } diff --git a/src/libserialize/serialize_stage0.rs b/src/libserialize/serialize_stage0.rs index 558f9e603e1..c4317b99dce 100644 --- a/src/libserialize/serialize_stage0.rs +++ b/src/libserialize/serialize_stage0.rs @@ -378,13 +378,13 @@ impl> Decodable for () { } } -impl<'a, E, S: Encoder, Sized? T: Encodable> Encodable for &'a T { +impl<'a, E, S: Encoder, T: ?Sized + Encodable> Encodable for &'a T { fn encode(&self, s: &mut S) -> Result<(), E> { (**self).encode(s) } } -impl, Sized? T: Encodable> Encodable for Box { +impl, T: ?Sized + Encodable> Encodable for Box { fn encode(&self, s: &mut S) -> Result<(), E> { (**self).encode(s) } diff --git a/src/libstd/c_str.rs b/src/libstd/c_str.rs index 9c96a9cac78..c8a59ce6bba 100644 --- a/src/libstd/c_str.rs +++ b/src/libstd/c_str.rs @@ -430,7 +430,7 @@ impl ToCStr for [u8] { } } -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() diff --git a/src/libstd/collections/hash/map.rs b/src/libstd/collections/hash/map.rs index a6532707f3e..300fc849ace 100644 --- a/src/libstd/collections/hash/map.rs +++ b/src/libstd/collections/hash/map.rs @@ -440,14 +440,14 @@ impl SearchResult { } impl, V, S, H: Hasher> HashMap { - fn make_hash>(&self, x: &X) -> SafeHash { + fn make_hash>(&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> + fn search<'a, Q: ?Sized>(&'a self, q: &Q) -> Option> where Q: BorrowFrom + Eq + Hash { let hash = self.make_hash(q); @@ -455,7 +455,7 @@ impl, V, S, H: Hasher> HashMap { .into_option() } - fn search_mut<'a, Sized? Q>(&'a mut self, q: &Q) -> Option> + fn search_mut<'a, Q: ?Sized>(&'a mut self, q: &Q) -> Option> where Q: BorrowFrom + Eq + Hash { let hash = self.make_hash(q); @@ -923,7 +923,7 @@ impl, V, S, H: Hasher> HashMap { #[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 + ToOwned { // Gotta resize now. @@ -1030,7 +1030,7 @@ impl, V, S, H: Hasher> HashMap { /// assert_eq!(map.get(&2), None); /// ``` #[stable] - pub fn get(&self, k: &Q) -> Option<&V> + pub fn get(&self, k: &Q) -> Option<&V> where Q: Hash + Eq + BorrowFrom { self.search(k).map(|bucket| bucket.into_refs().1) @@ -1053,7 +1053,7 @@ impl, V, S, H: Hasher> HashMap { /// assert_eq!(map.contains_key(&2), false); /// ``` #[stable] - pub fn contains_key(&self, k: &Q) -> bool + pub fn contains_key(&self, k: &Q) -> bool where Q: Hash + Eq + BorrowFrom { self.search(k).is_some() @@ -1079,7 +1079,7 @@ impl, V, S, H: Hasher> HashMap { /// assert_eq!(map[1], "b"); /// ``` #[stable] - pub fn get_mut(&mut self, k: &Q) -> Option<&mut V> + pub fn get_mut(&mut self, k: &Q) -> Option<&mut V> where Q: Hash + Eq + BorrowFrom { self.search_mut(k).map(|bucket| bucket.into_mut_refs().1) @@ -1131,7 +1131,7 @@ impl, V, S, H: Hasher> HashMap { /// assert_eq!(map.remove(&1), None); /// ``` #[stable] - pub fn remove(&mut self, k: &Q) -> Option + pub fn remove(&mut self, k: &Q) -> Option where Q: Hash + Eq + BorrowFrom { if self.table.size() == 0 { @@ -1142,7 +1142,7 @@ impl, V, S, H: Hasher> HashMap { } } -fn search_entry_hashed<'a, K, V, Sized? Q>(table: &'a mut RawTable, hash: SafeHash, k: &'a Q) +fn search_entry_hashed<'a, K, V, Q: ?Sized>(table: &'a mut RawTable, hash: SafeHash, k: &'a Q) -> Entry<'a, Q, K, V> where Q: Eq + ToOwned { @@ -1229,7 +1229,7 @@ impl, V, S, H: Hasher + Default> Default for HashMap // NOTE(stage0): remove impl after a snapshot #[cfg(stage0)] #[stable] -impl + Eq, Sized? Q, V, S, H: Hasher> Index for HashMap +impl + Eq, Q: ?Sized, V, S, H: Hasher> Index for HashMap where Q: BorrowFrom + Hash + Eq { #[inline] @@ -1240,7 +1240,7 @@ impl + Eq, Sized? Q, V, S, H: Hasher> Index for HashMap + Eq, Sized? Q, V, S, H: Hasher> Index for HashMap +impl + Eq, Q: ?Sized, V, S, H: Hasher> Index for HashMap where Q: BorrowFrom + Hash + Eq { type Output = V; @@ -1254,7 +1254,7 @@ impl + Eq, Sized? Q, V, S, H: Hasher> Index for HashMap + Eq, Sized? Q, V, S, H: Hasher> IndexMut for HashMap +impl + Eq, Q: ?Sized, V, S, H: Hasher> IndexMut for HashMap where Q: BorrowFrom + Hash + Eq { #[inline] @@ -1265,7 +1265,7 @@ impl + Eq, Sized? Q, V, S, H: Hasher> IndexMut for HashMap + Eq, Sized? Q, V, S, H: Hasher> IndexMut for HashMap +impl + Eq, Q: ?Sized, V, S, H: Hasher> IndexMut for HashMap where Q: BorrowFrom + Hash + 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>, @@ -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 @@ impl<'a, K: 'a, V: 'a> Iterator for Drain<'a, K, V> { } } -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 @@ impl<'a, K, V> OccupiedEntry<'a, K, V> { } } -impl<'a, Sized? Q: 'a + ToOwned, K: 'a, V: 'a> VacantEntry<'a, Q, K, V> { +impl<'a, Q: ?Sized + 'a + ToOwned, 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 diff --git a/src/libstd/collections/hash/set.rs b/src/libstd/collections/hash/set.rs index b1824db93aa..f77eaa237c1 100644 --- a/src/libstd/collections/hash/set.rs +++ b/src/libstd/collections/hash/set.rs @@ -451,7 +451,7 @@ impl, S, H: Hasher> HashSet { /// assert_eq!(set.contains(&4), false); /// ``` #[stable] - pub fn contains(&self, value: &Q) -> bool + pub fn contains(&self, value: &Q) -> bool where Q: BorrowFrom + Hash + Eq { self.map.contains_key(value) @@ -561,7 +561,7 @@ impl, S, H: Hasher> HashSet { /// assert_eq!(set.remove(&2), false); /// ``` #[stable] - pub fn remove(&mut self, value: &Q) -> bool + pub fn remove(&mut self, value: &Q) -> bool where Q: BorrowFrom + Hash + Eq { self.map.remove(value).is_some() diff --git a/src/libstd/collections/hash/table.rs b/src/libstd/collections/hash/table.rs index ab91beb4f9b..1eb4408eedc 100644 --- a/src/libstd/collections/hash/table.rs +++ b/src/libstd/collections/hash/table.rs @@ -138,7 +138,7 @@ impl SafeHash { /// 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, S, H: Hasher>(hasher: &H, t: &T) -> SafeHash { +pub fn make_hash, S, H: Hasher>(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, diff --git a/src/libstd/hash.rs b/src/libstd/hash.rs index cdd0e9bf76f..ac2b01e995e 100644 --- a/src/libstd/hash.rs +++ b/src/libstd/hash.rs @@ -90,7 +90,7 @@ impl RandomSipHasher { impl Hasher for RandomSipHasher { #[inline] - fn hash>(&self, value: &T) -> u64 { + fn hash>(&self, value: &T) -> u64 { self.hasher.hash(value) } } diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index 3fa0b5645c5..66416a21dd9 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -1012,12 +1012,12 @@ pub trait Writer { 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 @@ pub trait Acceptor { /// `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> Iterator for IncomingConnections<'a, A> { +impl<'a, T, A: ?Sized + Acceptor> Iterator for IncomingConnections<'a, A> { type Item = IoResult; fn next(&mut self) -> Option> { diff --git a/src/libstd/path/mod.rs b/src/libstd/path/mod.rs index bf9ffbffe7d..4f37e8a978a 100644 --- a/src/libstd/path/mod.rs +++ b/src/libstd/path/mod.rs @@ -896,7 +896,7 @@ impl BytesContainer for CString { } } -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() diff --git a/src/libstd/path/posix.rs b/src/libstd/path/posix.rs index ae82e201cb8..777315b3ed6 100644 --- a/src/libstd/path/posix.rs +++ b/src/libstd/path/posix.rs @@ -344,7 +344,7 @@ impl Path { /// Returns a normalized byte vector representation of a path, by removing all empty /// components, and unnecessary . and .. components. - fn normalize>(v: &V) -> Vec { + fn normalize>(v: &V) -> Vec { // borrowck is being very picky let val = { let is_abs = !v.as_slice().is_empty() && v.as_slice()[0] == SEP_BYTE; diff --git a/src/libsyntax/parse/obsolete.rs b/src/libsyntax/parse/obsolete.rs index d1b6034457d..299cf7e941b 100644 --- a/src/libsyntax/parse/obsolete.rs +++ b/src/libsyntax/parse/obsolete.rs @@ -95,7 +95,7 @@ impl<'a> ParserObsoleteMethods for parser::Parser<'a> { "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" ), }; diff --git a/src/libsyntax/util/interner.rs b/src/libsyntax/util/interner.rs index 5f416a867e8..85eea2d9daf 100644 --- a/src/libsyntax/util/interner.rs +++ b/src/libsyntax/util/interner.rs @@ -77,7 +77,7 @@ impl Interner { (*vect).len() } - pub fn find(&self, val: &Q) -> Option + pub fn find(&self, val: &Q) -> Option where Q: BorrowFrom + Eq + Hash { let map = self.map.borrow(); match (*map).get(val) { @@ -202,7 +202,7 @@ impl StrInterner { self.vect.borrow().len() } - pub fn find(&self, val: &Q) -> Option + pub fn find(&self, val: &Q) -> Option where Q: BorrowFrom + Eq + Hash { match (*self.map.borrow()).get(val) { Some(v) => Some(*v), diff --git a/src/test/compile-fail/associated-types-unsized.rs b/src/test/compile-fail/associated-types-unsized.rs index 47ab09d279f..2ab3ec1aead 100644 --- a/src/test/compile-fail/associated-types-unsized.rs +++ b/src/test/compile-fail/associated-types-unsized.rs @@ -11,7 +11,7 @@ #![feature(associated_types)] trait Get { - type Sized? Value; + type Value: ?Sized; fn get(&self) -> ::Value; } diff --git a/src/test/compile-fail/dst-bad-assign-2.rs b/src/test/compile-fail/dst-bad-assign-2.rs index fcc08cfcb16..5e360b6ab9b 100644 --- a/src/test/compile-fail/dst-bad-assign-2.rs +++ b/src/test/compile-fail/dst-bad-assign-2.rs @@ -10,7 +10,7 @@ // Forbid assignment into a dynamically sized type. -struct Fat { +struct Fat { f1: int, f2: &'static str, ptr: T diff --git a/src/test/compile-fail/dst-bad-assign.rs b/src/test/compile-fail/dst-bad-assign.rs index eb54f3f8e78..cc709be9900 100644 --- a/src/test/compile-fail/dst-bad-assign.rs +++ b/src/test/compile-fail/dst-bad-assign.rs @@ -10,7 +10,7 @@ // Forbid assignment into a dynamically sized type. -struct Fat { +struct Fat { f1: int, f2: &'static str, ptr: T diff --git a/src/test/compile-fail/dst-bad-coerce1.rs b/src/test/compile-fail/dst-bad-coerce1.rs index c77ae25e0cf..75bd94331b1 100644 --- a/src/test/compile-fail/dst-bad-coerce1.rs +++ b/src/test/compile-fail/dst-bad-coerce1.rs @@ -10,7 +10,7 @@ // Attempt to change the type as well as unsizing. -struct Fat { +struct Fat { ptr: T } diff --git a/src/test/compile-fail/dst-bad-coerce2.rs b/src/test/compile-fail/dst-bad-coerce2.rs index 6eb650e9781..54c625221ba 100644 --- a/src/test/compile-fail/dst-bad-coerce2.rs +++ b/src/test/compile-fail/dst-bad-coerce2.rs @@ -10,7 +10,7 @@ // Attempt to change the mutability as well as unsizing. -struct Fat { +struct Fat { ptr: T } diff --git a/src/test/compile-fail/dst-bad-coerce3.rs b/src/test/compile-fail/dst-bad-coerce3.rs index b0bd5176374..192d43e32fd 100644 --- a/src/test/compile-fail/dst-bad-coerce3.rs +++ b/src/test/compile-fail/dst-bad-coerce3.rs @@ -10,7 +10,7 @@ // Attempt to extend the lifetime as well as unsizing. -struct Fat { +struct Fat { ptr: T } diff --git a/src/test/compile-fail/dst-bad-coerce4.rs b/src/test/compile-fail/dst-bad-coerce4.rs index 783a32d6302..53ce18c73a0 100644 --- a/src/test/compile-fail/dst-bad-coerce4.rs +++ b/src/test/compile-fail/dst-bad-coerce4.rs @@ -10,7 +10,7 @@ // Attempt to coerce from unsized to sized. -struct Fat { +struct Fat { ptr: T } diff --git a/src/test/compile-fail/dst-bad-coercions.rs b/src/test/compile-fail/dst-bad-coercions.rs index c3a814e3f44..b30eada162b 100644 --- a/src/test/compile-fail/dst-bad-coercions.rs +++ b/src/test/compile-fail/dst-bad-coercions.rs @@ -14,7 +14,7 @@ struct S; trait T {} impl T for S {} -struct Foo { +struct Foo { f: T } diff --git a/src/test/compile-fail/dst-bad-deep.rs b/src/test/compile-fail/dst-bad-deep.rs index 0833a74f1da..b169824cb3a 100644 --- a/src/test/compile-fail/dst-bad-deep.rs +++ b/src/test/compile-fail/dst-bad-deep.rs @@ -13,7 +13,7 @@ // because it would require stack allocation of an unsized temporary (*g in the // test). -struct Fat { +struct Fat { ptr: T } diff --git a/src/test/compile-fail/dst-object-from-unsized-type.rs b/src/test/compile-fail/dst-object-from-unsized-type.rs index 99c63c3c6e9..c331b02c7cc 100644 --- a/src/test/compile-fail/dst-object-from-unsized-type.rs +++ b/src/test/compile-fail/dst-object-from-unsized-type.rs @@ -13,12 +13,12 @@ trait Foo for Sized? {} impl Foo for str {} -fn test1(t: &T) { +fn test1(t: &T) { let u: &Foo = t; //~^ ERROR `core::kinds::Sized` is not implemented for the type `T` } -fn test2(t: &T) { +fn test2(t: &T) { let v: &Foo = t as &Foo; //~^ ERROR `core::kinds::Sized` is not implemented for the type `T` } diff --git a/src/test/compile-fail/transmute-fat-pointers.rs b/src/test/compile-fail/transmute-fat-pointers.rs index 5e81a4cec22..31456853e1c 100644 --- a/src/test/compile-fail/transmute-fat-pointers.rs +++ b/src/test/compile-fail/transmute-fat-pointers.rs @@ -14,11 +14,11 @@ use std::mem::transmute; -fn a(x: &[T]) -> &U { +fn a(x: &[T]) -> &U { unsafe { transmute(x) } //~ ERROR transmute called on types with potentially different sizes } -fn b(x: &T) -> &U { +fn b(x: &T) -> &U { unsafe { transmute(x) } //~ ERROR transmute called on types with potentially different sizes } @@ -30,11 +30,11 @@ fn d(x: &[T]) -> &[U] { unsafe { transmute(x) } } -fn e(x: &T) -> &U { +fn e(x: &T) -> &U { unsafe { transmute(x) } //~ ERROR transmute called on types with potentially different sizes } -fn f(x: &T) -> &U { +fn f(x: &T) -> &U { unsafe { transmute(x) } //~ ERROR transmute called on types with potentially different sizes } diff --git a/src/test/compile-fail/transmute-impl.rs b/src/test/compile-fail/transmute-impl.rs index 8b5a8c679b2..a68bba285df 100644 --- a/src/test/compile-fail/transmute-impl.rs +++ b/src/test/compile-fail/transmute-impl.rs @@ -14,11 +14,11 @@ use std::mem::transmute; -struct Foo { +struct Foo { t: Box } -impl Foo { +impl Foo { fn m(x: &T) -> &int where T : Sized { // OK here, because T : Sized is in scope. unsafe { transmute(x) } diff --git a/src/test/compile-fail/unboxed-closure-sugar-default.rs b/src/test/compile-fail/unboxed-closure-sugar-default.rs index 06a93406392..81cfcf5cde9 100644 --- a/src/test/compile-fail/unboxed-closure-sugar-default.rs +++ b/src/test/compile-fail/unboxed-closure-sugar-default.rs @@ -18,9 +18,9 @@ trait Foo { fn dummy(&self, t: T, u: U, v: V); } -trait Eq for Sized? { } -impl Eq for X { } -fn eq() where A : Eq { } +trait Eq for Sized? { } +impl Eq for X { } +fn eq() where A : Eq { } fn test<'a,'b>() { // Parens are equivalent to omitting default in angle. diff --git a/src/test/compile-fail/unboxed-closure-sugar-equiv.rs b/src/test/compile-fail/unboxed-closure-sugar-equiv.rs index 16d6b217872..368cb189907 100644 --- a/src/test/compile-fail/unboxed-closure-sugar-equiv.rs +++ b/src/test/compile-fail/unboxed-closure-sugar-equiv.rs @@ -20,9 +20,9 @@ trait Foo { fn dummy(&self, t: T, u: U); } -trait Eq for Sized? { } -impl Eq for X { } -fn eq>() { } +trait Eq for Sized? { } +impl Eq for X { } +fn eq>() { } fn test<'a,'b>() { // No errors expected: diff --git a/src/test/compile-fail/unboxed-closure-sugar-lifetime-elision.rs b/src/test/compile-fail/unboxed-closure-sugar-lifetime-elision.rs index e08d84944c0..8c85382f45e 100644 --- a/src/test/compile-fail/unboxed-closure-sugar-lifetime-elision.rs +++ b/src/test/compile-fail/unboxed-closure-sugar-lifetime-elision.rs @@ -20,9 +20,9 @@ trait Foo { fn dummy(&self, t: T, u: U); } -trait Eq for Sized? { } -impl Eq for X { } -fn eq>() { } +trait Eq for Sized? { } +impl Eq for X { } +fn eq>() { } fn main() { eq::< for<'a> Foo<(&'a int,), &'a int>, diff --git a/src/test/compile-fail/unboxed-closure-sugar-region.rs b/src/test/compile-fail/unboxed-closure-sugar-region.rs index a938f126c16..c99e7a11632 100644 --- a/src/test/compile-fail/unboxed-closure-sugar-region.rs +++ b/src/test/compile-fail/unboxed-closure-sugar-region.rs @@ -21,9 +21,9 @@ trait Foo<'a,T,U> { fn dummy(&'a self) -> &'a (T,U); } -trait Eq for Sized? { } -impl Eq for X { } -fn eq>() { } +trait Eq for Sized? { } +impl Eq for X { } +fn eq>() { } fn same_type>(a: A, b: B) { } diff --git a/src/test/compile-fail/unsized-bare-typaram.rs b/src/test/compile-fail/unsized-bare-typaram.rs index 7b5d4295411..2de490e018b 100644 --- a/src/test/compile-fail/unsized-bare-typaram.rs +++ b/src/test/compile-fail/unsized-bare-typaram.rs @@ -9,5 +9,5 @@ // except according to those terms. fn bar() { } -fn foo() { bar::() } //~ ERROR the trait `core::kinds::Sized` is not implemented +fn foo() { bar::() } //~ ERROR the trait `core::kinds::Sized` is not implemented fn main() { } diff --git a/src/test/compile-fail/unsized-enum.rs b/src/test/compile-fail/unsized-enum.rs index 0462a2025d2..aea236c9268 100644 --- a/src/test/compile-fail/unsized-enum.rs +++ b/src/test/compile-fail/unsized-enum.rs @@ -10,18 +10,18 @@ fn is_sized() { } -fn not_sized() { } +fn not_sized() { } enum Foo { FooSome(U), FooNone } fn foo1() { not_sized::>() } // Hunky dory. -fn foo2() { not_sized::>() } +fn foo2() { not_sized::>() } //~^ ERROR the trait `core::kinds::Sized` is not implemented // // Not OK: `T` is not sized. -enum Bar { BarSome(U), BarNone } -fn bar1() { not_sized::>() } -fn bar2() { is_sized::>() } +enum Bar { BarSome(U), BarNone } +fn bar1() { not_sized::>() } +fn bar2() { is_sized::>() } //~^ ERROR the trait `core::kinds::Sized` is not implemented // // Not OK: `Bar` is not sized, but it should be. diff --git a/src/test/compile-fail/unsized-inherent-impl-self-type.rs b/src/test/compile-fail/unsized-inherent-impl-self-type.rs index 2c8a2b361d5..8740346a217 100644 --- a/src/test/compile-fail/unsized-inherent-impl-self-type.rs +++ b/src/test/compile-fail/unsized-inherent-impl-self-type.rs @@ -14,7 +14,7 @@ struct S5; -impl S5 { //~ ERROR not implemented +impl S5 { //~ ERROR not implemented } fn main() { } diff --git a/src/test/compile-fail/unsized-struct.rs b/src/test/compile-fail/unsized-struct.rs index db2e9cb9328..89c71103697 100644 --- a/src/test/compile-fail/unsized-struct.rs +++ b/src/test/compile-fail/unsized-struct.rs @@ -10,18 +10,18 @@ fn is_sized() { } -fn not_sized() { } +fn not_sized() { } struct Foo { data: T } fn foo1() { not_sized::>() } // Hunky dory. -fn foo2() { not_sized::>() } +fn foo2() { not_sized::>() } //~^ ERROR the trait `core::kinds::Sized` is not implemented // // Not OK: `T` is not sized. -struct Bar { data: T } -fn bar1() { not_sized::>() } -fn bar2() { is_sized::>() } +struct Bar { data: T } +fn bar1() { not_sized::>() } +fn bar2() { is_sized::>() } //~^ ERROR the trait `core::kinds::Sized` is not implemented // // Not OK: `Bar` is not sized, but it should be. diff --git a/src/test/compile-fail/unsized-trait-impl-self-type.rs b/src/test/compile-fail/unsized-trait-impl-self-type.rs index 0f0a97fab4d..3dd55b0ba7d 100644 --- a/src/test/compile-fail/unsized-trait-impl-self-type.rs +++ b/src/test/compile-fail/unsized-trait-impl-self-type.rs @@ -11,12 +11,12 @@ // Test sized-ness checking in substitution in impls. // impl - struct -trait T3 { +trait T3 { } struct S5; -impl T3 for S5 { //~ ERROR not implemented +impl T3 for S5 { //~ ERROR not implemented } fn main() { } diff --git a/src/test/compile-fail/unsized-trait-impl-trait-arg.rs b/src/test/compile-fail/unsized-trait-impl-trait-arg.rs index bdb652b168a..7ae74fc2600 100644 --- a/src/test/compile-fail/unsized-trait-impl-trait-arg.rs +++ b/src/test/compile-fail/unsized-trait-impl-trait-arg.rs @@ -13,8 +13,8 @@ // impl - unbounded trait T2 { } -struct S4; -impl T2 for S4 { +struct S4; +impl T2 for S4 { //~^ ERROR `core::kinds::Sized` is not implemented for the type `X` } diff --git a/src/test/compile-fail/unsized3.rs b/src/test/compile-fail/unsized3.rs index 0a75240f2d8..02c0fd61892 100644 --- a/src/test/compile-fail/unsized3.rs +++ b/src/test/compile-fail/unsized3.rs @@ -12,7 +12,7 @@ // Unbounded. -fn f1(x: &X) { +fn f1(x: &X) { f2::(x); //~^ ERROR the trait `core::kinds::Sized` is not implemented } @@ -21,7 +21,7 @@ fn f2(x: &X) { // Bounded. trait T for Sized? {} -fn f3(x: &X) { +fn f3(x: &X) { f4::(x); //~^ ERROR the trait `core::kinds::Sized` is not implemented } @@ -29,13 +29,13 @@ fn f4(x: &X) { } // Test with unsized enum. -enum E { +enum E { V(X), } fn f5(x: &Y) {} -fn f6(x: &X) {} -fn f7(x1: &E, x2: &E) { +fn f6(x: &X) {} +fn f7(x1: &E, x2: &E) { f5(x1); //~^ ERROR the trait `core::kinds::Sized` is not implemented f6(x2); // ok @@ -43,23 +43,23 @@ fn f7(x1: &E, x2: &E) { // Test with unsized struct. -struct S { +struct S { x: X, } -fn f8(x1: &S, x2: &S) { +fn f8(x1: &S, x2: &S) { f5(x1); //~^ ERROR the trait `core::kinds::Sized` is not implemented f6(x2); // ok } // Test some tuples. -fn f9(x1: Box>, x2: Box>) { +fn f9(x1: Box>, x2: Box>) { f5(&(*x1, 34i)); //~^ ERROR the trait `core::kinds::Sized` is not implemented } -fn f10(x1: Box>, x2: Box>) { +fn f10(x1: Box>, x2: Box>) { f5(&(32i, *x2)); //~^ ERROR the trait `core::kinds::Sized` is not implemented } diff --git a/src/test/compile-fail/unsized4.rs b/src/test/compile-fail/unsized4.rs index f9ece8e6843..f8b8ad2bf2e 100644 --- a/src/test/compile-fail/unsized4.rs +++ b/src/test/compile-fail/unsized4.rs @@ -11,7 +11,7 @@ // Test that bounds are sized-compatible. trait T : Sized {} -fn f() { +fn f() { //~^ERROR incompatible bounds on `Y`, bound `T` does not allow unsized type } diff --git a/src/test/compile-fail/unsized5.rs b/src/test/compile-fail/unsized5.rs index d9d7a86889f..f7477d746fa 100644 --- a/src/test/compile-fail/unsized5.rs +++ b/src/test/compile-fail/unsized5.rs @@ -10,11 +10,11 @@ // Test `Sized?` types not allowed in fields (except the last one). -struct S1 { +struct S1 { f1: X, //~ ERROR `core::kinds::Sized` is not implemented f2: int, } -struct S2 { +struct S2 { 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 { +enum E { V1(X, int), //~ERROR `core::kinds::Sized` is not implemented } -enum F { +enum F { V2{f1: X, f: int}, //~ERROR `core::kinds::Sized` is not implemented } diff --git a/src/test/compile-fail/unsized6.rs b/src/test/compile-fail/unsized6.rs index 0efd178f75b..019d3475502 100644 --- a/src/test/compile-fail/unsized6.rs +++ b/src/test/compile-fail/unsized6.rs @@ -13,30 +13,30 @@ trait T for Sized? {} -fn f1(x: &X) { +fn f1(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(x: &X) { +fn f2(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(x1: Box, x2: Box, x3: Box) { +fn f3(x1: Box, x2: Box, x3: Box) { 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(x1: Box, x2: Box, x3: Box) { +fn f4(x1: Box, x2: Box, x3: Box) { 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(x: X) {} //~ERROR the trait `core::kinds::Sized` is not implemented -fn g2(x: X) {} //~ERROR the trait `core::kinds::Sized` is not implemented +fn g1(x: X) {} //~ERROR the trait `core::kinds::Sized` is not implemented +fn g2(x: X) {} //~ERROR the trait `core::kinds::Sized` is not implemented pub fn main() { } diff --git a/src/test/compile-fail/unsized7.rs b/src/test/compile-fail/unsized7.rs index c0e6ae1db92..af64afb23b9 100644 --- a/src/test/compile-fail/unsized7.rs +++ b/src/test/compile-fail/unsized7.rs @@ -16,8 +16,8 @@ trait T for Sized? {} // impl - bounded trait T1 { } -struct S3; -impl T1 for S3 { +struct S3; +impl T1 for S3 { //~^ ERROR `core::kinds::Sized` is not implemented for the type `X` } diff --git a/src/test/run-pass-valgrind/dst-dtor-1.rs b/src/test/run-pass-valgrind/dst-dtor-1.rs index 6e2ae117ce7..8b8b7f169c5 100644 --- a/src/test/run-pass-valgrind/dst-dtor-1.rs +++ b/src/test/run-pass-valgrind/dst-dtor-1.rs @@ -20,7 +20,7 @@ impl Drop for Foo { trait Trait {} impl Trait for Foo {} -struct Fat { +struct Fat { f: T } diff --git a/src/test/run-pass-valgrind/dst-dtor-2.rs b/src/test/run-pass-valgrind/dst-dtor-2.rs index deaf49228bc..743293c23f6 100644 --- a/src/test/run-pass-valgrind/dst-dtor-2.rs +++ b/src/test/run-pass-valgrind/dst-dtor-2.rs @@ -17,7 +17,7 @@ impl Drop for Foo { } } -struct Fat { +struct Fat { f: T } diff --git a/src/test/run-pass/associated-types-conditional-dispatch.rs b/src/test/run-pass/associated-types-conditional-dispatch.rs index 3b53203d218..f7032da82a1 100644 --- a/src/test/run-pass/associated-types-conditional-dispatch.rs +++ b/src/test/run-pass/associated-types-conditional-dispatch.rs @@ -18,7 +18,7 @@ use std::ops::Deref; -pub trait MyEq for Sized? { +pub trait MyEq for Sized? { fn eq(&self, u: &U) -> bool; } diff --git a/src/test/run-pass/issue-18906.rs b/src/test/run-pass/issue-18906.rs index e82359bc168..11ffb4198da 100644 --- a/src/test/run-pass/issue-18906.rs +++ b/src/test/run-pass/issue-18906.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -pub trait Borrow { +pub trait Borrow { fn borrow(&self) -> &Borrowed; }