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````
This commit is contained in:
commit
dfd83be4da
3 changed files with 24 additions and 94 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue