rust/library/alloc
Matthias Krüger e17a222a0a
Rollup merge of #123480 - Nadrieril:impl-all-derefpures, r=compiler-errors
deref patterns: impl `DerefPure` for more std types

Context: [deref patterns](https://github.com/rust-lang/rust/issues/87121). The requirements of `DerefPure` aren't precise yet, but these types unambiguously satisfy them.

Interestingly, a hypothetical `impl DerefMut for Cow` that does a `Clone` would *not* be eligible for `DerefPure` if we allow mixing deref patterns with normal patterns. If the following is exhaustive then the `DerefMut` would cause UB:
```rust
match &mut Cow::Borrowed(&()) {
    Cow::Owned(_) => ..., // Doesn't match
    deref!(_x) if false => ..., // Causes the variant to switch to `Owned`
    Cow::Borrowed(_) => ..., // Doesn't match
    // We reach unreachable
}
```
2024-05-03 06:04:19 +02:00
..
benches disable benches in Miri 2024-04-07 09:58:10 +02:00
src Rollup merge of #123480 - Nadrieril:impl-all-derefpures, r=compiler-errors 2024-05-03 06:04:19 +02:00
tests Step bootstrap cfgs 2024-05-01 22:19:11 -04:00
Cargo.toml Rename {collections=>alloc}{tests,benches} 2023-11-26 12:04:56 +00:00