about summary refs log tree commit diff
path: root/src/libsyntax/ext/tt
AgeCommit message (Collapse)AuthorLines
2019-01-09Change `String` to `&'static str` in `ParseResult::Failure`.Nicholas Nethercote-4/+4
This avoids 770,000 allocations when compiling the `html5ever` benchmark, reducing instruction counts by up to 2%.
2019-01-03Fix repeated word typosWiktor Kuchta-1/+1
Found with `git grep -P '\b([a-z]+)\s+\1\b'`
2018-12-25Remove licensesMark Rousskov-40/+0
2018-12-12Rename `TokenStream::concat` and remove `TokenStream::concat_rc_vec`.Nicholas Nethercote-2/+2
`TokenStream::new` is a better name for the former, and the latter is now just equivalent to `TokenStream::Stream`.
2018-12-10Remove `tokenstream::Delimited`.Nicholas Nethercote-13/+14
Because it's an extra type layer that doesn't really help; in a couple of places it actively gets in the way, and overall removing it makes the code nicer. It does, however, move `tokenstream::TokenTree` further away from the `TokenTree` in `quote.rs`. More importantly, this change reduces the size of `TokenStream` from 48 bytes to 40 bytes on x86-64, which is enough to slightly reduce instruction counts on numerous benchmarks, the best by 1.5%. Note that `open_tt` and `close_tt` have gone from being methods on `Delimited` to associated methods of `TokenTree`.
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-16/+16
2018-12-06Rollup merge of #56426 - petrochenkov:syntweak, r=nikomatsakisPietro Albini-1/+0
libsyntax_pos: A few tweaks
2018-12-04Remove redundant cloneShotaro Yamada-1/+1
2018-12-04syntax: Remove `#[non_exhaustive]` from `Edition`Vadim Petrochenkov-1/+0
`Edition` is not a public API, we want users to break when a new edition is added
2018-11-27remove some unused varsMark Mansi-6/+6
2018-11-27remove feature gateMark Mansi-39/+7
2018-11-27Auto merge of #55402 - estebank:macro-eof-2, r=nikomatsakisbors-14/+54
Point at end of macro arm when encountering EOF Fix #52866.
2018-11-23Reword EOF in macro arm messageEsteban Küber-1/+4
2018-11-23Keep label on moved spans and point at macro invocation on parse errorEsteban Küber-8/+12
2018-11-23Point at macro arm when it doesn't expand to an expressionEsteban Küber-3/+7
2018-11-23Reword incorrect macro invocation primary labelEsteban Küber-8/+20
2018-11-23Add label when replacing primary DUMMY_SP in macro expansionEsteban Küber-0/+1
2018-11-23Point at end of macro arm when encountering EOFEsteban Küber-2/+18
Fix #52866
2018-11-21macro_literal_matcher: fixes per petrochenkov's reviewDan Aloni-3/+3
2018-11-21Stabilize macro_literal_matcherDan Aloni-18/+13
2018-11-13Rollup merge of #55870 - waywardmonkeys:typo-fixes, r=wesleywiserkennytm-2/+2
Fix typos.
2018-11-12Make `MatcherPos::stack` a `SmallVec`.Niko Matsakis-34/+57
This avoids some allocations.
2018-11-11Fix typos.Bruce Mitchener-2/+2
2018-11-05Auto merge of #55451 - estebank:arg-doc, r=pnkfelixbors-1/+1
Custom diagnostic when trying to doc comment argument When writing ``` pub fn f( /// Comment id: u8, ) {} ``` Produce a targeted diagnostic ``` error: documentation comments cannot be applied to method arguments --> $DIR/fn-arg-doc-comment.rs:2:5 | LL | /// Comment | ^^^^^^^^^^^ doc comments are not allowed here ``` Fix #54801.
2018-11-01Use `SmallVec` for the inner vectors in `MatcherPos::matches`.Nicholas Nethercote-5/+7
This avoids some allocations.
2018-11-01Share empty `Vec`s more within `MatcherPos::matches`.Nicholas Nethercote-4/+9
`create_matches` creates a `Vec<Rc<Vec<NamedMatch>>>`. Even though all the inner `Vec`s are empty, each one is created separately. This commit changes `create_matches` so it instead creates one empty inner `Vec`, and shares it. The commit also changes `MatcherPos::matches` to a boxed slice, because its length doesn't change.
2018-10-28Provide specific label for patern parsing errorEsteban Küber-1/+1
2018-10-26Auto merge of #54929 - csmoe:cfg_lint, r=petrochenkovbors-1/+1
Suggest to remove prefix `b` in cfg attribute lint string Closes #54926 r? @estebank
2018-10-26Rollup merge of #55358 - sinkuu:redundant_clone2, r=estebankkennytm-4/+3
Remove redundant clone (2)
2018-10-26Rollup merge of #55301 - estebank:macro-allowed, r=petrochenkovkennytm-44/+94
List allowed tokens after macro fragments Fix #34069.
2018-10-26Rollup merge of #55298 - estebank:macro-def, r=pnkfelixkennytm-7/+18
Point at macro definition when no rules expect token Fix #35150.
2018-10-26Rollup merge of #55292 - estebank:macro-eof, r=pnkfelixkennytm-1/+6
Macro diagnostics tweaks Fix #30128, fix #10951 by adding an appropriate span to the diagnostic. Fix #26288 by suggesting adding semicolon to macro call.
2018-10-26Remove redundant cloneShotaro Yamada-4/+3
2018-10-25List allowed tokens after macro fragmentsEsteban Küber-44/+94
2018-10-25Rollup merge of #54977 - estebank:macro-arg-parse, r=pnkfelixPietro Albini-1/+2
Accept `Option<Box<$t:ty>>` in macro argument Given the following code, compile successfuly: ``` macro_rules! test { ( fn fun() -> Option<Box<$t:ty>>; ) => { fn fun(x: $t) -> Option<Box<$t>> { Some(Box::new(x)) } } } test! { fn fun() -> Option<Box<i32>>; } ``` Fix #25274.
2018-10-24Point to macro def span instead of whole bodyEsteban Küber-1/+1
2018-10-23Point at macro definition when no rules expect tokenEsteban Küber-7/+18
2018-10-23Add macro call span when lacking any other span in diagnosticEsteban Küber-1/+6
2018-10-20handle errors based on parse_sesscsmoe-1/+1
2018-10-12Add missing lifetime fragment specifier to error message.Eric Huss-5/+6
A very minor issue, `lifetime` was missing from the error list. I left `literal` in the list, even though it is unstable. It looks like it may stabilize soon anyways.
2018-10-10Accept `Option<Box<$t:ty>>` in macro argumentEsteban Küber-1/+2
Given the following code, compile successfuly: ``` macro_rules! test { ( fn fun() -> Option<Box<$t:ty>>; ) => { fn fun(x: $t) -> Option<Box<$t>> { Some(Box::new(x)) } } } test! { fn fun() -> Option<Box<i32>>; } ```
2018-09-26Remove OneVectorljedrz-8/+8
2018-09-17Whitespace fix again.Vitaly _Vi Shukela-4/+4
2018-09-17Fill in suggestions Applicability according to @estebankVitaly _Vi Shukela-4/+4
Also fix some formatting along the way.
2018-09-16Remove usages of span_suggestion without ApplicabilityVitaly _Vi Shukela-1/+3
Use Applicability::Unspecified for all of them instead.
2018-09-08Rename sp_lo to sp_openDavid Tolnay-10/+10
2018-09-08Track distinct spans for open and close delimiterDavid Tolnay-37/+38
2018-08-28Use FxHash{Map,Set} instead of the default Hash{Map,Set} everywhere in rustc.Eduard-Mihai Burtescu-14/+14
2018-08-23Use optimized SmallVec implementationIgor Gutorov-2/+2
2018-08-21Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkorkennytm-3/+3
Fix typos found by codespell.