about summary refs log tree commit diff
path: root/src/libsyntax/ext/expand.rs
AgeCommit message (Collapse)AuthorLines
2017-12-17syntax: Rename `P::unwrap` into `P::into_inner`Vadim Petrochenkov-7/+7
2017-12-14Use PathBuf instead of String where applicableOliver Schneider-3/+11
2017-12-09Use hygiene to access the injected crate (`core` or `std`) from builtin macros.Jeffrey Seyfried-2/+0
2017-11-21allow loading external files in documentationQuietMisdreavus-1/+87
Partial implementation of https://github.com/rust-lang/rfcs/pull/1990 (needs error reporting work) cc #44732
2017-11-14avoid the pprust infrastructure in macro expansionAriel Ben-Yehuda-3/+24
This changes macro expansion to format the path of a macro directly instead of usng the pprust infrastructure. The pprust infrastructure tries to perform line-breaking in a slow fashion, which is undesired when formatting the path of a macro. This should to speed up expansion by a fair amount (I saw 20% on a profiler on `rustc_mir`, and 50% of the time marked as "expansion" in the profiler/time-passes is actually spent loading dependencies).
2017-10-03Rename FileMap::path and change to an OptionPhilip Craig-2/+2
2017-09-30Don't use remapped path when loading modules and include filesPhilip Craig-4/+2
2017-09-27Apply attr proc macros before cfg processingTomas Nilsson-14/+25
Now items are not fully configured until right before expanding derives.
2017-09-25Fix bug in collecting trait and impl items with derives.Jeffrey Seyfried-7/+1
2017-09-21suggest an outer attribute when `#![derive(...)]` (predictably) failsZack M. Davis-5/+13
2017-09-21only set non-ADT derive error once per attribute, not per traitZack M. Davis-0/+18
A slight eccentricity of this change is that now non-ADT-derive errors prevent derive-macro-not-found errors from surfacing (see changes to the gating-of-derive compile-fail tests). Resolves #43927.
2017-09-17Rollup merge of #44088 - bjorn3:better_trace_macros, r=jseyfriedTim Neumann-1/+14
Fix "new trace_macros doesn't work if there's an error during expansion" Fixes #43493
2017-09-02Better trace-macro and less span_err_fatalbjorn3-1/+2
2017-08-30Make fields of `Span` privateVadim Petrochenkov-7/+6
2017-08-27Fix errorbjorn3-1/+0
2017-08-25Fix #43493 (new trace_macros doesn't work if there's an error during expansion)bjorn3-0/+13
2017-08-15use field init shorthand EVERYWHEREZack M. Davis-7/+8
Like #43008 (f668999), but _much more aggressive_.
2017-08-12syntax: #[allow_internal_unsafe] bypasses the unsafe_code lint in macros.Eduard-Mihai Burtescu-7/+20
2017-08-07Reexport all SyntaxExtension variantsOliver Schneider-9/+9
2017-07-28syntax: Add `tokens: Option<TokenStream>` to ItemAlex Crichton-0/+1
This commit adds a new field to the `Item` AST node in libsyntax to optionally contain the original token stream that the item itself was parsed from. This is currently `None` everywhere but is intended for use later with procedural macros.
2017-07-25Stabilize the `compile_error_macro` featureAlex Crichton-1/+0
Stabilizes: * `compile_error!` as a macro defined by rustc Closes #40872
2017-07-20Use the macro structure spans instead of the invocationEsteban Küber-0/+1
2017-06-26Add `LazyTokenStream`.Jeffrey Seyfried-30/+10
2017-06-26Simplify `hygiene::Mark` application, andJeffrey Seyfried-20/+16
remove variant `Token::SubstNt` in favor of `quoted::TokenTree::MetaVar`.
2017-06-19Add compile_error!Wesley Wiser-0/+1
Related to #40872
2017-05-31Extend the unused macro lint to macros 2.0est31-2/+3
2017-05-25Hygienize `librustc_resolve`.Jeffrey Seyfried-15/+27
2017-05-17Auto merge of #42049 - Mark-Simulacrum:rollup, r=Mark-Simulacrumbors-15/+11
Rollup of 5 pull requests - Successful merges: #41937, #41957, #42017, #42039, #42046 - Failed merges:
2017-05-13Support #[allow] etc logic on a per macro levelest31-1/+1
This commit extends the current unused macro linter to support directives like #[allow(unused_macros)] or #[deny(unused_macros)] directly next to the macro definition, or in one of the modules the macro is inside. Before, we only supported such directives at a per crate level, due to the crate's NodeId being passed to session.add_lint. We also had to implement handling of the macro's NodeId in the lint visitor.
2017-05-12Fix some clippy warnings in libsyntaxAndre Bogus-15/+11
This is mostly removing stray ampersands, needless returns and lifetimes.
2017-05-08Rollup merge of #41520 - estebank:trace-macro, r=nikomatsakisCorey Farwell-1/+1
Use diagnostics for trace_macro instead of println When using `trace_macro`, use `span_label`s instead of `println`: ```rust note: trace_macro --> $DIR/trace-macro.rs:14:5 | 14 | println!("Hello, World!"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: expands to `println! { "Hello, World!" }` = note: expands to `print! { concat ! ( "Hello, World!" , "\n" ) }` ``` Fix #22597.
2017-05-06Group "macro expansion" notes per call spanEsteban Küber-1/+1
2017-05-01Increase macro recursion limit to 1024 Fixes #22552Charlie Sheridan-1/+1
2017-04-26Implement a file-path remapping feature in support of debuginfo and ↵Michael Woerister-1/+1
reproducible builds.
2017-04-20Don't panic if an attribute macro fails to resolve at crate rootAustin Bonander-2/+12
Adds temporary regression test; this ideally should work as-is (#41430) Closes #41211
2017-04-17Auto merge of #41282 - arielb1:missing-impl-item, r=petrochenkovbors-2/+2
libsyntax/parse: fix missing kind error reporting Fixes #41161. Fixes #41239.
2017-04-17libsyntax/parse: improve associated item error reportingAriel Ben-Yehuda-2/+2
Fixes #41161. Fixes #41239.
2017-04-12First attempt at global_asm! macroA.J. Gardner-0/+1
2017-03-29Merge `ExpnId` and `SyntaxContext`.Jeffrey Seyfried-65/+46
2017-03-29Move `syntax::ext::hygiene` to `syntax_pos::hygiene`.Jeffrey Seyfried-3/+3
2017-03-21Refactor parsing of trait object typesVadim Petrochenkov-1/+1
2017-03-14Liberalize attributes.Jeffrey Seyfried-45/+49
2017-03-14Refactor `Attribute` to use `Path` and `TokenStream` instead of `MetaItem`.Jeffrey Seyfried-34/+8
2017-03-11Auto merge of #40220 - jseyfried:ast_macro_def, r=nrcbors-79/+10
syntax: add `ast::ItemKind::MacroDef`, simplify hygiene info This PR - adds a new variant `MacroDef` to `ast::ItemKind` for `macro_rules!` and eventually `macro` items, - [breaking-change] forbids macro defs without a name (`macro_rules! { () => {} }` compiles today), - removes `ast::MacroDef`, and - no longer uses `Mark` and `Invocation` to identify and characterize macro definitions. - We used to apply (at least) two `Mark`s to an expanded identifier's `SyntaxContext` -- the definition mark(s) and the expansion mark(s). We now only apply the latter. r? @nrc
2017-03-10Expect macro defs in save-analysis and add expn info to spans for attr proc ↵Nick Cameron-1/+13
macros
2017-03-10Avoid using `Mark` and `Invocation` for macro defs.Jeffrey Seyfried-7/+3
2017-03-10Move `resolve_invoc` from `syntax` to `resolve`.Jeffrey Seyfried-60/+2
2017-03-10Refactor out `ast::ItemKind::MacroDef`.Jeffrey Seyfried-12/+5
2017-03-03Integrate `TokenStream`.Jeffrey Seyfried-20/+19
2017-03-03Remove lifetime parameter from `syntax::tokenstream::Cursor`.Jeffrey Seyfried-1/+1