about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2016-03-06 15:54:44 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2016-05-28 17:37:58 +0300
commitcf4682069468f231e6153b9fc910e0c720c71ecb (patch)
tree37407c7a144f143f0340c9c2e5fa4f8c32c247d7 /src/libsyntax
parent216f5fba043ff787ba2dd6bbf01e0e077304adf0 (diff)
downloadrust-cf4682069468f231e6153b9fc910e0c720c71ecb.tar.gz
rust-cf4682069468f231e6153b9fc910e0c720c71ecb.zip
Refactor away some functions from hir::pat_util
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ast.rs18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs
index 9ecaa5b346a..be8d296dab0 100644
--- a/src/libsyntax/ast.rs
+++ b/src/libsyntax/ast.rs
@@ -616,14 +616,10 @@ pub enum PatKind {
     /// Represents a wildcard pattern (`_`)
     Wild,
 
-    /// A `PatKind::Ident` may either be a new bound variable,
-    /// or a unit struct/variant pattern, or a const pattern (in the last two cases
-    /// the third field must be `None`).
-    ///
-    /// In the unit or const pattern case, the parser can't determine
-    /// which it is. The resolver determines this, and
-    /// records this pattern's `NodeId` in an auxiliary
-    /// set (of "PatIdents that refer to unit patterns or constants").
+    /// A `PatKind::Ident` may either be a new bound variable (`ref mut binding @ OPT_SUBPATTERN`),
+    /// or a unit struct/variant pattern, or a const pattern (in the last two cases the third
+    /// field must be `None`). Disambiguation cannot be done with parser alone, so it happens
+    /// during name resolution.
     Ident(BindingMode, SpannedIdent, Option<P<Pat>>),
 
     /// A struct or struct variant pattern, e.g. `Variant {x, y, ..}`.
@@ -639,10 +635,8 @@ pub enum PatKind {
     /// Such pattern can be resolved to a unit struct/variant or a constant.
     Path(Path),
 
-    /// An associated const named using the qualified path `<T>::CONST` or
-    /// `<T as Trait>::CONST`. Associated consts from inherent impls can be
-    /// referred to as simply `T::CONST`, in which case they will end up as
-    /// PatKind::Path, and the resolver will have to sort that out.
+    /// A path pattern written in qualified form, i.e. `<T as Trait>::CONST` or `<T>::CONST`.
+    /// Such patterns can only refer to associated constants at the moment.
     QPath(QSelf, Path),
 
     /// A tuple pattern `(a, b)`.