diff options
| author | Matthias Krüger <476013+matthiaskrgr@users.noreply.github.com> | 2025-03-24 20:40:08 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-24 20:40:08 +0100 |
| commit | dfd83be4da9d4e3a847ef8196d36b7f86e1ff576 (patch) | |
| tree | 67c3c23218a110c48b463fb60b5a7c22ab570d34 /compiler/rustc_middle | |
| parent | 0c25157784b85d4a8f80ee5ef69b3d3db31e010e (diff) | |
| parent | 83145a674444c15e61f1b4fb7043e8cdc4a62ea3 (diff) | |
| download | rust-dfd83be4da9d4e3a847ef8196d36b7f86e1ff576.tar.gz rust-dfd83be4da9d4e3a847ef8196d36b7f86e1ff576.zip | |
Rollup merge of #138821 - dianne:cleanup-non-scalar-compare, r=oli-obk
match lowering cleanup: remove unused unsizing logic from `non_scalar_compare` Since array and slice constants are now translated to array and slice patterns, `non_scalar_compare` is only used for string comparisons. This specializes it to strings, renames it, and removes the unused array-unsizing logic. This also updates the doc comments for `thir::PatKind::Constant` and `TestKind::Eq`, which referred to them being used for slice references. r? ````@oli-obk````
Diffstat (limited to 'compiler/rustc_middle')
| -rw-r--r-- | compiler/rustc_middle/src/thir.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_middle/src/thir.rs b/compiler/rustc_middle/src/thir.rs index bbcd509c558..6783bbf8bf4 100644 --- a/compiler/rustc_middle/src/thir.rs +++ b/compiler/rustc_middle/src/thir.rs @@ -800,9 +800,9 @@ pub enum PatKind<'tcx> { }, /// One of the following: - /// * `&str`/`&[u8]` (represented as a valtree), which will be handled as a string/slice pattern - /// and thus exhaustiveness checking will detect if you use the same string/slice twice in - /// different patterns. + /// * `&str` (represented as a valtree), which will be handled as a string pattern and thus + /// exhaustiveness checking will detect if you use the same string twice in different + /// patterns. /// * integer, bool, char or float (represented as a valtree), which will be handled by /// exhaustiveness to cover exactly its own value, similar to `&str`, but these values are /// much simpler. |
