From bf2f1e512a94e34f40b729fe7347480d63dcab1b Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 23 Oct 2015 02:17:03 +0300 Subject: [PATCH] parser: fix erroneous comment Qualified paths allow full path after the `>::`. For example ```rust ::U::generic_method::() ``` The example is taken from `test/run-pass/associated-item-long-paths.rs`. --- src/libsyntax/parse/parser.rs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index d9f7ec67fe6..fcebe035961 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -1595,8 +1595,21 @@ impl<'a> Parser<'a> { } } - // QUALIFIED PATH `::IDENT[::]` - // Assumes that the leading `<` has been parsed already. + /// Parses qualified path. + /// + /// Assumes that the leading `<` has been parsed already. + /// + /// Qualifed paths are a part of the universal function call + /// syntax (UFCS). + /// + /// `qualified_path = ::path` + /// + /// See `parse_path` for `mode` meaning. + /// + /// # Examples: + /// + /// `::a` + /// `::F::a::` pub fn parse_qualified_path(&mut self, mode: PathParsingMode) -> PResult<(QSelf, ast::Path)> { let span = self.last_span;