Repository: dtolnay/syn
Pull request #1311 (2023-01-17 06:08:11)

Replace Pat variants with appropriate Expr variants


Patch:
diff --git a/src/expr.rs b/src/expr.rs
index 79c8ad2b..e142149c 100644
--- a/src/expr.rs
+++ b/src/expr.rs
@@ -2380,6 +2380,7 @@ pub(crate) mod parsing {
             }))
         } else {
             match &mut pat {
+                Pat::Const(pat) => pat.attrs = attrs,
                 Pat::Ident(pat) => pat.attrs = attrs,
                 Pat::Lit(pat) => pat.attrs = attrs,
                 Pat::Macro(pat) => pat.attrs = attrs,
diff --git a/src/gen/clone.rs b/src/gen/clone.rs
index df47abd6..52b43a82 100644
--- a/src/gen/clone.rs
+++ b/src/gen/clone.rs
@@ -1456,6 +1456,7 @@ impl Clone for ParenthesizedGenericArguments {
 impl Clone for Pat {
     fn clone(&self) -> Self {
         match self {
+            Pat::Const(v0) => Pat::Const(v0.clone()),
             Pat::Ident(v0) => Pat::Ident(v0.clone()),
             Pat::Lit(v0) => Pat::Lit(v0.clone()),
             Pat::Macro(v0) => Pat::Macro(v0.clone()),
@@ -1489,26 +1490,6 @@ impl Clone for PatIdent {
 }
 #[cfg(feature = "full")]
 #[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
-impl Clone for PatLit {
-    fn clone(&self) -> Self {
-        PatLit {
-            attrs: self.attrs.clone(),
-            expr: self.expr.clone(),
-        }
-    }
-}
-#[cfg(feature = "full")]
-#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
-impl Clone for PatMacro {
-    fn clone(&self) -> Self {
-        PatMacro {
-            attrs: self.attrs.clone(),
-            mac: self.mac.clone(),
-        }
-    }
-}
-#[cfg(feature = "full")]
-#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
 impl Clone for PatOr {
     fn clone(&self) -> Self {
         PatOr {
@@ -1520,29 +1501,6 @@ impl Clone for PatOr {
 }
 #[cfg(feature = "full")]
 #[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
-impl Clone for PatPath {
-    fn clone(&self) -> Self {
-        PatPath {
-            attrs: self.attrs.clone(),
-            qself: self.qself.clone(),
-            path: self.path.clone(),
-        }
-    }
-}
-#[cfg(feature = "full")]
-#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
-impl Clone for PatRange {
-    fn clone(&self) -> Self {
-        PatRange {
-            attrs: self.attrs.clone(),
-            start: self.start.clone(),
-            limits: self.limits.clone(),
-            end: self.end.clone(),
-        }
-    }
-}
-#[cfg(feature = "full")]
-#[cfg_attr(doc_cfg, doc(cfg(feature = "clone-impls")))]
 impl Clone for PatReference {
     fn clone(&self) -> Self {
         PatReference {
diff --git a/src/gen/debug.rs b/src/gen/debug.rs
index fa133e76..52e51d56 100644
--- a/src/gen/debug.rs
+++ b/src/gen/debug.rs
@@ -1998,6 +1998,11 @@ impl Debug for ParenthesizedGenericArguments {
 impl Debug for Pat {
     fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
         match self {
+            Pat::Const(v0) => {
+                let mut formatter = formatter.debug_tuple("Const");
+                formatter.field(v0);
+                formatter.finish()
+            }
             Pat::Ident(v0) => {
                 let mut formatter = formatter.debug_tuple("Ident");
                 formatter.field(v0);
@@ -2091,26 +2096,6 @@ impl Debug for PatIdent {
 }
 #[cfg(feature = "full")]
 #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
-impl Debug for PatLit {
-    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
-        let mut formatter = formatter.debug_struct("PatLit");
-        formatter.field("attrs", &self.attrs);
-        formatter.field("expr", &self.expr);
-        formatter.finish()
-    }
-}
-#[cfg(feature = "full")]
-#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
-impl Debug for PatMacro {
-    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
-        let mut formatter = formatter.debug_struct("PatMacro");
-        formatter.field("attrs", &self.attrs);
-        formatter.field("mac", &self.mac);
-        formatter.finish()
-    }
-}
-#[cfg(feature = "full")]
-#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
 impl Debug for PatOr {
     fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
         let mut formatter = formatter.debug_struct("PatOr");
@@ -2122,29 +2107,6 @@ impl Debug for PatOr {
 }
 #[cfg(feature = "full")]
 #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
-impl Debug for PatPath {
-    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
-        let mut formatter = formatter.debug_struct("PatPath");
-        formatter.field("attrs", &self.attrs);
-        formatter.field("qself", &self.qself);
-        formatter.field("path", &self.path);
-        formatter.finish()
-    }
-}
-#[cfg(feature = "full")]
-#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
-impl Debug for PatRange {
-    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
-        let mut formatter = formatter.debug_struct("PatRange");
-        formatter.field("attrs", &self.attrs);
-        formatter.field("start", &self.start);
-        formatter.field("limits", &self.limits);
-        formatter.field("end", &self.end);
-        formatter.finish()
-    }
-}
-#[cfg(feature = "full")]
-#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
 impl Debug for PatReference {
     fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
         let mut formatter = formatter.debug_struct("PatReference");
diff --git a/src/gen/eq.rs b/src/gen/eq.rs
index 2a499556..55990ad9 100644
--- a/src/gen/eq.rs
+++ b/src/gen/eq.rs
@@ -1388,6 +1388,7 @@ impl Eq for Pat {}
 impl PartialEq for Pat {
     fn eq(&self, other: &Self) -> bool {
         match (self, other) {
+            (Pat::Const(self0), Pat::Const(other0)) => self0 == other0,
             (Pat::Ident(self0), Pat::Ident(other0)) => self0 == other0,
             (Pat::Lit(self0), Pat::Lit(other0)) => self0 == other0,
             (Pat::Macro(self0), Pat::Macro(other0)) => self0 == other0,
@@ -1423,26 +1424,6 @@ impl PartialEq for PatIdent {
 }
 #[cfg(feature = "full")]
 #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
-impl Eq for PatLit {}
-#[cfg(feature = "full")]
-#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
-impl PartialEq for PatLit {
-    fn eq(&self, other: &Self) -> bool {
-        self.attrs == other.attrs && self.expr == other.expr
-    }
-}
-#[cfg(feature = "full")]
-#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
-impl Eq for PatMacro {}
-#[cfg(feature = "full")]
-#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
-impl PartialEq for PatMacro {
-    fn eq(&self, other: &Self) -> bool {
-        self.attrs == other.attrs && self.mac == other.mac
-    }
-}
-#[cfg(feature = "full")]
-#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
 impl Eq for PatOr {}
 #[cfg(feature = "full")]
 #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
@@ -1454,27 +1435,6 @@ impl PartialEq for PatOr {
 }
 #[cfg(feature = "full")]
 #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
-impl Eq for PatPath {}
-#[cfg(feature = "full")]
-#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
-impl PartialEq for PatPath {
-    fn eq(&self, other: &Self) -> bool {
-        self.attrs == other.attrs && self.qself == other.qself && self.path == other.path
-    }
-}
-#[cfg(feature = "full")]
-#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
-impl Eq for PatRange {}
-#[cfg(feature = "full")]
-#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
-impl PartialEq for PatRange {
-    fn eq(&self, other: &Self) -> bool {
-        self.attrs == other.attrs && self.start == other.start
-            && self.limits == other.limits && self.end == other.end
-    }
-}
-#[cfg(feature = "full")]
-#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
 impl Eq for PatReference {}
 #[cfg(feature = "full")]
 #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
diff --git a/src/gen/fold.rs b/src/gen/fold.rs
index a13cc0af..4d04f2e6 100644
--- a/src/gen/fold.rs
+++ b/src/gen/fold.rs
@@ -511,26 +511,10 @@ pub trait Fold {
         fold_pat_ident(self, i)
     }
     #[cfg(feature = "full")]
-    fn fold_pat_lit(&mut self, i: PatLit) -> PatLit {
-        fold_pat_lit(self, i)
-    }
-    #[cfg(feature = "full")]
-    fn fold_pat_macro(&mut self, i: PatMacro) -> PatMacro {
-        fold_pat_macro(self, i)
-    }
-    #[cfg(feature = "full")]
     fn fold_pat_or(&mut self, i: PatOr) -> PatOr {
         fold_pat_or(self, i)
     }
     #[cfg(feature = "full")]
-    fn fold_pat_path(&mut self, i: PatPath) -> PatPath {
-        fold_pat_path(self, i)
-    }
-    #[cfg(feature = "full")]
-    fn fold_pat_range(&mut self, i: PatRange) -> PatRange {
-        fold_pat_range(self, i)
-    }
-    #[cfg(feature = "full")]
     fn fold_pat_reference(&mut self, i: PatReference) -> PatReference {
         fold_pat_reference(self, i)
     }
@@ -2464,12 +2448,13 @@ where
     F: Fold + ?Sized,
 {
     match node {
+        Pat::Const(_binding_0) => Pat::Const(f.fold_expr_const(_binding_0)),
         Pat::Ident(_binding_0) => Pat::Ident(f.fold_pat_ident(_binding_0)),
-        Pat::Lit(_binding_0) => Pat::Lit(f.fold_pat_lit(_binding_0)),
-        Pat::Macro(_binding_0) => Pat::Macro(f.fold_pat_macro(_binding_0)),
+        Pat::Lit(_binding_0) => Pat::Lit(f.fold_expr_lit(_binding_0)),
+        Pat::Macro(_binding_0) => Pat::Macro(f.fold_expr_macro(_binding_0)),
         Pat::Or(_binding_0) => Pat::Or(f.fold_pat_or(_binding_0)),
-        Pat::Path(_binding_0) => Pat::Path(f.fold_pat_path(_binding_0)),
-        Pat::Range(_binding_0) => Pat::Range(f.fold_pat_range(_binding_0)),
+        Pat::Path(_binding_0) => Pat::Path(f.fold_expr_path(_binding_0)),
+        Pat::Range(_binding_0) => Pat::Range(f.fold_expr_range(_binding_0)),
         Pat::Reference(_binding_0) => Pat::Reference(f.fold_pat_reference(_binding_0)),
         Pat::Rest(_binding_0) => Pat::Rest(f.fold_pat_rest(_binding_0)),
         Pat::Slice(_binding_0) => Pat::Slice(f.fold_pat_slice(_binding_0)),
@@ -2501,26 +2486,6 @@ where
     }
 }
 #[cfg(feature = "full")]
-pub fn fold_pat_lit<F>(f: &mut F, node: PatLit) -> PatLit
-where
-    F: Fold + ?Sized,
-{
-    PatLit {
-        attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
-        expr: Box::new(f.fold_expr(*node.expr)),
-    }
-}
-#[cfg(feature = "full")]
-pub fn fold_pat_macro<F>(f: &mut F, node: PatMacro) -> PatMacro
-where
-    F: Fold + ?Sized,
-{
-    PatMacro {
-        attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
-        mac: f.fold_macro(node.mac),
-    }
-}
-#[cfg(feature = "full")]
 pub fn fold_pat_or<F>(f: &mut F, node: PatOr) -> PatOr
 where
     F: Fold + ?Sized,
@@ -2533,29 +2498,6 @@ where
     }
 }
 #[cfg(feature = "full")]
-pub fn fold_pat_path<F>(f: &mut F, node: PatPath) -> PatPath
-where
-    F: Fold + ?Sized,
-{
-    PatPath {
-        attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
-        qself: (node.qself).map(|it| f.fold_qself(it)),
-        path: f.fold_path(node.path),
-    }
-}
-#[cfg(feature = "full")]
-pub fn fold_pat_range<F>(f: &mut F, node: PatRange) -> PatRange
-where
-    F: Fold + ?Sized,
-{
-    PatRange {
-        attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
-        start: (node.start).map(|it| Box::new(f.fold_expr(*it))),
-        limits: f.fold_range_limits(node.limits),
-        end: (node.end).map(|it| Box::new(f.fold_expr(*it))),
-    }
-}
-#[cfg(feature = "full")]
 pub fn fold_pat_reference<F>(f: &mut F, node: PatReference) -> PatReference
 where
     F: Fold + ?Sized,
diff --git a/src/gen/hash.rs b/src/gen/hash.rs
index ec0cd6b0..0c077b3d 100644
--- a/src/gen/hash.rs
+++ b/src/gen/hash.rs
@@ -1847,64 +1847,68 @@ impl Hash for Pat {
         H: Hasher,
     {
         match self {
-            Pat::Ident(v0) => {
+            Pat::Const(v0) => {
                 state.write_u8(0u8);
                 v0.hash(state);
             }
-            Pat::Lit(v0) => {
+            Pat::Ident(v0) => {
                 state.write_u8(1u8);
                 v0.hash(state);
             }
-            Pat::Macro(v0) => {
+            Pat::Lit(v0) => {
                 state.write_u8(2u8);
                 v0.hash(state);
             }
-            Pat::Or(v0) => {
+            Pat::Macro(v0) => {
                 state.write_u8(3u8);
                 v0.hash(state);
             }
-            Pat::Path(v0) => {
+            Pat::Or(v0) => {
                 state.write_u8(4u8);
                 v0.hash(state);
             }
-            Pat::Range(v0) => {
+            Pat::Path(v0) => {
                 state.write_u8(5u8);
                 v0.hash(state);
             }
-            Pat::Reference(v0) => {
+            Pat::Range(v0) => {
                 state.write_u8(6u8);
                 v0.hash(state);
             }
-            Pat::Rest(v0) => {
+            Pat::Reference(v0) => {
                 state.write_u8(7u8);
                 v0.hash(state);
             }
-            Pat::Slice(v0) => {
+            Pat::Rest(v0) => {
                 state.write_u8(8u8);
                 v0.hash(state);
             }
-            Pat::Struct(v0) => {
+            Pat::Slice(v0) => {
                 state.write_u8(9u8);
                 v0.hash(state);
             }
-            Pat::Tuple(v0) => {
+            Pat::Struct(v0) => {
                 state.write_u8(10u8);
                 v0.hash(state);
             }
-            Pat::TupleStruct(v0) => {
+            Pat::Tuple(v0) => {
                 state.write_u8(11u8);
                 v0.hash(state);
             }
-            Pat::Type(v0) => {
+            Pat::TupleStruct(v0) => {
                 state.write_u8(12u8);
                 v0.hash(state);
             }
-            Pat::Verbatim(v0) => {
+            Pat::Type(v0) => {
                 state.write_u8(13u8);
+                v0.hash(state);
+            }
+            Pat::Verbatim(v0) => {
+                state.write_u8(14u8);
                 TokenStreamHelper(v0).hash(state);
             }
             Pat::Wild(v0) => {
-                state.write_u8(14u8);
+                state.write_u8(15u8);
                 v0.hash(state);
             }
         }
@@ -1926,28 +1930,6 @@ impl Hash for PatIdent {
 }
 #[cfg(feature = "full")]
 #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
-impl Hash for PatLit {
-    fn hash<H>(&self, state: &mut H)
-    where
-        H: Hasher,
-    {
-        self.attrs.hash(state);
-        self.expr.hash(state);
-    }
-}
-#[cfg(feature = "full")]
-#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
-impl Hash for PatMacro {
-    fn hash<H>(&self, state: &mut H)
-    where
-        H: Hasher,
-    {
-        self.attrs.hash(state);
-        self.mac.hash(state);
-    }
-}
-#[cfg(feature = "full")]
-#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
 impl Hash for PatOr {
     fn hash<H>(&self, state: &mut H)
     where
@@ -1960,31 +1942,6 @@ impl Hash for PatOr {
 }
 #[cfg(feature = "full")]
 #[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
-impl Hash for PatPath {
-    fn hash<H>(&self, state: &mut H)
-    where
-        H: Hasher,
-    {
-        self.attrs.hash(state);
-        self.qself.hash(state);
-        self.path.hash(state);
-    }
-}
-#[cfg(feature = "full")]
-#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
-impl Hash for PatRange {
-    fn hash<H>(&self, state: &mut H)
-    where
-        H: Hasher,
-    {
-        self.attrs.hash(state);
-        self.start.hash(state);
-        self.limits.hash(state);
-        self.end.hash(state);
-    }
-}
-#[cfg(feature = "full")]
-#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
 impl Hash for PatReference {
     fn hash<H>(&self, state: &mut H)
     where
diff --git a/src/gen/visit.rs b/src/gen/visit.rs
index ced379db..8bd9ae6a 100644
--- a/src/gen/visit.rs
+++ b/src/gen/visit.rs
@@ -510,26 +510,10 @@ pub trait Visit<'ast> {
         visit_pat_ident(self, i);
     }
     #[cfg(feature = "full")]
-    fn visit_pat_lit(&mut self, i: &'ast PatLit) {
-        visit_pat_lit(self, i);
-    }
-    #[cfg(feature = "full")]
-    fn visit_pat_macro(&mut self, i: &'ast PatMacro) {
-        visit_pat_macro(self, i);
-    }
-    #[cfg(feature = "full")]
     fn visit_pat_or(&mut self, i: &'ast PatOr) {
         visit_pat_or(self, i);
     }
     #[cfg(feature = "full")]
-    fn visit_pat_path(&mut self, i: &'ast PatPath) {
-        visit_pat_path(self, i);
-    }
-    #[cfg(feature = "full")]
-    fn visit_pat_range(&mut self, i: &'ast PatRange) {
-        visit_pat_range(self, i);
-    }
-    #[cfg(feature = "full")]
     fn visit_pat_reference(&mut self, i: &'ast PatReference) {
         visit_pat_reference(self, i);
     }
@@ -2739,23 +2723,26 @@ where
     V: Visit<'ast> + ?Sized,
 {
     match node {
+        Pat::Const(_binding_0) => {
+            v.visit_expr_const(_binding_0);
+        }
         Pat::Ident(_binding_0) => {
             v.visit_pat_ident(_binding_0);
         }
         Pat::Lit(_binding_0) => {
-            v.visit_pat_lit(_binding_0);
+            v.visit_expr_lit(_binding_0);
         }
         Pat::Macro(_binding_0) => {
-            v.visit_pat_macro(_binding_0);
+            v.visit_expr_macro(_binding_0);
         }
         Pat::Or(_binding_0) => {
             v.visit_pat_or(_binding_0);
         }
         Pat::Path(_binding_0) => {
-            v.visit_pat_path(_binding_0);
+            v.visit_expr_path(_binding_0);
         }
         Pat::Range(_binding_0) => {
-            v.visit_pat_range(_binding_0);
+            v.visit_expr_range(_binding_0);
         }
         Pat::Reference(_binding_0) => {
             v.visit_pat_reference(_binding_0);
@@ -2807,26 +2794,6 @@ where
     }
 }
 #[cfg(feature = "full")]
-pub fn visit_pat_lit<'ast, V>(v: &mut V, node: &'ast PatLit)
-where
-    V: Visit<'ast> + ?Sized,
-{
-    for it in &node.attrs {
-        v.visit_attribute(it);
-    }
-    v.visit_expr(&*node.expr);
-}
-#[cfg(feature = "full")]
-pub fn visit_pat_macro<'ast, V>(v: &mut V, node: &'ast PatMacro)
-where
-    V: Visit<'ast> + ?Sized,
-{
-    for it in &node.attrs {
-        v.visit_attribute(it);
-    }
-    v.visit_macro(&node.mac);
-}
-#[cfg(feature = "full")]
 pub fn visit_pat_or<'ast, V>(v: &mut V, node: &'ast PatOr)
 where
     V: Visit<'ast> + ?Sized,
@@ -2846,35 +2813,6 @@ where
     }
 }
 #[cfg(feature = "full")]
-pub fn visit_pat_path<'ast, V>(v: &mut V, node: &'ast PatPath)
-where
-    V: Visit<'ast> + ?Sized,
-{
-    for it in &node.attrs {
-        v.visit_attribute(it);
-    }
-    if let Some(it) = &node.qself {
-        v.visit_qself(it);
-    }
-    v.visit_path(&node.path);
-}
-#[cfg(feature = "full")]
-pub fn visit_pat_range<'ast, V>(v: &mut V, node: &'ast PatRange)
-where
-    V: Visit<'ast> + ?Sized,
-{
-    for it in &node.attrs {
-        v.visit_attribute(it);
-    }
-    if let Some(it) = &node.start {
-        v.visit_expr(&**it);
-    }
-    v.visit_range_limits(&node.limits);
-    if let Some(it) = &node.end {
-        v.visit_expr(&**it);
-    }
-}
-#[cfg(feature = "full")]
 pub fn visit_pat_reference<'ast, V>(v: &mut V, node: &'ast PatReference)
 where
     V: Visit<'ast> + ?Sized,
diff --git a/src/gen/visit_mut.rs b/src/gen/visit_mut.rs
index 415bf261..abf3b5b9 100644
--- a/src/gen/visit_mut.rs
+++ b/src/gen/visit_mut.rs
@@ -511,26 +511,10 @@ pub trait VisitMut {
         visit_pat_ident_mut(self, i);
     }
     #[cfg(feature = "full")]
-    fn visit_pat_lit_mut(&mut self, i: &mut PatLit) {
-        visit_pat_lit_mut(self, i);
-    }
-    #[cfg(feature = "full")]
-    fn visit_pat_macro_mut(&mut self, i: &mut PatMacro) {
-        visit_pat_macro_mut(self, i);
-    }
-    #[cfg(feature = "full")]
     fn visit_pat_or_mut(&mut self, i: &mut PatOr) {
         visit_pat_or_mut(self, i);
     }
     #[cfg(feature = "full")]
-    fn visit_pat_path_mut(&mut self, i: &mut PatPath) {
-        visit_pat_path_mut(self, i);
-    }
-    #[cfg(feature = "full")]
-    fn visit_pat_range_mut(&mut self, i: &mut PatRange) {
-        visit_pat_range_mut(self, i);
-    }
-    #[cfg(feature = "full")]
     fn visit_pat_reference_mut(&mut self, i: &mut PatReference) {
         visit_pat_reference_mut(self, i);
     }
@@ -2739,23 +2723,26 @@ where
     V: VisitMut + ?Sized,
 {
     match node {
+        Pat::Const(_binding_0) => {
+            v.visit_expr_const_mut(_binding_0);
+        }
         Pat::Ident(_binding_0) => {
             v.visit_pat_ident_mut(_binding_0);
         }
         Pat::Lit(_binding_0) => {
-            v.visit_pat_lit_mut(_binding_0);
+            v.visit_expr_lit_mut(_binding_0);
         }
         Pat::Macro(_binding_0) => {
-            v.visit_pat_macro_mut(_binding_0);
+            v.visit_expr_macro_mut(_binding_0);
         }
         Pat::Or(_binding_0) => {
             v.visit_pat_or_mut(_binding_0);
         }
         Pat::Path(_binding_0) => {
-            v.visit_pat_path_mut(_binding_0);
+            v.visit_expr_path_mut(_binding_0);
         }
         Pat::Range(_binding_0) => {
-            v.visit_pat_range_mut(_binding_0);
+            v.visit_expr_range_mut(_binding_0);
         }
         Pat::Reference(_binding_0) => {
             v.visit_pat_reference_mut(_binding_0);
@@ -2807,26 +2794,6 @@ where
     }
 }
 #[cfg(feature = "full")]
-pub fn visit_pat_lit_mut<V>(v: &mut V, node: &mut PatLit)
-where
-    V: VisitMut + ?Sized,
-{
-    for it in &mut node.attrs {
-        v.visit_attribute_mut(it);
-    }
-    v.visit_expr_mut(&mut *node.expr);
-}
-#[cfg(feature = "full")]
-pub fn visit_pat_macro_mut<V>(v: &mut V, node: &mut PatMacro)
-where
-    V: VisitMut + ?Sized,
-{
-    for it in &mut node.attrs {
-        v.visit_attribute_mut(it);
-    }
-    v.visit_macro_mut(&mut node.mac);
-}
-#[cfg(feature = "full")]
 pub fn visit_pat_or_mut<V>(v: &mut V, node: &mut PatOr)
 where
     V: VisitMut + ?Sized,
@@ -2846,35 +2813,6 @@ where
     }
 }
 #[cfg(feature = "full")]
-pub fn visit_pat_path_mut<V>(v: &mut V, node: &mut PatPath)
-where
-    V: VisitMut + ?Sized,
-{
-    for it in &mut node.attrs {
-        v.visit_attribute_mut(it);
-    }
-    if let Some(it) = &mut node.qself {
-        v.visit_qself_mut(it);
-    }
-    v.visit_path_mut(&mut node.path);
-}
-#[cfg(feature = "full")]
-pub fn visit_pat_range_mut<V>(v: &mut V, node: &mut PatRange)
-where
-    V: VisitMut + ?Sized,
-{
-    for it in &mut node.attrs {
-        v.visit_attribute_mut(it);
-    }
-    if let Some(it) = &mut node.start {
-        v.visit_expr_mut(&mut **it);
-    }
-    v.visit_range_limits_mut(&mut node.limits);
-    if let Some(it) = &mut node.end {
-        v.visit_expr_mut(&mut **it);
-    }
-}
-#[cfg(feature = "full")]
 pub fn visit_pat_reference_mut<V>(v: &mut V, node: &mut PatReference)
 where
     V: VisitMut + ?Sized,
diff --git a/src/lib.rs b/src/lib.rs
index e8056218..960eda4c 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -440,8 +440,8 @@ pub mod parse_quote;
 mod pat;
 #[cfg(feature = "full")]
 pub use crate::pat::{
-    FieldPat, Pat, PatIdent, PatLit, PatMacro, PatOr, PatPath, PatRange, PatReference, PatRest,
-    PatSlice, PatStruct, PatTuple, PatTupleStruct, PatType, PatWild,
+    FieldPat, Pat, PatIdent, PatOr, PatReference, PatRest, PatSlice, PatStruct, PatTuple,
+    PatTupleStruct, PatType, PatWild,
 };
 
 #[cfg(any(feature = "full", feature = "derive"))]
diff --git a/src/pat.rs b/src/pat.rs
index 95bd49a7..1f751641 100644
--- a/src/pat.rs
+++ b/src/pat.rs
@@ -14,17 +14,17 @@ ast_enum_of_structs! {
     #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
     #[non_exhaustive]
     pub enum Pat {
+        /// A const block: `const { ... }`.
+        Const(ExprConst),
+
         /// A pattern that binds a new variable: `ref mut binding @ SUBPATTERN`.
         Ident(PatIdent),
 
         /// A literal pattern: `0`.
-        ///
-        /// This holds an `Expr` rather than a `Lit` because negative numbers
-        /// are represented as an `Expr::Unary`.
-        Lit(PatLit),
+        Lit(ExprLit),
 
         /// A macro in pattern position.
-        Macro(PatMacro),
+        Macro(ExprMacro),
 
         /// A pattern that matches any one of a set of cases.
         Or(PatOr),
@@ -36,10 +36,10 @@ ast_enum_of_structs! {
         /// constants or associated constants. Qualified path patterns like
         /// `<A>::B::C` and `<A as Trait>::B::C` can only legally refer to
         /// associated constants.
-        Path(PatPath),
+        Path(ExprPath),
 
         /// A range pattern: `1..=2`.
-        Range(PatRange),
+        Range(ExprRange),
 
         /// A reference pattern: `&mut var`.
         Reference(PatReference),
@@ -104,27 +104,6 @@ ast_struct! {
     }
 }
 
-ast_struct! {
-    /// A literal pattern: `0`.
-    ///
-    /// This holds an `Expr` rather than a `Lit` because negative numbers
-    /// are represented as an `Expr::Unary`.
-    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
-    pub struct PatLit {
-        pub attrs: Vec<Attribute>,
-        pub expr: Box<Expr>,
-    }
-}
-
-ast_struct! {
-    /// A macro in pattern position.
-    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
-    pub struct PatMacro {
-        pub attrs: Vec<Attribute>,
-        pub mac: Macro,
-    }
-}
-
 ast_struct! {
     /// A pattern that matches any one of a set of cases.
     #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
@@ -135,33 +114,6 @@ ast_struct! {
     }
 }
 
-ast_struct! {
-    /// A path pattern like `Color::Red`, optionally qualified with a
-    /// self-type.
-    ///
-    /// Unqualified path patterns can legally refer to variants, structs,
-    /// constants or associated constants. Qualified path patterns like
-    /// `<A>::B::C` and `<A as Trait>::B::C` can only legally refer to
-    /// associated constants.
-    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
-    pub struct PatPath {
-        pub attrs: Vec<Attribute>,
-        pub qself: Option<QSelf>,
-        pub path: Path,
-    }
-}
-
-ast_struct! {
-    /// A range pattern: `1..=2`.
-    #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
-    pub struct PatRange {
-        pub attrs: Vec<Attribute>,
-        pub start: Option<Box<Expr>>,
-        pub limits: RangeLimits,
-        pub end: Option<Box<Expr>>,
-    }
-}
-
 ast_struct! {
     /// A reference pattern: `&mut var`.
     #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
@@ -436,7 +388,7 @@ pub mod parsing {
             if !contains_arguments {
                 let bang_token: Token![!] = input.parse()?;
                 let (delimiter, tokens) = mac::parse_delimiter(input)?;
-                return Ok(Pat::Macro(PatMacro {
+                return Ok(Pat::Macro(ExprMacro {
                     attrs: Vec::new(),
                     mac: Macro {
                         path,
@@ -455,7 +407,7 @@ pub mod parsing {
         } else if input.peek(Token![..]) {
             pat_range(input, qself, path)
         } else {
-            Ok(Pat::Path(PatPath {
+            Ok(Pat::Path(ExprPath {
                 attrs: Vec::new(),
                 qself,
                 path,
@@ -601,8 +553,8 @@ pub mod parsing {
 
     fn pat_range(input: ParseStream, qself: Option<QSelf>, path: Path) -> Result<Pat> {
         let limits: RangeLimits = input.parse()?;
-        let end = input.call(pat_lit_expr)?;
-        Ok(Pat::Range(PatRange {
+        let end = input.call(pat_range_bound)?;
+        Ok(Pat::Range(ExprRange {
             attrs: Vec::new(),
             start: Some(Box::new(Expr::Path(ExprPath {
                 attrs: Vec::new(),
@@ -610,19 +562,19 @@ pub mod parsing {
                 path,
             }))),
             limits,
-            end,
+            end: end.map(PatRangeBound::into_expr),
         }))
     }
 
     fn pat_range_half_open(input: ParseStream) -> Result<Pat> {
         let limits: RangeLimits = input.parse()?;
-        let end = input.call(pat_lit_expr)?;
+        let end = input.call(pat_range_bound)?;
         if end.is_some() {
-            Ok(Pat::Range(PatRange {
+            Ok(Pat::Range(ExprRange {
                 attrs: Vec::new(),
                 start: None,
                 limits,
-                end,
+                end: end.map(PatRangeBound::into_expr),
             }))
         } else {
             match limits {
@@ -667,27 +619,47 @@ pub mod parsing {
     }
 
     fn pat_lit_or_range(input: ParseStream) -> Result<Pat> {
-        let start = input.call(pat_lit_expr)?.unwrap();
+        let start = input.call(pat_range_bound)?.unwrap();
         if input.peek(Token![..]) {
             let limits: RangeLimits = input.parse()?;
-            let end = input.call(pat_lit_expr)?;
-            Ok(Pat::Range(PatRange {
+            let end = input.call(pat_range_bound)?;
+            Ok(Pat::Range(ExprRange {
                 attrs: Vec::new(),
-                start: Some(start),
+                start: Some(start.into_expr()),
                 limits,
-                end,
+                end: end.map(PatRangeBound::into_expr),
             }))
-        } else if let Expr::Verbatim(verbatim) = *start {
-            Ok(Pat::Verbatim(verbatim))
         } else {
-            Ok(Pat::Lit(PatLit {
-                attrs: Vec::new(),
-                expr: start,
-            }))
+            Ok(start.into_pat())
+        }
+    }
+
+    // Patterns that can appear on either side of a range pattern.
+    enum PatRangeBound {
+        Const(ExprConst),
+        Lit(ExprLit),
+        Path(ExprPath),
+    }
+
+    impl PatRangeBound {
+        fn into_expr(self) -> Box<Expr> {
+            Box::new(match self {
+                PatRangeBound::Const(pat) => Expr::Const(pat),
+                PatRangeBound::Lit(pat) => Expr::Lit(pat),
+                PatRangeBound::Path(pat) => Expr::Path(pat),
+            })
+        }
+
+        fn into_pat(self) -> Pat {
+            match self {
+                PatRangeBound::Const(pat) => Pat::Const(pat),
+                PatRangeBound::Lit(pat) => Pat::Lit(pat),
+                PatRangeBound::Path(pat) => Pat::Path(pat),
+            }
         }
     }
 
-    fn pat_lit_expr(input: ParseStream) -> Result<Option<Box<Expr>>> {
+    fn pat_range_bound(input: ParseStream) -> Result<Option<PatRangeBound>> {
         if input.is_empty()
             || input.peek(Token![|])
             || input.peek(Token![=])
@@ -701,7 +673,7 @@ pub mod parsing {
 
         let lookahead = input.lookahead1();
         let expr = if lookahead.peek(Lit) {
-            Expr::Lit(input.parse()?)
+            PatRangeBound::Lit(input.parse()?)
         } else if lookahead.peek(Ident)
             || lookahead.peek(Token![::])
             || lookahead.peek(Token![<])
@@ -710,14 +682,14 @@ pub mod parsing {
             || lookahead.peek(Token![super])
             || lookahead.peek(Token![crate])
         {
-            Expr::Path(input.parse()?)
+            PatRangeBound::Path(input.parse()?)
         } else if lookahead.peek(Token![const]) {
-            Expr::Const(input.parse()?)
+            PatRangeBound::Const(input.parse()?)
         } else {
             return Err(lookahead.error());
         };
 
-        Ok(Some(Box::new(expr)))
+        Ok(Some(expr))
     }
 
     fn pat_slice(input: ParseStream) -> Result<PatSlice> {
@@ -819,14 +791,6 @@ mod printing {
         }
     }
 
-    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
-    impl ToTokens for PatPath {
-        fn to_tokens(&self, tokens: &mut TokenStream) {
-            tokens.append_all(self.attrs.outer());
-            path::printing::print_path(tokens, &self.qself, &self.path);
-        }
-    }
-
     #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
     impl ToTokens for PatTuple {
         fn to_tokens(&self, tokens: &mut TokenStream) {
@@ -855,24 +819,6 @@ mod printing {
         }
     }
 
-    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
-    impl ToTokens for PatLit {
-        fn to_tokens(&self, tokens: &mut TokenStream) {
-            tokens.append_all(self.attrs.outer());
-            self.expr.to_tokens(tokens);
-        }
-    }
-
-    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
-    impl ToTokens for PatRange {
-        fn to_tokens(&self, tokens: &mut TokenStream) {
-            tokens.append_all(self.attrs.outer());
-            self.start.to_tokens(tokens);
-            self.limits.to_tokens(tokens);
-            self.end.to_tokens(tokens);
-        }
-    }
-
     #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
     impl ToTokens for PatSlice {
         fn to_tokens(&self, tokens: &mut TokenStream) {
@@ -883,14 +829,6 @@ mod printing {
         }
     }
 
-    #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
-    impl ToTokens for PatMacro {
-        fn to_tokens(&self, tokens: &mut TokenStream) {
-            tokens.append_all(self.attrs.outer());
-            self.mac.to_tokens(tokens);
-        }
-    }
-
     #[cfg_attr(doc_cfg, doc(cfg(feature = "printing")))]
     impl ToTokens for PatOr {
         fn to_tokens(&self, tokens: &mut TokenStream) {
diff --git a/syn.json b/syn.json
index 1a374548..c749cfa5 100644
--- a/syn.json
+++ b/syn.json
@@ -3660,6 +3660,11 @@
         ]
       },
       "variants": {
+        "Const": [
+          {
+            "syn": "ExprConst"
+          }
+        ],
         "Ident": [
           {
             "syn": "PatIdent"
@@ -3667,12 +3672,12 @@
         ],
         "Lit": [
           {
-            "syn": "PatLit"
+            "syn": "ExprLit"
           }
         ],
         "Macro": [
           {
-            "syn": "PatMacro"
+            "syn": "ExprMacro"
           }
         ],
         "Or": [
@@ -3682,12 +3687,12 @@
         ],
         "Path": [
           {
-            "syn": "PatPath"
+            "syn": "ExprPath"
           }
         ],
         "Range": [
           {
-            "syn": "PatRange"
+            "syn": "ExprRange"
           }
         ],
         "Reference": [
@@ -3780,44 +3785,6 @@
         }
       }
     },
-    {
-      "ident": "PatLit",
-      "features": {
-        "any": [
-          "full"
-        ]
-      },
-      "fields": {
-        "attrs": {
-          "vec": {
-            "syn": "Attribute"
-          }
-        },
-        "expr": {
-          "box": {
-            "syn": "Expr"
-          }
-        }
-      }
-    },
-    {
-      "ident": "PatMacro",
-      "features": {
-        "any": [
-          "full"
-        ]
-      },
-      "fields": {
-        "attrs": {
-          "vec": {
-            "syn": "Attribute"
-          }
-        },
-        "mac": {
-          "syn": "Macro"
-        }
-      }
-    },
     {
       "ident": "PatOr",
       "features": {
@@ -3846,61 +3813,6 @@
         }
       }
     },
-    {
-      "ident": "PatPath",
-      "features": {
-        "any": [
-          "full"
-        ]
-      },
-      "fields": {
-        "attrs": {
-          "vec": {
-            "syn": "Attribute"
-          }
-        },
-        "qself": {
-          "option": {
-            "syn": "QSelf"
-          }
-        },
-        "path": {
-          "syn": "Path"
-        }
-      }
-    },
-    {
-      "ident": "PatRange",
-      "features": {
-        "any": [
-          "full"
-        ]
-      },
-      "fields": {
-        "attrs": {
-          "vec": {
-            "syn": "Attribute"
-          }
-        },
-        "start": {
-          "option": {
-            "box": {
-              "syn": "Expr"
-            }
-          }
-        },
-        "limits": {
-          "syn": "RangeLimits"
-        },
-        "end": {
-          "option": {
-            "box": {
-              "syn": "Expr"
-            }
-          }
-        }
-      }
-    },
     {
       "ident": "PatReference",
       "features": {


Test patch:
diff --git a/tests/debug/gen.rs b/tests/debug/gen.rs
index 96158a11..c03c1660 100644
--- a/tests/debug/gen.rs
+++ b/tests/debug/gen.rs
@@ -3746,6 +3746,13 @@ impl Debug for Lite<syn::Pat> {
     fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
         let _val = &self.value;
         match _val {
+            syn::Pat::Const(_val) => {
+                formatter.write_str("Const")?;
+                formatter.write_str("(")?;
+                Debug::fmt(Lite(_val), formatter)?;
+                formatter.write_str(")")?;
+                Ok(())
+            }
             syn::Pat::Ident(_val) => {
                 let mut formatter = formatter.debug_struct("Pat::Ident");
                 if !_val.attrs.is_empty() {
@@ -3795,20 +3802,18 @@ impl Debug for Lite<syn::Pat> {
                 formatter.finish()
             }
             syn::Pat::Lit(_val) => {
-                let mut formatter = formatter.debug_struct("Pat::Lit");
-                if !_val.attrs.is_empty() {
-                    formatter.field("attrs", Lite(&_val.attrs));
-                }
-                formatter.field("expr", Lite(&_val.expr));
-                formatter.finish()
+                formatter.write_str("Lit")?;
+                formatter.write_str("(")?;
+                Debug::fmt(Lite(_val), formatter)?;
+                formatter.write_str(")")?;
+                Ok(())
             }
             syn::Pat::Macro(_val) => {
-                let mut formatter = formatter.debug_struct("Pat::Macro");
-                if !_val.attrs.is_empty() {
-                    formatter.field("attrs", Lite(&_val.attrs));
-                }
-                formatter.field("mac", Lite(&_val.mac));
-                formatter.finish()
+                formatter.write_str("Macro")?;
+                formatter.write_str("(")?;
+                Debug::fmt(Lite(_val), formatter)?;
+                formatter.write_str(")")?;
+                Ok(())
             }
             syn::Pat::Or(_val) => {
                 let mut formatter = formatter.debug_struct("Pat::Or");
@@ -3833,68 +3838,18 @@ impl Debug for Lite<syn::Pat> {
                 formatter.finish()
             }
             syn::Pat::Path(_val) => {
-                let mut formatter = formatter.debug_struct("Pat::Path");
-                if !_val.attrs.is_empty() {
-                    formatter.field("attrs", Lite(&_val.attrs));
-                }
-                if let Some(val) = &_val.qself {
-                    #[derive(RefCast)]
-                    #[repr(transparent)]
-                    struct Print(syn::QSelf);
-                    impl Debug for Print {
-                        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
-                            formatter.write_str("Some")?;
-                            let _val = &self.0;
-                            formatter.write_str("(")?;
-                            Debug::fmt(Lite(_val), formatter)?;
-                            formatter.write_str(")")?;
-                            Ok(())
-                        }
-                    }
-                    formatter.field("qself", Print::ref_cast(val));
-                }
-                formatter.field("path", Lite(&_val.path));
-                formatter.finish()
+                formatter.write_str("Path")?;
+                formatter.write_str("(")?;
+                Debug::fmt(Lite(_val), formatter)?;
+                formatter.write_str(")")?;
+                Ok(())
             }
             syn::Pat::Range(_val) => {
-                let mut formatter = formatter.debug_struct("Pat::Range");
-                if !_val.attrs.is_empty() {
-                    formatter.field("attrs", Lite(&_val.attrs));
-                }
-                if let Some(val) = &_val.start {
-                    #[derive(RefCast)]
-                    #[repr(transparent)]
-                    struct Print(Box<syn::Expr>);
-                    impl Debug for Print {
-                        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
-                            formatter.write_str("Some")?;
-                            let _val = &self.0;
-                            formatter.write_str("(")?;
-                            Debug::fmt(Lite(_val), formatter)?;
-                            formatter.write_str(")")?;
-                            Ok(())
-                        }
-                    }
-                    formatter.field("start", Print::ref_cast(val));
-                }
-                formatter.field("limits", Lite(&_val.limits));
-                if let Some(val) = &_val.end {
-                    #[derive(RefCast)]
-                    #[repr(transparent)]
-                    struct Print(Box<syn::Expr>);
-                    impl Debug for Print {
-                        fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
-                            formatter.write_str("Some")?;
-                            let _val = &self.0;
-                            formatter.write_str("(")?;
-                            Debug::fmt(Lite(_val), formatter)?;
-                            formatter.write_str(")")?;
-                            Ok(())
-                        }
-                    }
-                    formatter.field("end", Print::ref_cast(val));
-                }
-                formatter.finish()
+                formatter.write_str("Range")?;
+                formatter.write_str("(")?;
+                Debug::fmt(Lite(_val), formatter)?;
+                formatter.write_str(")")?;
+                Ok(())
             }
             syn::Pat::Reference(_val) => {
                 let mut formatter = formatter.debug_struct("Pat::Reference");
@@ -4089,28 +4044,6 @@ impl Debug for Lite<syn::PatIdent> {
         formatter.finish()
     }
 }
-impl Debug for Lite<syn::PatLit> {
-    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
-        let _val = &self.value;
-        let mut formatter = formatter.debug_struct("PatLit");
-        if !_val.attrs.is_empty() {
-            formatter.field("attrs", Lite(&_val.attrs));
-        }
-        formatter.field("expr", Lite(&_val.expr));
-        formatter.finish()
-    }
-}
-impl Debug for Lite<syn::PatMacro> {
-    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
-        let _val = &self.value;
-        let mut formatter = formatter.debug_struct("PatMacro");
-        if !_val.attrs.is_empty() {
-            formatter.field("attrs", Lite(&_val.attrs));
-        }
-        formatter.field("mac", Lite(&_val.mac));
-        formatter.finish()
-    }
-}
 impl Debug for Lite<syn::PatOr> {
     fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
         let _val = &self.value;
@@ -4136,76 +4069,6 @@ impl Debug for Lite<syn::PatOr> {
         formatter.finish()
     }
 }
-impl Debug for Lite<syn::PatPath> {
-    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
-        let _val = &self.value;
-        let mut formatter = formatter.debug_struct("PatPath");
-        if !_val.attrs.is_empty() {
-            formatter.field("attrs", Lite(&_val.attrs));
-        }
-        if let Some(val) = &_val.qself {
-            #[derive(RefCast)]
-            #[repr(transparent)]
-            struct Print(syn::QSelf);
-            impl Debug for Print {
-                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
-                    formatter.write_str("Some")?;
-                    let _val = &self.0;
-                    formatter.write_str("(")?;
-                    Debug::fmt(Lite(_val), formatter)?;
-                    formatter.write_str(")")?;
-                    Ok(())
-                }
-            }
-            formatter.field("qself", Print::ref_cast(val));
-        }
-        formatter.field("path", Lite(&_val.path));
-        formatter.finish()
-    }
-}
-impl Debug for Lite<syn::PatRange> {
-    fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
-        let _val = &self.value;
-        let mut formatter = formatter.debug_struct("PatRange");
-        if !_val.attrs.is_empty() {
-            formatter.field("attrs", Lite(&_val.attrs));
-        }
-        if let Some(val) = &_val.start {
-            #[derive(RefCast)]
-            #[repr(transparent)]
-            struct Print(Box<syn::Expr>);
-            impl Debug for Print {
-                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
-                    formatter.write_str("Some")?;
-                    let _val = &self.0;
-                    formatter.write_str("(")?;
-                    Debug::fmt(Lite(_val), formatter)?;
-                    formatter.write_str(")")?;
-                    Ok(())
-                }
-            }
-            formatter.field("start", Print::ref_cast(val));
-        }
-        formatter.field("limits", Lite(&_val.limits));
-        if let Some(val) = &_val.end {
-            #[derive(RefCast)]
-            #[repr(transparent)]
-            struct Print(Box<syn::Expr>);
-            impl Debug for Print {
-                fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
-                    formatter.write_str("Some")?;
-                    let _val = &self.0;
-                    formatter.write_str("(")?;
-                    Debug::fmt(Lite(_val), formatter)?;
-                    formatter.write_str(")")?;
-                    Ok(())
-                }
-            }
-            formatter.field("end", Print::ref_cast(val));
-        }
-        formatter.finish()
-    }
-}
 impl Debug for Lite<syn::PatReference> {
     fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
         let _val = &self.value;