rust-lang / libs-team

The home of the library team
Apache License 2.0
116 stars 18 forks source link

Make `PartialOrd for Vec` allocator independent #240

Closed gootorov closed 1 year ago

gootorov commented 1 year ago

Proposal

Problem statement

PartialOrd cannot currently be used on vectors allocated with different allocators.

Motivating examples or use cases

Solution sketch

See PR: https://github.com/rust-lang/rust/pull/112632

Alternatives

Compare underlying slices via Deref<Target = [T]>.

dtolnay commented 1 year ago

Seems good to me.

Let's do a libs-api team FCP on your PR, since this would need to be instantly stable.

thomcc commented 1 year ago

It's not insta-stable because Allocator isn't stable (FCP seems fine to me either way, just pointing it out).

dtolnay commented 1 year ago

You are right, good call.