]> git.lizzy.rs Git - rust.git/commit
Set tokens on AST node in `collect_tokens`
authorAaron Hill <aa1ronham@gmail.com>
Wed, 13 Jan 2021 21:28:57 +0000 (16:28 -0500)
committerAaron Hill <aa1ronham@gmail.com>
Thu, 14 Jan 2021 03:10:36 +0000 (22:10 -0500)
commita961e6785c7ed33a532bb6172ae0c95f44db5726
treedc59d2e6fa8795734ec9cedb16dcd09b53ae338f
parent9bc8b00b4a4e38ccbc3aeec2c123538973c67eba
Set tokens on AST node in `collect_tokens`

A new `HasTokens` trait is introduced, which is used to move logic from
the callers of `collect_tokens` into the body of `collect_tokens`.

In addition to reducing duplication, this paves the way for PR #80689,
which needs to perform additional logic during token collection.
compiler/rustc_ast/src/ast.rs
compiler/rustc_parse/src/parser/attr.rs
compiler/rustc_parse/src/parser/expr.rs
compiler/rustc_parse/src/parser/item.rs
compiler/rustc_parse/src/parser/mod.rs
compiler/rustc_parse/src/parser/nonterminal.rs
compiler/rustc_parse/src/parser/stmt.rs