Skip to content

Commit 3f37f5a

Browse files
committed
Auto merge of #29242 - matklad:fix-comment, r=alexcrichton
Qualified paths allow full path after the `>::`. For example ```rust <T as Foo>::U::generic_method::<f64>() ``` The example is taken from `test/run-pass/associated-item-long-paths.rs`.
2 parents 5fa96e9 + bf2f1e5 commit 3f37f5a

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

src/libsyntax/parse/parser.rs

+15-2
Original file line numberDiff line numberDiff line change
@@ -1595,8 +1595,21 @@ impl<'a> Parser<'a> {
15951595
}
15961596
}
15971597

1598-
// QUALIFIED PATH `<TYPE [as TRAIT_REF]>::IDENT[::<PARAMS>]`
1599-
// Assumes that the leading `<` has been parsed already.
1598+
/// Parses qualified path.
1599+
///
1600+
/// Assumes that the leading `<` has been parsed already.
1601+
///
1602+
/// Qualifed paths are a part of the universal function call
1603+
/// syntax (UFCS).
1604+
///
1605+
/// `qualified_path = <type [as trait_ref]>::path`
1606+
///
1607+
/// See `parse_path` for `mode` meaning.
1608+
///
1609+
/// # Examples:
1610+
///
1611+
/// `<T as U>::a`
1612+
/// `<T as U>::F::a::<S>`
16001613
pub fn parse_qualified_path(&mut self, mode: PathParsingMode)
16011614
-> PResult<(QSelf, ast::Path)> {
16021615
let span = self.last_span;

0 commit comments

Comments
 (0)