rust/compiler/rustc_parse/src/parser
bors 4ae328bef4 Auto merge of #78296 - Aaron1011:fix/stmt-tokens, r=petrochenkov
Properly handle attributes on statements

We now collect tokens for the underlying node wrapped by `StmtKind`
nstead of storing tokens directly in `Stmt`.

`LazyTokenStream` now supports capturing a trailing semicolon after it
is initially constructed. This allows us to avoid refactoring statement
parsing to wrap the parsing of the semicolon in `parse_tokens`.

Attributes on item statements
(e.g. `fn foo() { #[bar] struct MyStruct; }`) are now treated as
item attributes, not statement attributes, which is consistent with how
we handle attributes on other kinds of statements. The feature-gating
code is adjusted so that proc-macro attributes are still allowed on item
statements on stable.

Two built-in macros (`#[global_allocator]` and `#[test]`) needed to be
adjusted to support being passed `Annotatable::Stmt`.
2020-11-28 07:48:56 +00:00
..
attr.rs rustc_parse: restore pub vis on parse_attribute 2020-11-26 12:54:09 -06:00
diagnostics.rs Permit standalone generic parameters as const generic arguments in macros 2020-11-18 13:16:35 +00:00
expr.rs Add underscore expressions for destructuring assignments 2020-11-14 13:53:12 +00:00
generics.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
item.rs Use reparsed TokenStream if we captured any inner attributes 2020-11-02 13:22:03 -05:00
mod.rs Properly handle attributes on statements 2020-11-26 17:08:35 -05:00
nonterminal.rs Properly handle attributes on statements 2020-11-26 17:08:35 -05:00
pat.rs rustc_ast: visit_mac -> visit_mac_call 2020-11-03 23:39:51 +03:00
path.rs Auto merge of #79266 - b-naber:gat_trait_path_parser, r=petrochenkov 2020-11-27 00:18:24 +00:00
stmt.rs Only eat semicolons for statements that need them 2020-11-26 17:08:35 -05:00
ty.rs Tweak invalid fn header and body parsing 2020-10-25 18:34:14 -07:00