diff options
| author | bors <bors@rust-lang.org> | 2021-06-06 14:00:43 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-06-06 14:00:43 +0000 |
| commit | 86b0bafbf1e0fab3aa433c10256919d1b6ba46ac (patch) | |
| tree | eec8a787d16fdecaf2605e90e494b36f634a2e3b /compiler/rustc_codegen_llvm/src | |
| parent | f57d5ba3c9ffef4cd2402e3e7d8934bd1a6e9cc1 (diff) | |
| parent | cbdfa1edcaab0dc86b5f9696dea790403bcb0f19 (diff) | |
| download | rust-86b0bafbf1e0fab3aa433c10256919d1b6ba46ac.tar.gz rust-86b0bafbf1e0fab3aa433c10256919d1b6ba46ac.zip | |
Auto merge of #84995 - petrochenkov:tcollect, r=Aaron1011
parser: Ensure that all nonterminals have tokens after parsing
`parse_nonterminal` should always result in something with tokens.
This requirement wasn't satisfied in two cases:
- `stmt` nonterminal with expression statements (e.g. `0`, or `{}`, or `path + 1`) because `fn parse_stmt_without_recovery` forgot to propagate `force_collect` in some cases.
- `expr` nonterminal with expressions with built-in attributes (e.g. `#[allow(warnings)] 0`) due to an incorrect optimization in `fn parse_expr_force_collect`, it assumed that all expressions starting with `#` have their tokens collected during parsing, but that's not true if all the attributes on that expression are built-in and inert.
(Discovered when trying to implement eager `cfg` expansion for all attributes https://github.com/rust-lang/rust/pull/83824#issuecomment-817317170.)
r? `@Aaron1011`
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions
