Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 8 pull requests #84962

Closed
wants to merge 18 commits into from
Closed
Changes from 3 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
33cc3f5
Stablize {HashMap,BTreeMap}::into_{keys,values}
Folyd Apr 18, 2021
4a63e1e
Allow using `core::` in intra-doc links within core itself
jyn514 Apr 30, 2021
6b64202
Handle incorrect placement of parentheses in trait bounds more gracef…
estebank May 4, 2021
0b94338
CTFE engine: rename copy → copy_intrinsic, move to intrinsics.rs
RalfJung May 4, 2021
4bd5505
Only compute Obligation `cache_key` once in `register_obligation_at`
estebank May 4, 2021
dcd227d
E0583: Include secondary path in error message
fee1-dead May 5, 2021
42405b4
Fix typo in `MaybeUninit::array_assume_init` safety comment
sdroege May 5, 2021
b6f3dbb
Bump map_into_keys_values stable version to 1.54.0.
m-ou-se May 5, 2021
ad4ccf9
Remove unneeded call to with_default_session_globals in rustdoc highl…
GuillaumeGomez May 5, 2021
3c489a3
Update highlight tests
GuillaumeGomez May 5, 2021
821388f
Rollup merge of #84328 - Folyd:stablize_map_into_keys_values, r=m-ou-se
GuillaumeGomez May 5, 2021
778f059
Rollup merge of #84755 - jyn514:core-links, r=kennytm
GuillaumeGomez May 5, 2021
acf233f
Rollup merge of #84896 - estebank:issue-84772, r=jackh726
GuillaumeGomez May 5, 2021
41d5524
Rollup merge of #84905 - RalfJung:copy, r=oli-obk
GuillaumeGomez May 5, 2021
c6d509a
Rollup merge of #84923 - estebank:as_cache_key-once, r=petrochenkov
GuillaumeGomez May 5, 2021
5e827a7
Rollup merge of #84945 - fee1-dead:E0583-better-message, r=petrochenkov
GuillaumeGomez May 5, 2021
fa96987
Rollup merge of #84949 - sdroege:maybe-unint-typo, r=m-ou-se
GuillaumeGomez May 5, 2021
890adb8
Rollup merge of #84953 - GuillaumeGomez:remove-unneeded-with_default_…
GuillaumeGomez May 5, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 14 additions & 16 deletions library/alloc/src/collections/btree/map.rs
Original file line number Diff line number Diff line change
@@ -398,12 +398,12 @@ impl<K, V: fmt::Debug> fmt::Debug for ValuesMut<'_, K, V> {
/// See its documentation for more.
///
/// [`into_keys`]: BTreeMap::into_keys
#[unstable(feature = "map_into_keys_values", issue = "75294")]
#[stable(feature = "map_into_keys_values", since = "1.54.0")]
pub struct IntoKeys<K, V> {
inner: IntoIter<K, V>,
}

