From 3ed7f067dc0319cd9e7bb6a8253ba031d0bdf1f3 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Mon, 5 Jan 2015 14:01:31 -0500 Subject: [PATCH] Fix fallout in libs. For the most part I just tagged impls as `#[old_impl_check]`. --- src/libcollections/btree/node.rs | 3 ++- src/libcollections/lib.rs | 1 + src/librustc/lib.rs | 1 + src/librustc/util/ppaux.rs | 1 + src/libserialize/collection_impls.rs | 4 ++++ src/libserialize/lib.rs | 1 + src/libstd/collections/hash/map.rs | 10 ++++++++++ src/libstd/collections/hash/set.rs | 15 +++++++++++++++ src/libstd/io/mod.rs | 1 + src/libstd/lib.rs | 1 + src/libsyntax/ast.rs | 4 ++-- 11 files changed, 39 insertions(+), 3 deletions(-) diff --git a/src/libcollections/btree/node.rs b/src/libcollections/btree/node.rs index 0a93bbf89c99..1c646032bf15 100644 --- a/src/libcollections/btree/node.rs +++ b/src/libcollections/btree/node.rs @@ -1417,7 +1417,7 @@ pub type MutTraversal<'a, K, V> = AbsTraversal = AbsTraversal>; - +#[old_impl_check] impl> Iterator for AbsTraversal { type Item = TraversalItem; @@ -1433,6 +1433,7 @@ impl> Iterator for AbsTraversal { } } +#[old_impl_check] impl> DoubleEndedIterator for AbsTraversal { fn next_back(&mut self) -> Option> { let tail_is_edge = self.tail_is_edge; diff --git a/src/libcollections/lib.rs b/src/libcollections/lib.rs index 5bf5f78af94c..00d3e795f743 100644 --- a/src/libcollections/lib.rs +++ b/src/libcollections/lib.rs @@ -26,6 +26,7 @@ #![feature(unsafe_destructor, slicing_syntax)] #![feature(unboxed_closures)] #![feature(old_orphan_check)] +#![feature(old_impl_check)] #![feature(associated_types)] #![no_std] diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs index 3ed712b15dfd..d22e3208bbef 100644 --- a/src/librustc/lib.rs +++ b/src/librustc/lib.rs @@ -28,6 +28,7 @@ #![feature(rustc_diagnostic_macros)] #![feature(unboxed_closures)] #![feature(old_orphan_check)] +#![feature(old_impl_check)] #![feature(associated_types)] extern crate arena; diff --git a/src/librustc/util/ppaux.rs b/src/librustc/util/ppaux.rs index 8c2a9993004d..e5e425c9c269 100644 --- a/src/librustc/util/ppaux.rs +++ b/src/librustc/util/ppaux.rs @@ -1349,6 +1349,7 @@ impl<'tcx, T:Repr<'tcx>> Repr<'tcx> for ty::Binder { } } +#[old_impl_check] impl<'tcx, S, H, K, V> Repr<'tcx> for HashMap where K : Hash + Eq + Repr<'tcx>, V : Repr<'tcx>, diff --git a/src/libserialize/collection_impls.rs b/src/libserialize/collection_impls.rs index 7ba329c518e9..d89a4754d2ef 100644 --- a/src/libserialize/collection_impls.rs +++ b/src/libserialize/collection_impls.rs @@ -156,6 +156,7 @@ impl< } } +#[old_impl_check] impl< K: Encodable + Hash + Eq, V: Encodable, @@ -175,6 +176,7 @@ impl< } } +#[old_impl_check] impl< K: Decodable + Hash + Eq, V: Decodable, @@ -195,6 +197,7 @@ impl< } } +#[old_impl_check] impl< T: Encodable + Hash + Eq, X, @@ -212,6 +215,7 @@ impl< } } +#[old_impl_check] impl< T: Decodable + Hash + Eq, S, diff --git a/src/libserialize/lib.rs b/src/libserialize/lib.rs index 8fe15f00ded7..ee94095bd158 100644 --- a/src/libserialize/lib.rs +++ b/src/libserialize/lib.rs @@ -26,6 +26,7 @@ Core encoding and decoding interfaces. #![feature(macro_rules, default_type_params, phase, slicing_syntax, globs)] #![feature(unboxed_closures)] #![feature(associated_types)] +#![feature(old_impl_check)] // test harness access #[cfg(test)] diff --git a/src/libstd/collections/hash/map.rs b/src/libstd/collections/hash/map.rs index a3fc38c34e84..5372c51f95ff 100644 --- a/src/libstd/collections/hash/map.rs +++ b/src/libstd/collections/hash/map.rs @@ -439,6 +439,7 @@ impl SearchResult { } } +#[old_impl_check] impl, V, S, H: Hasher> HashMap { fn make_hash>(&self, x: &X) -> SafeHash { table::make_hash(&self.hasher, x) @@ -517,6 +518,7 @@ impl HashMap { } } +#[old_impl_check] impl, V, S, H: Hasher> HashMap { /// Creates an empty hashmap which will use the given hasher to hash keys. /// @@ -1191,6 +1193,7 @@ fn search_entry_hashed<'a, K, V, Q: ?Sized>(table: &'a mut RawTable, hash: } #[stable] +#[old_impl_check] impl, V: PartialEq, S, H: Hasher> PartialEq for HashMap { fn eq(&self, other: &HashMap) -> bool { if self.len() != other.len() { return false; } @@ -1202,9 +1205,11 @@ impl, V: PartialEq, S, H: Hasher> PartialEq for HashMap, V: Eq, S, H: Hasher> Eq for HashMap {} #[stable] +#[old_impl_check] impl + Show, V: Show, S, H: Hasher> Show for HashMap { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { try!(write!(f, "{{")); @@ -1219,6 +1224,7 @@ impl + Show, V: Show, S, H: Hasher> Show for HashMap } #[stable] +#[old_impl_check] impl, V, S, H: Hasher + Default> Default for HashMap { #[stable] fn default() -> HashMap { @@ -1227,6 +1233,7 @@ impl, V, S, H: Hasher + Default> Default for HashMap } #[stable] +#[old_impl_check] impl + Eq, Q: ?Sized, V, S, H: Hasher> Index for HashMap where Q: BorrowFrom + Hash + Eq { @@ -1239,6 +1246,7 @@ impl + Eq, Q: ?Sized, V, S, H: Hasher> Index for HashMap + Eq, Q: ?Sized, V, S, H: Hasher> IndexMut for HashMap where Q: BorrowFrom + Hash + Eq { @@ -1472,6 +1480,7 @@ impl<'a, Q: ?Sized + 'a + ToOwned, K: 'a, V: 'a> VacantEntry<'a, Q, K, V> { } #[stable] +#[old_impl_check] impl, V, S, H: Hasher + Default> FromIterator<(K, V)> for HashMap { fn from_iter>(iter: T) -> HashMap { let lower = iter.size_hint().0; @@ -1482,6 +1491,7 @@ impl, V, S, H: Hasher + Default> FromIterator<(K, V)> for Has } #[stable] +#[old_impl_check] impl, V, S, H: Hasher> Extend<(K, V)> for HashMap { fn extend>(&mut self, mut iter: T) { for (k, v) in iter { diff --git a/src/libstd/collections/hash/set.rs b/src/libstd/collections/hash/set.rs index 211bfe2c10e8..1b3d401fb843 100644 --- a/src/libstd/collections/hash/set.rs +++ b/src/libstd/collections/hash/set.rs @@ -128,6 +128,7 @@ impl HashSet { } } +#[old_impl_check] impl, S, H: Hasher> HashSet { /// Creates a new empty hash set which will use the given hasher to hash /// keys. @@ -571,6 +572,7 @@ impl, S, H: Hasher> HashSet { } #[stable] +#[old_impl_check] impl, S, H: Hasher> PartialEq for HashSet { fn eq(&self, other: &HashSet) -> bool { if self.len() != other.len() { return false; } @@ -580,9 +582,11 @@ impl, S, H: Hasher> PartialEq for HashSet { } #[stable] +#[old_impl_check] impl, S, H: Hasher> Eq for HashSet {} #[stable] +#[old_impl_check] impl + fmt::Show, S, H: Hasher> fmt::Show for HashSet { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { try!(write!(f, "{{")); @@ -597,6 +601,7 @@ impl + fmt::Show, S, H: Hasher> fmt::Show for HashSet { } #[stable] +#[old_impl_check] impl, S, H: Hasher + Default> FromIterator for HashSet { fn from_iter>(iter: I) -> HashSet { let lower = iter.size_hint().0; @@ -607,6 +612,7 @@ impl, S, H: Hasher + Default> FromIterator for HashSet, S, H: Hasher> Extend for HashSet { fn extend>(&mut self, mut iter: I) { for k in iter { @@ -616,6 +622,7 @@ impl, S, H: Hasher> Extend for HashSet { } #[stable] +#[old_impl_check] impl, S, H: Hasher + Default> Default for HashSet { #[stable] fn default() -> HashSet { @@ -624,6 +631,7 @@ impl, S, H: Hasher + Default> Default for HashSet { } #[stable] +#[old_impl_check] impl<'a, 'b, T: Eq + Hash + Clone, S, H: Hasher + Default> BitOr<&'b HashSet> for &'a HashSet { type Output = HashSet; @@ -654,6 +662,7 @@ BitOr<&'b HashSet> for &'a HashSet { } #[stable] +#[old_impl_check] impl<'a, 'b, T: Eq + Hash + Clone, S, H: Hasher + Default> BitAnd<&'b HashSet> for &'a HashSet { type Output = HashSet; @@ -684,6 +693,7 @@ BitAnd<&'b HashSet> for &'a HashSet { } #[stable] +#[old_impl_check] impl<'a, 'b, T: Eq + Hash + Clone, S, H: Hasher + Default> BitXor<&'b HashSet> for &'a HashSet { type Output = HashSet; @@ -714,6 +724,7 @@ BitXor<&'b HashSet> for &'a HashSet { } #[stable] +#[old_impl_check] impl<'a, 'b, T: Eq + Hash + Clone, S, H: Hasher + Default> Sub<&'b HashSet> for &'a HashSet { type Output = HashSet; @@ -816,6 +827,7 @@ impl<'a, K: 'a> Iterator for Drain<'a, K> { } #[stable] +#[old_impl_check] impl<'a, T, S, H> Iterator for Intersection<'a, T, H> where T: Eq + Hash, H: Hasher { @@ -839,6 +851,7 @@ impl<'a, T, S, H> Iterator for Intersection<'a, T, H> } #[stable] +#[old_impl_check] impl<'a, T, S, H> Iterator for Difference<'a, T, H> where T: Eq + Hash, H: Hasher { @@ -862,6 +875,7 @@ impl<'a, T, S, H> Iterator for Difference<'a, T, H> } #[stable] +#[old_impl_check] impl<'a, T, S, H> Iterator for SymmetricDifference<'a, T, H> where T: Eq + Hash, H: Hasher { @@ -872,6 +886,7 @@ impl<'a, T, S, H> Iterator for SymmetricDifference<'a, T, H> } #[stable] +#[old_impl_check] impl<'a, T, S, H> Iterator for Union<'a, T, H> where T: Eq + Hash, H: Hasher { diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index 5bef473db990..61ed387dd07e 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -1604,6 +1604,7 @@ pub struct IncomingConnections<'a, A: ?Sized +'a> { inc: &'a mut A, } +#[old_impl_check] impl<'a, T, A: ?Sized + Acceptor> Iterator for IncomingConnections<'a, A> { type Item = IoResult; diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index b9f226c5aca7..592163e0e8c6 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -108,6 +108,7 @@ #![feature(default_type_params, phase, lang_items, unsafe_destructor)] #![feature(slicing_syntax, unboxed_closures)] #![feature(old_orphan_check)] +#![feature(old_impl_check)] #![feature(associated_types)] // Don't link to std. We are std. diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 7aa7c4fcfb30..0054cb9509ac 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -982,8 +982,8 @@ pub enum Sign { Plus } -impl Sign where T: Int { - pub fn new(n: T) -> Sign { +impl Sign { + pub fn new(n: T) -> Sign { if n < Int::zero() { Minus } else {