]> git.lizzy.rs Git - rust.git/commit - src/tools/miri
Rollup merge of #88040 - nbdd0121:btreemap, r=m-ou-se
authorMara Bos <m-ou.se@m-ou.se>
Wed, 1 Sep 2021 07:23:23 +0000 (09:23 +0200)
committerGitHub <noreply@github.com>
Wed, 1 Sep 2021 07:23:23 +0000 (09:23 +0200)
commit5878780e641239906a7a2986ccae048f7640be87
treebc70bff308a0253fde7e2c588df60ac28f262008
parentdcefd6871d40612e924bb63f5d8a3bddf934c0f4
parentf33f266a8a20594736b8eb7c95a4d42478bec7cb
Rollup merge of #88040 - nbdd0121:btreemap, r=m-ou-se

BTree: remove Ord bound from new

`K: Ord` bound is unnecessary on `BTree{Map,Set}::new` and their `Default` impl. No elements exist so there are nothing to compare anyway, so I don't think "future proof" would be a blocker here. This is analogous to `HashMap::new` not having a `K: Eq + Hash` bound.

#79245 originally does this and for some reason drops the change to `new` and `Default`. I can see why changes to other methods like `entry` or `symmetric_difference` need to be careful but I couldn't find out any reason not to do it on `new`.

Removing the bound also makes the stabilisation of `const fn new` not depending on const trait bounds.

cc `@steffahn` who suggests me to make this PR.

r? `@dtolnay`