]> git.lizzy.rs Git - rust.git/commit - src/tools/rust-analyzer
Rollup merge of #93755 - ChayimFriedman2:allow-comparing-vecs-with-different-allocato...
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>
Mon, 28 Mar 2022 02:12:10 +0000 (04:12 +0200)
committerGitHub <noreply@github.com>
Mon, 28 Mar 2022 02:12:10 +0000 (04:12 +0200)
commit6ed1a67b3805bdea306ee055e035e298f92a10e4
tree2e2eb724df2176450ce165dd2d94464e99e60083
parent9412316ac39db2a91284d809e2ada9c69afe5b50
parentee23fd2ca36e82ff7455520705566a04274d3700
Rollup merge of #93755 - ChayimFriedman2:allow-comparing-vecs-with-different-allocators, r=dtolnay

Allow comparing `Vec`s with different allocators using `==`

See https://stackoverflow.com/q/71021633/7884305.

I did not changed the `PartialOrd` impl too because it was not generic already (didn't support `Vec<T> <=> Vec<U> where T: PartialOrd<U>`).

Does it needs tests?

I don't think this will hurt type inference much because the default allocator is usually not inferred (`new()` specifies it directly, and even with other allocators, you pass the allocator to `new_in()` so the compiler usually knows the type).

I think this requires FCP since the impls are already stable.