From a19b164661675be6a03cacfbc652cbd5f06492a0 Mon Sep 17 00:00:00 2001 From: veetaha Date: Sun, 10 May 2020 19:59:48 +0300 Subject: Correct path docs and add colon2 token to Path ast node --- xtask/src/ast_src.rs | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'xtask/src') diff --git a/xtask/src/ast_src.rs b/xtask/src/ast_src.rs index 2a8a5378d..61580bd1a 100644 --- a/xtask/src/ast_src.rs +++ b/xtask/src/ast_src.rs @@ -1893,32 +1893,35 @@ pub(crate) const AST_SRC: AstSrc = AstSrc { T![')'] } - // TODO: correct the example /// Path to a symbol. Includes single identifier names and elaborate paths with /// generic parameters. /// /// ``` - /// (0..10).❰ collect ❰ ::> ❱ ❱(); - /// ❰ Vec ❰ :: ❰ ::with_capacity ❱ ❱ ❱(1024); - /// ❰ ❰ ::baz ❱ ❱(); - /// ❰ ❰ ::bruuh ❱ ❱(); + /// (0..10).❰ ❰ collect ❱ ::> ❱(); + /// ❰ ❰ ❰ Vec ❱ :: ❱ ::with_capacity ❱(1024); + /// ❰ ❰ <❰ Foo ❱ as ❰ ❰ bar ❱ ::Bar ❱> ❱ ::baz ❱(); + /// ❰ ❰ <❰ bruh ❱> ❱ ::bruuh ❱(); /// ``` /// /// [Reference](https://doc.rust-lang.org/reference/paths.html) struct Path { segment: PathSegment, + T![::], qualifier: Path, } - // TODO: verify the example - // TODO: what RetType is doing here? is this for Fn() -> T syntax? /// Segment of the path to a symbol. + /// Only path segment of an absolute path holds the `::` token, + /// all other `::` tokens that connect path segments reside under `Path` itself.` /// /// ``` - /// (0..10).❰ collect ❱ ❰ ::> ❱(); - /// ❰ Vec >| ❰ :: ❱ ❰ ::with_capacity ❱(1024); - /// ❰ ❱ ❰ ::baz ❱(); - /// ❰ ❱ ❰ ::bruuh ❱(); + /// (0..10).❰ collect ❱ :: ❰ > ❱(); + /// ❰ Vec ❱ :: ❰ ❱ :: ❰ with_capacity ❱(1024); + /// ❰ <❰ Foo ❱ as ❰ bar ❱ :: ❰ Bar ❱> ❱ :: ❰ baz ❱(); + /// ❰ <❰ bruh ❱> ❱ :: ❰ bruuh ❱(); + /// + /// // Note that only in this case `::` token is inlcuded: + /// ❰ ::foo ❱; /// ``` /// /// [Reference](https://doc.rust-lang.org/reference/paths.html) @@ -1956,7 +1959,6 @@ pub(crate) const AST_SRC: AstSrc = AstSrc { /// [Reference](https://doc.rust-lang.org/reference/paths.html#paths-in-expressions) struct TypeArg { TypeRef } - // TODO: verify inline type bounds example /// Associated type argument that is passed at generic instantiation site. /// ``` /// use foo::<'a, u64, bool, ❰ Item = Bar ❱, 42>::baz; -- cgit v1.2.3