summary refs log tree commit diff
path: root/src/libsyntax_ext
AgeCommit message (Collapse)AuthorLines
2019-06-23Remove built-in derive macros `Send` and `Sync`Vadim Petrochenkov-10/+0
2019-06-23Fix meta-variable binding errors in macrosJulien Cretin-2/+2
The errors are either: - The meta-variable used in the right-hand side is not bound (or defined) in the left-hand side. - The meta-variable used in the right-hand side does not repeat with the same kleene operator as its binder in the left-hand side. Either it does not repeat enough, or it uses a different operator somewhere. This change should have no semantic impact.
2019-06-19Auto merge of #61172 - matthewjasper:cleanup-implied-bounds-lint, r=varkorbors-1/+0
Improve the explicit_outlives_requirements lint * Don't use Strings to compare parameters * Extend the lint to lifetime bounds * Extend the lint to enums and unions * Use the correct span for where clauses in tuple structs * Try to early-out where possible * Remove unnecessary bounds in rustc crates
2019-06-19Rollup merge of #61898 - petrochenkov:sekind, r=eddybMazdak Farrokhzad-90/+66
syntax: Factor out common fields from `SyntaxExtension` variants And some other related cleanups. Continuation of https://github.com/rust-lang/rust/pull/61606. This will also help to unblock https://github.com/rust-lang/rust/pull/61877.
2019-06-18Remove the HirId/NodeId from where clausesMatthew Jasper-1/+0
Also give them a span in the HIR
2019-06-18Run `rustfmt --file-lines ...` for changes from previous commits.Eduard-Mihai Burtescu-5/+6
2019-06-18rustc: remove 'x: 'y bounds (except from comments/strings).Eduard-Mihai Burtescu-2/+2
2019-06-18syntax: Introduce `default`/`with_unstable` constructors for `ExpnInfo`Vadim Petrochenkov-31/+14
2019-06-18allow_internal_unstable: Avoid some more allocationsVadim Petrochenkov-18/+6
2019-06-18syntax: Factor out common fields from `SyntaxExtension` variantsVadim Petrochenkov-48/+53
2019-06-16Separate libsyntax_ext modulechansuke-215/+212
2019-06-15Remove unnecessary `.clone()`Shotaro Yamada-2/+2
2019-06-12Auto merge of #60669 - c410-f3r:attrs-fn, r=petrochenkovbors-1/+1
Allow attributes in formal function parameters Implements https://github.com/rust-lang/rust/issues/60406. This is my first contribution to the compiler and since this is a large and complex project, I am not fully aware of the consequences of the changes I have made. **TODO** - [x] Forbid some built-in attributes. - [x] Expand cfg/cfg_attr
2019-06-12Rollup merge of #61654 - Electron-libre:use_slice_patterns_in_rustc, ↵Mazdak Farrokhzad-13/+13
r=oli-obk,Centril use pattern matching for slices destructuring refs #61542 Use slices pattern where it seems to make sense .
2019-06-12Rollup merge of #61568 - Mark-Simulacrum:symbol-fmt-macros, r=estebankMazdak Farrokhzad-42/+41
Use Symbol, Span in libfmt_macros I'm not super happy with this, personally, but I think it might be a decent start -- happy to take suggestions as to how to expand this or change things further. r? @estebank Fixes #60795
2019-06-11Auto merge of #61741 - Centril:rollup-fgro5kz, r=Centrilbors-11/+32
Rollup of 11 pull requests Successful merges: - #61518 (Add loops to doc list of things not stable in const fn) - #61526 (move some tests into subfolders) - #61550 (Windows 10 SDK is also required now.) - #61606 (Remove some legacy proc macro flavors) - #61652 (Mention slice patterns in array) - #61686 (librustc_errors: Add some more documentation) - #61698 (typeck: Fix const generic in repeat param ICE.) - #61707 (Azure: retry failed awscli installs) - #61715 (make sure make_ascii_lowercase actually leaves upper-case non-ASCII characters alone) - #61724 (core: use memcmp optimization for 128 bit integer slices) - #61726 (Use `for_each` in `Iterator::partition`) Failed merges: r? @ghost
2019-06-11Run `rustfmt --file-lines ...` for changes from previous commits.Eduard-Mihai Burtescu-4/+5
2019-06-11syntax_ext: deny(unused_lifetimes).Eduard-Mihai Burtescu-1/+2
2019-06-10syntax: Rename variants of `SyntaxExtension` for consistencyVadim Petrochenkov-8/+9
2019-06-10syntax: Remove `SyntaxExtension::DeclMacro`Vadim Petrochenkov-0/+4
It's a less powerful duplicate of `SyntaxExtension::NormalTT`
2019-06-10syntax: Use `MultiItemModifier` for built-in derivesVadim Petrochenkov-4/+20
2019-06-09Introduce InnerSpan abstractionMark Rousskov-20/+20
This should be used when trying to get at subsets of a larger span, especially when the larger span is not available in the code attempting to work with those subsets (especially common in the fmt_macros crate). This is usually a good replacement for (BytePos, BytePos) and (usize, usize) tuples. This commit also removes from_inner_byte_pos, since it took usize arguments, which is error prone.
2019-06-09Shift padding out of suggestions for format stringsMark Rousskov-10/+10
2019-06-09Use Symbol for named arguments in fmt_macrosMark Rousskov-13/+12
2019-06-09Allow attributes in formal function parametersCaio-1/+1
2019-06-08use pattern matching for slices destructuringCedric-13/+13
2019-06-08Rollup merge of #61616 - petrochenkov:parsderef, r=oli-obkMazdak Farrokhzad-4/+4
parser: Remove `Deref` impl from `Parser` Follow up to https://github.com/rust-lang/rust/pull/61541 You have to write `self.token.span` instead of `self.span` in the parser now, which is not nice, but not too bad either, I guess. Not sure. Probably still better than people using both and being confused about the definition point of `span`. r? @oli-obk @estebank
2019-06-07syntax: Treat error literals in more principled wayVadim Petrochenkov-1/+3
2019-06-07parser: `self.span` -> `self.token.span`Vadim Petrochenkov-4/+4
2019-06-06Some code cleanup and tidy/test fixesVadim Petrochenkov-1/+2
2019-06-06syntax: Switch function parameter order in `TokenTree::token`Vadim Petrochenkov-10/+10
2019-06-06syntax: Remove duplicate span from `token::Ident`Vadim Petrochenkov-14/+13
2019-06-06syntax: Remove duplicate span from `token::Lifetime`Vadim Petrochenkov-2/+2
2019-06-06syntax: Use `Token` in `Parser`Vadim Petrochenkov-3/+3
2019-06-06syntax: Use `Token` in `TokenTree::Token`Vadim Petrochenkov-22/+23
2019-06-06syntax: Rename `Token` into `TokenKind`Vadim Petrochenkov-5/+5
2019-06-06Always use token kinds through `token` module rather than `Token` typeVadim Petrochenkov-2/+2
2019-06-05Aggregation of drive-by cosmetic changes.Alexander Regueiro-6/+4
2019-06-03syntax: revert `ast::AsyncArgument` and associated changes.Eduard-Mihai Burtescu-1/+0
Here follows the main reverts applied in order to make this commit: Revert "Rollup merge of #60676 - davidtwco:issue-60674, r=cramertj" This reverts commit 45b09453dbf120cc23d889435aac3ed7d2ec8eb7, reversing changes made to f6df1f6c30b469cb9e65c5453a0efa03cbb6005e. Revert "Rollup merge of #60437 - davidtwco:issue-60236, r=nikomatsakis" This reverts commit 16939a50ea440e72cb6ecefdaabb988addb1ec0e, reversing changes made to 12bf98155249783583a91863c5dccf9e346f1226. Revert "Rollup merge of #59823 - davidtwco:issue-54716, r=cramertj" This reverts commit 62d1574876f5531bce1b267e62dff520d7adcbbb, reversing changes made to 4eff8526a789e0dfa8b97f7dec91b7b5c18e8544.
2019-05-29Introduce and use `SyntaxContext::outer_expn_info()`.Nicholas Nethercote-1/+1
It reduces two `hygiene_data` accesses to one on some hot paths.
2019-05-27Pass symbols to `ExtCtxt::std_path` instead of strings.Nicholas Nethercote-31/+34
Because this function is hot. Also remove the dead `ty_option` function.
2019-05-27Avoid unnecessary internings.Nicholas Nethercote-57/+47
Most involving `Symbol::intern` on string literals.
2019-05-24Tweak macro parse errors when reaching EOF during macro call parseEsteban Küber-2/+6
- Add detail on origin of current parser when reaching EOF and stop saying "found <eof>" and point at the end of macro calls - Handle empty `cfg_attr` attribute - Reword empty `derive` attribute error
2019-05-23syntax: Some code cleanupVadim Petrochenkov-1/+1
2019-05-23syntax: Turn `token::Lit` into a structVadim Petrochenkov-64/+33
2019-05-22Eliminate unnecessary `Ident::with_empty_ctxt`sVadim Petrochenkov-2/+2
2019-05-22Simplify use of keyword symbolsVadim Petrochenkov-18/+19
2019-05-21Move `edition` outside the hygiene lock and avoid accessing itJohn Kåre Alsaker-12/+12
2019-05-20Remove `Symbol::gensym()`.Nicholas Nethercote-1/+1
2019-05-20Eliminate `Symbol::gensymed`.Nicholas Nethercote-1/+1