about summary refs log tree commit diff
path: root/src/patterns.rs
diff options
context:
space:
mode:
authorCaleb Cartwright <calebcartwright@users.noreply.github.com>2023-12-13 14:18:07 -0600
committerGitHub <noreply@github.com>2023-12-13 14:18:07 -0600
commit20196767d4f04c83e9edefd09200210bbd2b1994 (patch)
tree9fec9533aedf83bdeec49f6dce7883408fcdd1aa /src/patterns.rs
parent2174e6052dcb1802417d686140fe0ab7cbef0df2 (diff)
parent03510f35150c33cc87dc557c6a3be586c1a6d10a (diff)
Merge pull request #5980 from ytmimi/subtree_push_2023_12_12
Subtree push 2023-12-12
Diffstat (limited to 'src/patterns.rs')
-rw-r--r--src/patterns.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/patterns.rs b/src/patterns.rs
index 33f3b4b8a21..8504999b8ff 100644
--- a/src/patterns.rs
+++ b/src/patterns.rs
@@ -40,7 +40,9 @@ pub(crate) fn is_short_pattern(pat: &ast::Pat, pat_str: &str) -> bool {
 
 fn is_short_pattern_inner(pat: &ast::Pat) -> bool {
     match pat.kind {
-        ast::PatKind::Rest | ast::PatKind::Wild | ast::PatKind::Lit(_) => true,
+        ast::PatKind::Rest | ast::PatKind::Never | ast::PatKind::Wild | ast::PatKind::Lit(_) => {
+            true
+        }
         ast::PatKind::Ident(_, _, ref pat) => pat.is_none(),
         ast::PatKind::Struct(..)
         | ast::PatKind::MacCall(..)
@@ -193,6 +195,7 @@ impl Rewrite for Pat {
                     None
                 }
             }
+            PatKind::Never => None,
             PatKind::Range(ref lhs, ref rhs, ref end_kind) => {
                 let infix = match end_kind.node {
                     RangeEnd::Included(RangeSyntax::DotDotDot) => "...",