rust/compiler/rustc_ast/src
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
..
ast mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
attr Auto merge of #78782 - petrochenkov:nodoctok, r=Aaron1011 2020-11-12 00:33:55 +00:00
expand mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
util Move lev_distance to rustc_ast, make non-generic 2020-11-24 16:12:23 -08:00
ast.rs Auto merge of #78296 - Aaron1011:fix/stmt-tokens, r=petrochenkov 2020-11-28 07:48:56 +00:00
crate_disambiguator.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
entry.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
lib.rs Move lev_distance to rustc_ast, make non-generic 2020-11-24 16:12:23 -08:00
mut_visit.rs Auto merge of #78296 - Aaron1011:fix/stmt-tokens, r=petrochenkov 2020-11-28 07:48:56 +00:00
node_id.rs The renumber pass is long gone 2020-11-06 03:18:01 +01:00
ptr.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
token.rs Adjust pretty-print compat hack to work with item statements 2020-11-25 11:32:08 -05:00
tokenstream.rs Properly handle attributes on statements 2020-11-26 17:08:35 -05:00
visit.rs Auto merge of #78296 - Aaron1011:fix/stmt-tokens, r=petrochenkov 2020-11-28 07:48:56 +00:00