rust/library/alloc/src
Jonas Schievink 1118ab9930
Rollup merge of #75377 - canova:map_debug_impl, r=dtolnay
Fix Debug implementations of some of the HashMap and BTreeMap iterator types

HashMap's `ValuesMut`, BTreeMaps `ValuesMut`, IntoValues and `IntoKeys` structs were printing both keys and values on their Debug implementations. But they are iterators over either keys or values. Irrelevant values should not be visible. With this PR, they only show relevant fields.
This fixes #75297.

[Here's an example code.](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=0c79356ed860e347a0c1a205616f93b7) This prints this on nightly:
```
ValuesMut { inner: IterMut { range: [(1, "hello"), (2, "goodbye")], length: 2 } }
IntoKeys { inner: [(1, "hello"), (2, "goodbye")] }
IntoValues { inner: [(1, "hello"), (2, "goodbye")] }
[(2, "goodbye"), (1, "hello")]
```

After the patch this example prints these instead:
```
["hello", "goodbye"]
["hello", "goodbye"]
[1, 2]
["hello", "goodbye"]
```

I didn't add test cases for them, since I couldn't see any tests for Debug implementations anywhere. But please let me know if I should add it to a specific place.

r? @dtolnay
2020-10-03 00:31:04 +02:00
..
alloc
collections Rollup merge of #75377 - canova:map_debug_impl, r=dtolnay 2020-10-03 00:31:04 +02:00
prelude
raw_vec Rename AllocErr to AllocError 2020-09-28 14:51:03 -04:00
rc
sync
alloc.rs Rename AllocErr to AllocError 2020-09-28 14:51:03 -04:00
borrow.rs Update library functions with stability attributes 2020-09-22 10:05:58 -07:00
boxed.rs
fmt.rs
lib.rs Update library functions with stability attributes 2020-09-22 10:05:58 -07:00
macros.rs
raw_vec.rs Rollup merge of #76993 - blitzerr:alloc-ref, r=Amanieu 2020-09-23 14:54:06 +02:00
rc.rs Rename AllocErr to AllocError 2020-09-28 14:51:03 -04:00
slice.rs Rollup merge of #75026 - JulianKnodt:array_windows, r=Amanieu 2020-09-16 12:24:03 -07:00
str.rs
string.rs Rollup merge of #76525 - fusion-engineering-forks:string-drain, r=dtolnay 2020-09-19 11:47:47 +02:00
sync.rs Rename AllocErr to AllocError 2020-09-28 14:51:03 -04:00
task.rs Allow unstable From impl for [Raw]Waker. 2020-09-11 13:36:45 +02:00
tests.rs
vec.rs Fix typo in vec doc "tries to reserves" 2020-10-01 10:08:51 +08:00