diff options
| author | bors <bors@rust-lang.org> | 2020-04-10 13:05:05 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-04-10 13:05:05 +0000 |
| commit | dbc3cfdd25ccd56edf3ea364f86ab32967636c26 (patch) | |
| tree | a75c01452eed404a4610f586ab4efd89938b6107 /src/liballoc | |
| parent | 167510f776891f2b0b18d1168ed42377a63493a7 (diff) | |
| parent | 68e0e6ba848087734be581afe5478635a647aa7c (diff) | |
| download | rust-dbc3cfdd25ccd56edf3ea364f86ab32967636c26.tar.gz rust-dbc3cfdd25ccd56edf3ea364f86ab32967636c26.zip | |
Auto merge of #70983 - Centril:rollup-npabk7c, r=Centril
Rollup of 8 pull requests Successful merges: - #70784 (Consider methods on fundamental `impl` when method is not found on numeric type) - #70843 (Remove the Ord bound that was plaguing drain_filter) - #70913 (Replace "rc"/"arc" lang items with Rc/Arc diagnostic items.) - #70932 (De-abuse TyKind::Error in pattern type checking) - #70952 (Clean up E0511 explanation) - #70964 (rustc_session CLI lint parsing: mark a temporary hack as such) - #70969 (Fix JSON file_name documentation for macros.) - #70975 (Fix internal doc comment nits.) Failed merges: r? @ghost
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/collections/btree/map.rs | 41 | ||||
| -rw-r--r-- | src/liballoc/collections/btree/set.rs | 25 | ||||
| -rw-r--r-- | src/liballoc/rc.rs | 3 | ||||
| -rw-r--r-- | src/liballoc/sync.rs | 3 |
4 files changed, 25 insertions, 47 deletions
diff --git a/src/liballoc/collections/btree/map.rs b/src/liballoc/collections/btree/map.rs index a1e59b2e6af..fc7e91ce47b 100644 --- a/src/liballoc/collections/btree/map.rs +++ b/src/liballoc/collections/btree/map.rs @@ -1727,28 +1727,22 @@ impl<K, V> Clone for Values<'_, K, V> { #[unstable(feature = "btree_drain_filter", issue = "70530")] pub struct DrainFilter<'a, K, V, F> where - K: 'a + Ord, // This Ord bound should be removed before stabilization. + K: 'a, V: 'a, F: 'a + FnMut(&K, &mut V) -> bool, { pred: F, inner: DrainFilterInner<'a, K, V>, } -pub(super) struct DrainFilterInner<'a, K, V> -where - K: 'a + Ord, - V: 'a, -{ +pub(super) struct DrainFilterInner<'a, K: 'a, V: 'a> { length: &'a mut usize, cur_leaf_edge: Option<Handle<NodeRef<marker::Mut<'a>, K, V, marker::Leaf>, marker::Edge>>, } #[unstable(feature = "btree_drain_filter", issue = "70530")] -impl<'a, K, V, F> Drop for DrainFilter<'a, K, V, F> +impl<K, V, F> Drop for DrainFilter<'_, K, V, F> where - K: 'a + Ord, - V: 'a, - F: 'a + FnMut(&K, &mut V) -> bool, + F: FnMut(&K, &mut V) -> bool, { fn drop(&mut self) { self.for_each(drop); @@ -1756,11 +1750,11 @@ where } #[unstable(feature = "btree_drain_filter", issue = "70530")] -impl<'a, K, V, F> fmt::Debug for DrainFilter<'a, K, V, F> +impl<K, V, F> fmt::Debug for DrainFilter<'_, K, V, F> where - K: 'a + fmt::Debug + Ord, - V: 'a + fmt::Debug, - F: 'a + FnMut(&K, &mut V) -> bool, + K: fmt::Debug, + V: fmt::Debug, + F: FnMut(&K, &mut V) -> bool, { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_tuple("DrainFilter").field(&self.inner.peek()).finish() @@ -1768,11 +1762,9 @@ where } #[unstable(feature = "btree_drain_filter", issue = "70530")] -impl<'a, K, V, F> Iterator for DrainFilter<'a, K, V, F> +impl<K, V, F> Iterator for DrainFilter<'_, K, V, F> where - K: 'a + Ord, - V: 'a, - F: 'a + FnMut(&K, &mut V) -> bool, + F: FnMut(&K, &mut V) -> bool, { type Item = (K, V); @@ -1785,11 +1777,7 @@ where } } -impl<'a, K, V> DrainFilterInner<'a, K, V> -where - K: 'a + Ord, - V: 'a, -{ +impl<'a, K: 'a, V: 'a> DrainFilterInner<'a, K, V> { /// Allow Debug implementations to predict the next element. pub(super) fn peek(&self) -> Option<(&K, &V)> { let edge = self.cur_leaf_edge.as_ref()?; @@ -1828,12 +1816,7 @@ where } #[unstable(feature = "btree_drain_filter", issue = "70530")] -impl<K, V, F> FusedIterator for DrainFilter<'_, K, V, F> -where - K: Ord, - F: FnMut(&K, &mut V) -> bool, -{ -} +impl<K, V, F> FusedIterator for DrainFilter<'_, K, V, F> where F: FnMut(&K, &mut V) -> bool {} #[stable(feature = "btree_range", since = "1.17.0")] impl<'a, K, V> Iterator for Range<'a, K, V> { diff --git a/src/liballoc/collections/btree/set.rs b/src/liballoc/collections/btree/set.rs index 0b02223def4..9bf483f269f 100644 --- a/src/liballoc/collections/btree/set.rs +++ b/src/liballoc/collections/btree/set.rs @@ -1094,7 +1094,7 @@ impl<'a, T> IntoIterator for &'a BTreeSet<T> { #[unstable(feature = "btree_drain_filter", issue = "70530")] pub struct DrainFilter<'a, T, F> where - T: 'a + Ord, + T: 'a, F: 'a + FnMut(&T) -> bool, { pred: F, @@ -1102,10 +1102,9 @@ where } #[unstable(feature = "btree_drain_filter", issue = "70530")] -impl<'a, T, F> Drop for DrainFilter<'a, T, F> +impl<T, F> Drop for DrainFilter<'_, T, F> where - T: 'a + Ord, - F: 'a + FnMut(&T) -> bool, + F: FnMut(&T) -> bool, { fn drop(&mut self) { self.for_each(drop); @@ -1113,10 +1112,10 @@ where } #[unstable(feature = "btree_drain_filter", issue = "70530")] -impl<'a, T, F> fmt::Debug for DrainFilter<'a, T, F> +impl<T, F> fmt::Debug for DrainFilter<'_, T, F> where - T: 'a + Ord + fmt::Debug, - F: 'a + FnMut(&T) -> bool, + T: fmt::Debug, + F: FnMut(&T) -> bool, { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_tuple("DrainFilter").field(&self.inner.peek().map(|(k, _)| k)).finish() @@ -1124,10 +1123,9 @@ where } #[unstable(feature = "btree_drain_filter", issue = "70530")] -impl<'a, 'f, T, F> Iterator for DrainFilter<'a, T, F> +impl<'a, T, F> Iterator for DrainFilter<'_, T, F> where - T: 'a + Ord, - F: 'a + 'f + FnMut(&T) -> bool, + F: 'a + FnMut(&T) -> bool, { type Item = T; @@ -1143,12 +1141,7 @@ where } #[unstable(feature = "btree_drain_filter", issue = "70530")] -impl<'a, T, F> FusedIterator for DrainFilter<'a, T, F> -where - T: 'a + Ord, - F: 'a + FnMut(&T) -> bool, -{ -} +impl<T, F> FusedIterator for DrainFilter<'_, T, F> where F: FnMut(&T) -> bool {} #[stable(feature = "rust1", since = "1.0.0")] impl<T: Ord> Extend<T> for BTreeSet<T> { diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index 9db997e8641..abc4056cf56 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.rs @@ -279,7 +279,8 @@ struct RcBox<T: ?Sized> { /// type `T`. /// /// [get_mut]: #method.get_mut -#[cfg_attr(not(test), lang = "rc")] +#[cfg_attr(all(bootstrap, not(test)), lang = "rc")] +#[cfg_attr(not(test), rustc_diagnostic_item = "Rc")] #[stable(feature = "rust1", since = "1.0.0")] pub struct Rc<T: ?Sized> { ptr: NonNull<RcBox<T>>, diff --git a/src/liballoc/sync.rs b/src/liballoc/sync.rs index 1cfb26eb35a..b1b22e46a7c 100644 --- a/src/liballoc/sync.rs +++ b/src/liballoc/sync.rs @@ -207,7 +207,8 @@ macro_rules! acquire { /// counting in general. /// /// [rc_examples]: ../../std/rc/index.html#examples -#[cfg_attr(not(test), lang = "arc")] +#[cfg_attr(all(bootstrap, not(test)), lang = "arc")] +#[cfg_attr(not(test), rustc_diagnostic_item = "Arc")] #[stable(feature = "rust1", since = "1.0.0")] pub struct Arc<T: ?Sized> { ptr: NonNull<ArcInner<T>>, |
