diff options
| author | dianne <diannes.gm@gmail.com> | 2025-03-21 19:52:53 -0700 |
|---|---|---|
| committer | dianne <diannes.gm@gmail.com> | 2025-03-21 20:14:40 -0700 |
| commit | 83145a674444c15e61f1b4fb7043e8cdc4a62ea3 (patch) | |
| tree | 2e4a3f75755cf9337864a835f6d1c48b7b702124 /compiler/rustc_middle/src | |
| parent | be73c1f4617c97bce81b2694a767353300a75072 (diff) | |
| download | rust-83145a674444c15e61f1b4fb7043e8cdc4a62ea3.tar.gz rust-83145a674444c15e61f1b4fb7043e8cdc4a62ea3.zip | |
match lowering cleanup: `non_scalar_compare` is only for `&str`
Since array and slice constants are now lowered to array and slice patterns, `non_scalar_compare` was only called for string comparisons. This specializes it to strings, renames it, and removes the unused array-unsizing logic. This also updates some outdated doc comments.
Diffstat (limited to 'compiler/rustc_middle/src')
| -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. |
