about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-08-18 22:35:53 +0200
committerMazdak Farrokhzad <twingoow@gmail.com>2019-08-24 21:53:55 +0200
commit92d66a131711bc7817e599c81d081847f689654c (patch)
tree1ddec987b7e7436ee6e4fe57012da4fb5966bc34 /src/libsyntax/parse
parentb7178ef9836fe8e98ffb3f8d4d870c94e6fe816d (diff)
downloadrust-92d66a131711bc7817e599c81d081847f689654c.tar.gz
rust-92d66a131711bc7817e599c81d081847f689654c.zip
parser: document `parse_pat`.
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/parser/pat.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libsyntax/parse/parser/pat.rs b/src/libsyntax/parse/parser/pat.rs
index e4a9dc00977..021e52798af 100644
--- a/src/libsyntax/parse/parser/pat.rs
+++ b/src/libsyntax/parse/parser/pat.rs
@@ -16,6 +16,10 @@ type Expected = Option<&'static str>;
 
 impl<'a> Parser<'a> {
     /// Parses a pattern.
+    ///
+    /// Corresponds to `pat<no_top_alt>` in RFC 2535 and does not admit or-patterns
+    /// at the top level. Used when parsing the parameters of lambda expressions,
+    /// functions, function pointers, and `pat` macro fragments.
     pub fn parse_pat(&mut self, expected: Expected) -> PResult<'a, P<Pat>> {
         self.parse_pat_with_range_pat(true, expected)
     }