about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/Linker.cpp
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-12-05 16:08:35 +0100
committerGitHub <noreply@github.com>2023-12-05 16:08:35 +0100
commit81b6263dd03aa9288a03178a4ec556922d5332c4 (patch)
tree935ce85c8242e296b4e9c9dd3f862e978e8d6763 /compiler/rustc_llvm/llvm-wrapper/Linker.cpp
parentfddda14ac0345c1d0ab602d6016b976c972aa643 (diff)
parent5e470db05cc842593c7d2e59bc5c2e8ae71a7025 (diff)
downloadrust-81b6263dd03aa9288a03178a4ec556922d5332c4.tar.gz
rust-81b6263dd03aa9288a03178a4ec556922d5332c4.zip
Rollup merge of #118598 - Nadrieril:remove_precise_pointer_size_matching, r=davidtwco
Remove the `precise_pointer_size_matching` feature gate

`usize` and `isize` are special for pattern matching because their range might depend on the platform. To make code portable across platforms, the following is never considered exhaustive:
```rust
let x: usize = ...;
match x {
    0..=18446744073709551615 => {}
}
```
Because of how rust handles constants, this also unfortunately counts `0..=usize::MAX` as non-exhaustive. The [`precise_pointer_size_matching`](https://github.com/rust-lang/rust/issues/56354) feature gate was introduced both for this convenience and for the possibility that the lang team could decide to allow the above.

Since then, [half-open range patterns](https://github.com/rust-lang/rust/issues/67264) have been implemented, and since #116692 they correctly support `usize`/`isize`:
```rust
match 0usize { // exhaustive!
    0..5 => {}
    5.. => {}
}
```
I believe this subsumes all the use cases of the feature gate. Moreover no attempt has been made to stabilize it in the 5 years of its existence. I therefore propose we retire this feature gate.

Closes https://github.com/rust-lang/rust/issues/56354
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/Linker.cpp')
0 files changed, 0 insertions, 0 deletions