]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_hir/src/def.rs
Rollup merge of #96616 - akiekintveld:min_stack_relaxed_ordering, r=joshtriplett
[rust.git] / compiler / rustc_hir / src / def.rs
index 324e110005717ac6517f4f357e4b4dc7c08cc1a2..7416ad79aefd0075a960cb9d36caa14b0d1f0b2f 100644 (file)
@@ -663,4 +663,9 @@ pub fn matches_ns(&self, ns: Namespace) -> bool {
     pub fn expected_in_tuple_struct_pat(&self) -> bool {
         matches!(self, Res::Def(DefKind::Ctor(_, CtorKind::Fn), _) | Res::SelfCtor(..))
     }
+
+    /// Returns whether such a resolved path can occur in a unit struct/variant pattern
+    pub fn expected_in_unit_struct_pat(&self) -> bool {
+        matches!(self, Res::Def(DefKind::Ctor(_, CtorKind::Const), _) | Res::SelfCtor(..))
+    }
 }