about summary refs log tree commit diff
path: root/src/librustc_expand/proc_macro_server.rs
AgeCommit message (Collapse)AuthorLines
2020-08-30mv compiler to compiler/mark-712/+0
2020-08-22Add backwards-compat hack for certain '$name' tokensAaron Hill-7/+13
See issue #74616
2020-08-17rust_ast::ast => rustc_astUjjwal Sharma-1/+1
2020-08-11Introduce `rustc_lexer::is_ident` and use it in couple of placesVadim Petrochenkov-9/+1
2020-08-08Eliminate the `SessionGlobals` from `librustc_ast`.Nicholas Nethercote-1/+1
By moving `{known,used}_attrs` from `SessionGlobals` to `Session`. This means they are accessed via the `Session`, rather than via TLS. A few `Attr` methods and `librustc_ast` functions are now methods of `Session`. All of this required passing a `Session` to lots of functions that didn't already have one. Some of these functions also had arguments removed, because those arguments could be accessed directly via the `Session` argument. `contains_feature_attr()` was dead, and is removed. Some functions were moved from `librustc_ast` elsewhere because they now need to access `Session`, which isn't available in that crate. - `entry_point_type()` --> `librustc_builtin_macros` - `global_allocator_spans()` --> `librustc_metadata` - `is_proc_macro_attr()` --> `Session`
2020-08-06rustc_expand: Don not beautify doc comments before passing them to macrosVadim Petrochenkov-4/+2
Beautify all doc strings in rustdoc instead, including those in `#[doc]` attributes
2020-08-06rustc_ast: Stop using "string typing" for doc comment tokensVadim Petrochenkov-4/+3
Explicitly store their kind and style retrieved during lexing in the token
2020-07-26proc_macro: Add API for tracked access to environment variablesVadim Petrochenkov-0/+9
2020-07-15Remove lots of `Symbol::as_str()` calls.Nicholas Nethercote-2/+2
In various ways, such as changing functions to take a `Symbol` instead of a `&str`.
2020-07-02Auto merge of #73954 - Manishearth:rollup-8qvh170, r=Manishearthbors-1/+1
Rollup of 10 pull requests Successful merges: - #73414 (Implement `slice_strip` feature) - #73564 (linker: Create GNU_EH_FRAME header by default when producing ELFs) - #73622 (Deny unsafe ops in unsafe fns in libcore) - #73684 (add spans to injected coverage counters, extract with CoverageData query) - #73812 (ast_pretty: Pass some token streams and trees by reference) - #73853 (Add newline to rustc MultiSpan docs) - #73883 (Compile rustdoc less often.) - #73885 (Fix wasm32 being broken due to a NodeJS version bump) - #73903 (Changes required for rustc/cargo to build for iOS targets) - #73938 (Optimise fast path of checked_ops with `unlikely`) Failed merges: r? @ghost
2020-07-01Remove `token::FlattenGroup`Vadim Petrochenkov-17/+8
2020-07-01expand: Stop using nonterminals for passing tokens to attribute and derive ↵Vadim Petrochenkov-2/+6
macros
2020-06-27ast_pretty: Pass some token streams and trees by referenceVadim Petrochenkov-1/+1
2020-06-26proc_macro: Stop flattening groups with dummy spansVadim Petrochenkov-12/+26
2020-06-10Migrate to numeric associated constsLzu Tao-4/+4
2020-06-04Add `-Z span-debug` to allow for easier debugging of proc macrosAaron Hill-1/+7
Currently, the `Debug` impl for `proc_macro::Span` just prints out the byte range. This can make debugging proc macros (either as a crate author or as a compiler developer) very frustrating, since neither the actual filename nor the `SyntaxContext` is displayed. This commit adds a perma-unstable flag `-Z span-debug`. When enabled, the `Debug` impl for `proc_macro::Span` simply forwards directly to `rustc_span::Span`. Once #72618 is merged, this will start displaying actual line numbers. While `Debug` impls are not subject to Rust's normal stability guarnatees, we probably shouldn't expose any additional information on stable until `#![feature(proc_macro_span)]` is stabilized. Otherwise, we would be providing a 'backdoor' way to access information that's supposed be behind unstable APIs.
2020-05-29Split payload of FileName::Real to track both real and virutalized paths.Felix S. Klock II-1/+2
Such splits arise from metadata refs into libstd. This way, we can (in a follow on commit) continue to emit the virtual name into things like the like the StableSourceFileId that ends up in incremetnal build artifacts, while still using the devirtualized file path when we want to access the file. Note that this commit is intended to be a refactoring; the actual fix to the bug in question is in a follow-on commit.
2020-05-15Fix {:#?} representation of proc_macro::LiteralDavid Tolnay-3/+8
Before: TokenStream [ Ident { ident: "name", span: #0 bytes(37..41), }, Punct { ch: '=', spacing: Alone, span: #0 bytes(42..43), }, Literal { lit: Lit { kind: Str, symbol: "SNPP", suffix: None }, span: Span { lo: BytePos(44), hi: BytePos(50), ctxt: #0 } }, Punct { ch: ',', spacing: Alone, span: #0 bytes(50..51), }, Ident { ident: "owner", span: #0 bytes(56..61), }, Punct { ch: '=', spacing: Alone, span: #0 bytes(62..63), }, Literal { lit: Lit { kind: Str, symbol: "Canary M Burns", suffix: None }, span: Span { lo: BytePos(64), hi: BytePos(80), ctxt: #0 } }, ] After: TokenStream [ Ident { ident: "name", span: #0 bytes(37..41), }, Punct { ch: '=', spacing: Alone, span: #0 bytes(42..43), }, Literal { kind: Str, symbol: "SNPP", suffix: None, span: #0 bytes(44..50), }, Punct { ch: ',', spacing: Alone, span: #0 bytes(50..51), }, Ident { ident: "owner", span: #0 bytes(56..61), }, Punct { ch: '=', spacing: Alone, span: #0 bytes(62..63), }, Literal { kind: Str, symbol: "Canary M Burns", suffix: None, span: #0 bytes(64..80), }, ]
2020-05-08Remove ast::{Ident, Name} reexports.Camille GILLOT-2/+2
2020-05-03Implement `confusable_idents` lint.Charles Lew-4/+5
2020-02-29Rename `syntax` to `rustc_ast` in source codeVadim Petrochenkov-6/+6
2020-02-28Rollup merge of #69481 - matthiaskrgr:single_char, r=ecstatic-morseMazdak Farrokhzad-2/+2
use char instead of &str for single char patterns
2020-02-27don't use .into() to convert types into identical types.Matthias Krüger-7/+3
example: let s: String = format!("hello").into();
2020-02-27use char instead of &str for single char patternsMatthias Krüger-2/+2
2020-02-01syntax::print -> new crate rustc_ast_prettyMazdak Farrokhzad-1/+1
2020-02-011. move node_id to syntaxMazdak Farrokhzad-1/+1
2. invert rustc_session & syntax deps 3. drop rustc_session dep in rustc_hir
2020-01-10nix syntax::errors & prefer rustc_errors over errorsMazdak Farrokhzad-9/+8
2020-01-01Rename `syntax_pos` to `rustc_span` in source codeVadim Petrochenkov-2/+2
2019-12-31Add symbol normalization for proc_macro_server.Charles Lew-0/+2
2019-12-30Rename directories for some crates from `syntax_x` to `rustc_x`Vadim Petrochenkov-0/+689
`syntax_expand` -> `rustc_expand` `syntax_pos` -> `rustc_span` `syntax_ext` -> `rustc_builtin_macros`