summary refs log tree commit diff
path: root/compiler/rustc_expand/src/base.rs
AgeCommit message (Collapse)AuthorLines
2020-12-03Fix some clippy lintsJoshua Nelson-6/+4
2020-11-26Properly handle attributes on statementsAaron Hill-2/+0
We now collect tokens for the underlying node wrapped by `StmtKind` instead 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-24Invoke attributes on the statement for statement itemsAaron Hill-0/+9
2020-11-19resolve/expand: Misc cleanupVadim Petrochenkov-1/+3
2020-11-19expand: Tell built-in macros whether we are currently in forced expansion modeVadim Petrochenkov-2/+5
2020-11-01Use the right span for errors about #[deprecated] attributes.Mara Bos-1/+1
2020-10-14Remove unused code from remaining compiler cratesest31-14/+0
2020-09-28expand: Minor fn ptr call cleanupVadim Petrochenkov-3/+3
2020-09-28expand: Stop un-interpolating `NtIdent`s before passing them to built-in macrosVadim Petrochenkov-25/+2
This was a big hack, and built-in macros should be able to deal with `NtIdents` in the input by themselves like any other parser code.
2020-09-10Attach tokens to `ast::Stmt`Aaron Hill-0/+2
We currently only attach tokens when parsing a `:stmt` matcher for a `macro_rules!` macro. Proc-macro attributes on statements are still unstable, and need additional work.
2020-09-10Attach `TokenStream` to `ast::Ty`Aaron Hill-0/+1
A `Ty` does not have outer attributes, so we only capture tokens when parsing a `macro_rules!` matcher
2020-08-30mv compiler to compiler/mark-0/+1227