about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-05-03 06:04:19 +0200
committerGitHub <noreply@github.com>2024-05-03 06:04:19 +0200
commite17a222a0a42debb5230e0da0281cff6af29f029 (patch)
tree7b14e4b72c9f0603b4b9bbd54ccdf7655e34d606 /compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp
parent79734f1db8dbe322192dea32c0f6b80ab14c4c1d (diff)
parent1a83bea1075cf8068c0a63e72761c6080e904e39 (diff)
downloadrust-e17a222a0a42debb5230e0da0281cff6af29f029.tar.gz
rust-e17a222a0a42debb5230e0da0281cff6af29f029.zip
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
}
```
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp')
0 files changed, 0 insertions, 0 deletions