Skip to content

Commit 545bfcd

Browse files
committed
Relax Debug constraints when debugging {HashMap,BTreeMap}::{Keys,Values}.
Fixed #41924.
1 parent 2ea1d2d commit 545bfcd

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/liballoc/btree/map.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ pub struct Keys<'a, K: 'a, V: 'a> {
334334
}
335335

336336
#[stable(feature = "collection_debug", since = "1.17.0")]
337-
impl<'a, K: 'a + fmt::Debug, V: 'a + fmt::Debug> fmt::Debug for Keys<'a, K, V> {
337+
impl<'a, K: 'a + fmt::Debug, V: 'a> fmt::Debug for Keys<'a, K, V> {
338338
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
339339
f.debug_list().entries(self.clone()).finish()
340340
}
@@ -353,7 +353,7 @@ pub struct Values<'a, K: 'a, V: 'a> {
353353
}
354354

355355
#[stable(feature = "collection_debug", since = "1.17.0")]
356-
impl<'a, K: 'a + fmt::Debug, V: 'a + fmt::Debug> fmt::Debug for Values<'a, K, V> {
356+
impl<'a, K: 'a, V: 'a + fmt::Debug> fmt::Debug for Values<'a, K, V> {
357357
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
358358
f.debug_list().entries(self.clone()).finish()
359359
}

src/libstd/collections/hash/map.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1407,7 +1407,7 @@ impl<'a, K, V> Clone for Keys<'a, K, V> {
14071407
}
14081408

14091409
#[stable(feature = "std_debug", since = "1.16.0")]
1410-
impl<'a, K: Debug, V: Debug> fmt::Debug for Keys<'a, K, V> {
1410+
impl<'a, K: Debug, V> fmt::Debug for Keys<'a, K, V> {
14111411
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
14121412
f.debug_list()
14131413
.entries(self.clone())
@@ -1436,7 +1436,7 @@ impl<'a, K, V> Clone for Values<'a, K, V> {
14361436
}
14371437

14381438
#[stable(feature = "std_debug", since = "1.16.0")]
1439-
impl<'a, K: Debug, V: Debug> fmt::Debug for Values<'a, K, V> {
1439+
impl<'a, K, V: Debug> fmt::Debug for Values<'a, K, V> {
14401440
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
14411441
f.debug_list()
14421442
.entries(self.clone())

0 commit comments

Comments
 (0)