about summary refs log tree commit diff
path: root/src/libsyntax/ext/tt/macro_rules.rs
AgeCommit message (Collapse)AuthorLines
2017-05-17Auto merge of #42049 - Mark-Simulacrum:rollup, r=Mark-Simulacrumbors-24/+22
Rollup of 5 pull requests - Successful merges: #41937, #41957, #42017, #42039, #42046 - Failed merges:
2017-05-15adressed comments by @kennytm and @petrochenkovAndre Bogus-1/+2
2017-05-15Address review commentsest31-4/+2
2017-05-13Support #[allow] etc logic on a per macro levelest31-1/+5
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-24/+21
This is mostly removing stray ampersands, needless returns and lifetimes.
2017-05-06Group "macro expansion" notes per call spanEsteban Küber-6/+6
2017-05-05Use diagnostics for trace_macro instead of printlnEsteban Küber-1/+3
2017-04-15feature gate :vis matcherAlex Burka-22/+45
2017-04-15widen :vis follow setAlex Burka-4/+4
2017-04-15parse interpolated visibility tokensAlex Burka-1/+2
2017-04-15update :vis implementation to current rustAlex Burka-6/+6
2017-04-15Implementation of the `vis` macro matcher.Daniel Keep-1/+14
2017-03-30Improve `Path` spans.Jeffrey Seyfried-1/+1
2017-03-27Fix various useless derefs and slicingsOliver Schneider-1/+1
2017-03-14Liberalize attributes.Jeffrey Seyfried-1/+2
2017-03-10Avoid using `Mark` and `Invocation` for macro defs.Jeffrey Seyfried-2/+2
2017-03-10Refactor out `ast::ItemKind::MacroDef`.Jeffrey Seyfried-3/+7
2017-03-03Integrate `TokenStream`.Jeffrey Seyfried-12/+9
2017-02-28Add warning cycle.Jeffrey Seyfried-1/+2
2017-02-28Remove `Token::MatchNt`.Jeffrey Seyfried-54/+62
2017-02-28Add `syntax::ext::tt::quoted::{TokenTree, ..}` and remove ↵Jeffrey Seyfried-34/+42
`tokenstream::TokenTree::Sequence`.
2017-01-23Remove `open_span` and `close_span` from `Delimited`.Jeffrey Seyfried-6/+7
2017-01-17Clean up `ext::tt::transcribe`.Jeffrey Seyfried-11/+2
2017-01-17Refactor the parser to consume token trees.Jeffrey Seyfried-7/+13
2016-12-18Remove scope placeholders, remove method `add_macro` of `ext::base::Resolver`.Jeffrey Seyfried-32/+2
2016-12-18Remove `MacroDef`'s fields `imported_from` and `allow_internal_unstable`,Jeffrey Seyfried-5/+2
remove `export` argument of `resolver.add_macro()`.
2016-12-07macros: fix the expected paths for a non-inline module matched by an `item` ↵Jeffrey Seyfried-8/+9
fragment.
2016-11-22Clean up directory ownership semantics.Jeffrey Seyfried-6/+7
2016-11-21Cleanup `InternedString`.Jeffrey Seyfried-4/+3
2016-11-20Move `syntax::util::interner` -> `syntax::symbol`, cleanup.Jeffrey Seyfried-5/+6
2016-11-03Reduce the size of `Token` and make it cheaper to clone by refactoringJeffrey Seyfried-8/+14
`Token::Interpolated(Nonterminal)` -> `Token::Interpolated(Rc<Nonterminal>)`.
2016-10-29Move `CrateConfig` from `Crate` to `ParseSess`.Jeffrey Seyfried-2/+2
2016-10-24Refactor away fields `MacroDef::{use_locally, export}`.Jeffrey Seyfried-3/+2
2016-10-22Auto merge of #37318 - nnethercote:html5ever-more, r=nrc,eddybbors-7/+12
Avoid some allocations in the macro parser These three commits reduce the number of heap allocations done when compiling rustc-benchmarks/html5ever-2016-08-25 by 20%, from 16.5M to 13.3M. This speeds up (debug) compilation of it with a stage1 compiler by about 7%.
2016-10-21Replace the `String` in `ParseResult::Failure` with `Token`.Nicholas Nethercote-7/+12
This lets us delay creation of failure messages until they are needed, which avoids ~1.6M allocations in html5ever.
2016-10-21Avoid an unnecessary clone in `generic_extensions`.Nicholas Nethercote-2/+2
This avoids ~800,000 allocations in html5ever.
2016-10-19Improve `$crate`.Jeffrey Seyfried-9/+3
2016-10-14Avoid many CrateConfig clones.Nicholas Nethercote-2/+2
This commit changes `ExtCtx::cfg()` so it returns a `CrateConfig` reference instead of a clone. As a result, it also changes all of the `cfg()` callsites to explicitly clone... except one, because the commit also changes `macro_parser::parse()` to take `&CrateConfig`. This is good, because that function can be hot, and `CrateConfig` is expensive to clone. This change almost halves the number of heap allocations done by rustc for `html5ever` in rustc-benchmarks suite, which makes compilation 1.20x faster.
2016-09-28Rollup merge of #36789 - jseyfried:non_inline_mod_in_block, r=nikomatsakisJonathan Turner-1/+1
Allow more non-inline modules in blocks Currently, non-inline modules without a `#[path]` attribute are not allowed in blocks. This PR allows non-inline modules that have an ancestor module with a `#[path]` attribute, provided there is not a nearer ancestor block. For example, ```rust fn main() { #[path = "..."] mod foo { mod bar; //< allowed by this PR fn f() { mod bar; //< still an error } } } ``` Fixes #36772. r? @nikomatsakis
2016-09-28Allow non-inline modules in more places.Jeffrey Seyfried-1/+1
2016-09-26Rollup merge of #36721 - TimNN:infinite-emptiness, r=nrcJonathan Turner-1/+38
reject macros with empty repetitions Fixes #5067 by checking the lhs of `macro_rules!` for repetitions which could match an empty token tree.
2016-09-26reject macros with empty repetitionsTim Neumann-1/+38
2016-09-26Refactor `ensure_complete_parse`.Jeffrey Seyfried-24/+11
2016-09-26Remove `TokResult`.Jeffrey Seyfried-1/+1
2016-09-26Refactor `parse_expansion` out of `ResultAnyMacro`.Jeffrey Seyfried-88/+12
2016-09-24Load macros from `#[macro_use]` extern crates in `resolve`.Jeffrey Seyfried-4/+5
2016-09-24Refactor `ext::tt::macro_rules::compile` to take a `ParseSess` instead of an ↵Jeffrey Seyfried-39/+32
`ExtCtxt`.
2016-09-23reviewer comments and rebasingNick Cameron-7/+4
2016-09-15Remove `MacroRulesTT`.Jeffrey Seyfried-3/+36
2016-09-13Move macro resolution into `librustc_resolve`.Jeffrey Seyfried-2/+2