rust/library
bors 2b4196e977 Auto merge of #84111 - bstrie:hashfrom, r=joshtriplett
Stabilize `impl From<[(K, V); N]> for HashMap` (and friends)

In addition to allowing HashMap to participate in Into/From conversion, this adds the long-requested ability to use constructor-like syntax for initializing a HashMap:
```rust
let map = HashMap::from([
    (1, 2),
    (3, 4),
    (5, 6)
]);
```
This addition is highly motivated by existing precedence, e.g. it is already possible to similarly construct a Vec from a fixed-size array:
```rust
let vec = Vec::from([1, 2, 3]);
```
...and it is already possible to collect a Vec of tuples into a HashMap (and vice-versa):
```rust
let vec = Vec::from([(1, 2)]);
let map: HashMap<_, _> = vec.into_iter().collect();
let vec: Vec<(_, _)> = map.into_iter().collect();
```
...and of course it is likewise possible to collect a fixed-size array of tuples into a HashMap ([but not vice-versa just yet](https://github.com/rust-lang/rust/issues/81615)):
```rust
let arr = [(1, 2)];
let map: HashMap<_, _> = std::array::IntoIter::new(arr).collect();
```
Therefore this addition seems like a no-brainer.

As for any impl, this would be insta-stable.
2021-07-24 22:31:14 +00:00
..
alloc Auto merge of #84111 - bstrie:hashfrom, r=joshtriplett 2021-07-24 22:31:14 +00:00
backtrace@221483ebaf Update backtrace to 0.3.57 2021-04-25 13:48:03 -07:00
core Rollup merge of #87422 - mgeier:doc-strip-feature-attribute, r=LeSeulArtichaut 2021-07-24 09:52:04 -07:00
panic_abort rustdoc: link to stable/beta docs consistently in documentation 2021-06-04 14:18:21 -04:00
panic_unwind Remove the deprecated core::raw and std::raw module. 2021-07-03 14:03:27 +08:00
proc_macro Rollup merge of #84029 - drahnr:master, r=petrochenkov 2021-07-03 03:15:07 +09:00
profiler_builtins Upgrade cc crate to 1.0.69 2021-07-13 17:58:50 +09:00
rtstartup
rustc-std-workspace-alloc
rustc-std-workspace-core
rustc-std-workspace-std
std Auto merge of #84111 - bstrie:hashfrom, r=joshtriplett 2021-07-24 22:31:14 +00:00
stdarch@3001c75a1d Update stdarch submodule to stabilize simd_x86_bittest feature 2021-06-13 02:29:17 +09:00
test Remove unused stuff and switch to pub(crate) whenever possible. 2021-07-18 22:00:41 +08:00
unwind Upgrade cc crate to 1.0.69 2021-07-13 17:58:50 +09:00