#[unstable(feature = "map_into_keys_values", issue = "75294")]
#[stable(feature = "map_into_keys_values", since = "1.54.0")]
impl<K: fmt::Debug, V> fmt::Debug for IntoKeys<K, V> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_list().entries(self.inner.iter().map(|(key, _)| key)).finish()
@@ -416,12 +416,12 @@ impl<K: fmt::Debug, V> fmt::Debug for IntoKeys<K, V> {
/// See its documentation for more.
///
/// [`into_values`]: BTreeMap::into_values
#[unstable(feature = "map_into_keys_values", issue = "75294")]
#[stable(feature = "map_into_keys_values", since = "1.54.0")]
pub struct IntoValues<K, V> {
inner: IntoIter<K, V>,
}

#[unstable(feature = "map_into_keys_values", issue = "75294")]
#[stable(feature = "map_into_keys_values", since = "1.54.0")]
impl<K, V: fmt::Debug> fmt::Debug for IntoValues<K, V> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_list().entries(self.inner.iter().map(|(_, val)| val)).finish()
@@ -1242,7 +1242,6 @@ impl<K, V> BTreeMap<K, V> {
/// # Examples
///
/// ```
/// #![feature(map_into_keys_values)]
/// use std::collections::BTreeMap;
///
/// let mut a = BTreeMap::new();
@@ -1253,7 +1252,7 @@ impl<K, V> BTreeMap<K, V> {
/// assert_eq!(keys, [1, 2]);
/// ```
#[inline]
#[unstable(feature = "map_into_keys_values", issue = "75294")]
#[stable(feature = "map_into_keys_values", since = "1.54.0")]
pub fn into_keys(self) -> IntoKeys<K, V> {
IntoKeys { inner: self.into_iter() }
}
@@ -1265,7 +1264,6 @@ impl<K, V> BTreeMap<K, V> {
/// # Examples
///
/// ```
/// #![feature(map_into_keys_values)]
/// use std::collections::BTreeMap;
///
/// let mut a = BTreeMap::new();
@@ -1276,7 +1274,7 @@ impl<K, V> BTreeMap<K, V> {
/// assert_eq!(values, ["hello", "goodbye"]);
/// ```
#[inline]
#[unstable(feature = "map_into_keys_values", issue = "75294")]
#[stable(feature = "map_into_keys_values", since = "1.54.0")]
pub fn into_values(self) -> IntoValues<K, V> {
IntoValues { inner: self.into_iter() }
}
@@ -1776,7 +1774,7 @@ impl<'a, K, V> Range<'a, K, V> {
}
}

#[unstable(feature = "map_into_keys_values", issue = "75294")]
#[stable(feature = "map_into_keys_values", since = "1.54.0")]
impl<K, V> Iterator for IntoKeys<K, V> {
type Item = K;

@@ -1801,24 +1799,24 @@ impl<K, V> Iterator for IntoKeys<K, V> {
}
}

#[unstable(feature = "map_into_keys_values", issue = "75294")]
#[stable(feature = "map_into_keys_values", since = "1.54.0")]
impl<K, V> DoubleEndedIterator for IntoKeys<K, V> {
fn next_back(&mut self) -> Option<K> {
self.inner.next_back().map(|(k, _)| k)
}
}

#[unstable(feature = "map_into_keys_values", issue = "75294")]
#[stable(feature = "map_into_keys_values", since = "1.54.0")]
impl<K, V> ExactSizeIterator for IntoKeys<K, V> {
fn len(&self) -> usize {
self.inner.len()
}
}

#[unstable(feature = "map_into_keys_values", issue = "75294")]
#[stable(feature = "map_into_keys_values", since = "1.54.0")]
impl<K, V> FusedIterator for IntoKeys<K, V> {}

#[unstable(feature = "map_into_keys_values", issue = "75294")]
#[stable(feature = "map_into_keys_values", since = "1.54.0")]
impl<K, V> Iterator for IntoValues<K, V> {
type Item = V;

@@ -1835,21 +1833,21 @@ impl<K, V> Iterator for IntoValues<K, V> {
}
}

#[unstable(feature = "map_into_keys_values", issue = "75294")]
#[stable(feature = "map_into_keys_values", since = "1.54.0")]
impl<K, V> DoubleEndedIterator for IntoValues<K, V> {
fn next_back(&mut self) -> Option<V> {
self.inner.next_back().map(|(_, v)| v)
}
}

#[unstable(feature = "map_into_keys_values", issue = "75294")]
#[stable(feature = "map_into_keys_values", since = "1.54.0")]
impl<K, V> ExactSizeIterator for IntoValues<K, V> {
fn len(&self) -> usize {
self.inner.len()
}
}

#[unstable(feature = "map_into_keys_values", issue = "75294")]
#[stable(feature = "map_into_keys_values", since = "1.54.0")]
impl<K, V> FusedIterator for IntoValues<K, V> {}

#[stable(feature = "btree_range", since = "1.17.0")]
30 changes: 12 additions & 18 deletions library/std/src/collections/hash/map.rs
Original file line number Diff line number Diff line change
@@ -962,7 +962,6 @@ where
/// # Examples
///
/// ```
/// #![feature(map_into_keys_values)]
/// use std::collections::HashMap;
///
/// let mut map = HashMap::new();
@@ -973,7 +972,7 @@ where
/// let vec: Vec<&str> = map.into_keys().collect();
/// ```
#[inline]
#[unstable(feature = "map_into_keys_values", issue = "75294")]
#[stable(feature = "map_into_keys_values", since = "1.54.0")]
pub fn into_keys(self) -> IntoKeys<K, V> {
IntoKeys { inner: self.into_iter() }
}
@@ -985,7 +984,6 @@ where
/// # Examples
///
/// ```
/// #![feature(map_into_keys_values)]
/// use std::collections::HashMap;
///
/// let mut map = HashMap::new();
@@ -996,7 +994,7 @@ where
/// let vec: Vec<i32> = map.into_values().collect();
/// ```
#[inline]
#[unstable(feature = "map_into_keys_values", issue = "75294")]
#[stable(feature = "map_into_keys_values", since = "1.54.0")]
pub fn into_values(self) -> IntoValues<K, V> {
IntoValues { inner: self.into_iter() }
}
@@ -1405,15 +1403,13 @@ pub struct ValuesMut<'a, K: 'a, V: 'a> {
/// # Example
///
/// ```
/// #![feature(map_into_keys_values)]
///
/// use std::collections::HashMap;
///
/// let mut map = HashMap::new();
/// map.insert("a", 1);
/// let iter_keys = map.into_keys();
/// ```
#[unstable(feature = "map_into_keys_values", issue = "75294")]
#[stable(feature = "map_into_keys_values", since = "1.54.0")]
pub struct IntoKeys<K, V> {
inner: IntoIter<K, V>,
}
@@ -1428,15 +1424,13 @@ pub struct IntoKeys<K, V> {
/// # Example
///
/// ```
/// #![feature(map_into_keys_values)]
///
/// use std::collections::HashMap;
///
/// let mut map = HashMap::new();
/// map.insert("a", 1);
/// let iter_keys = map.into_values();
/// ```
#[unstable(feature = "map_into_keys_values", issue = "75294")]
#[stable(feature = "map_into_keys_values", since = "1.54.0")]
pub struct IntoValues<K, V> {
inner: IntoIter<K, V>,
}
@@ -2137,7 +2131,7 @@ impl<K, V: fmt::Debug> fmt::Debug for ValuesMut<'_, K, V> {
}
}

#[unstable(feature = "map_into_keys_values", issue = "75294")]
#[stable(feature = "map_into_keys_values", since = "1.54.0")]
impl<K, V> Iterator for IntoKeys<K, V> {
type Item = K;

@@ -2150,24 +2144,24 @@ impl<K, V> Iterator for IntoKeys<K, V> {
self.inner.size_hint()
}
}
#[unstable(feature = "map_into_keys_values", issue = "75294")]
#[stable(feature = "map_into_keys_values", since = "1.54.0")]
impl<K, V> ExactSizeIterator for IntoKeys<K, V> {
#[inline]
fn len(&self) -> usize {
self.inner.len()
}
}
#[unstable(feature = "map_into_keys_values", issue = "75294")]
#[stable(feature = "map_into_keys_values", since = "1.54.0")]
impl<K, V> FusedIterator for IntoKeys<K, V> {}

#[unstable(feature = "map_into_keys_values", issue = "75294")]
#[stable(feature = "map_into_keys_values", since = "1.54.0")]
impl<K: Debug, V> fmt::Debug for IntoKeys<K, V> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_list().entries(self.inner.iter().map(|(k, _)| k)).finish()
}
}

#[unstable(feature = "map_into_keys_values", issue = "75294")]
#[stable(feature = "map_into_keys_values", since = "1.54.0")]
impl<K, V> Iterator for IntoValues<K, V> {
type Item = V;

@@ -2180,17 +2174,17 @@ impl<K, V> Iterator for IntoValues<K, V> {
self.inner.size_hint()
}
}
#[unstable(feature = "map_into_keys_values", issue = "75294")]
#[stable(feature = "map_into_keys_values", since = "1.54.0")]
impl<K, V> ExactSizeIterator for IntoValues<K, V> {
#[inline]
fn len(&self) -> usize {
self.inner.len()
}
}
#[unstable(feature = "map_into_keys_values", issue = "75294")]
#[stable(feature = "map_into_keys_values", since = "1.54.0")]
impl<K, V> FusedIterator for IntoValues<K, V> {}

#[unstable(feature = "map_into_keys_values", issue = "75294")]
#[stable(feature = "map_into_keys_values", since = "1.54.0")]
impl<K, V: Debug> fmt::Debug for IntoValues<K, V> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_list().entries(self.inner.iter().map(|(_, v)| v)).finish()