about summary refs log tree commit diff
path: root/src/libsyntax_ext
AgeCommit message (Collapse)AuthorLines
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
2019-05-17Avoid unnecessary interning in `Ident::from_str()` calls.Nicholas Nethercote-5/+6
A lot of these static symbols are pre-interned.
2019-05-13Rollup merge of #60562 - iliekturtles:proc-macro-missing-docs, r=alexcrichtonMazdak Farrokhzad-1/+6
Add #[doc(hidden)] attribute on compiler generated module. Resolves unavoidable `missing_docs` warning/error on proc-macro crates. Resolves #42008. Changes not yet tested locally, however I wanted to submit first since `rustc` takes forever to compile.
2019-05-13Return a `Symbol` from `name_or_empty` functions.Nicholas Nethercote-2/+2
2019-05-13Remove the equality operation between `Symbol` and strings.Nicholas Nethercote-6/+6
And also the equality between `Path` and strings, because `Path` is made up of `Symbol`s.
2019-05-13Pass a `Symbol` to `check_name`, `emit_feature_err`, and related functions.Nicholas Nethercote-31/+36
2019-05-11Add #[doc(hidden)] attribute on compiler generated proc-macro module.Mike Boutin-1/+6
Stops unavoidable `missing_docs` warning/error on proc-macro crates. Resolves #42008.
2019-04-29Auto merge of #60039 - rasendubi:assert-trailing-junk, r=alexcrichtonbors-14/+67
Make assert! ensure the macro is parsed completely Fixes https://github.com/rust-lang/rust/issues/60024
2019-04-25Handle common assert! misusesAlexey Shmalko-14/+60
2019-04-21Introduce `LocalSource` into the AST.David Wood-0/+1
This will be used to keep track of the origin of a local in the AST. In particular, it will be used by `async fn` lowering for the locals in `let <pat>: <ty> = __arg0;` statements.
2019-04-18Auto merge of #60025 - JohnTitor:rename-files, r=petrochenkovbors-1/+1
Rename files about error codes fixes #60017 This PR will be failed in tidy. <details> <summary>The log is here:</summary> ``` tidy check tidy error: duplicate error code: 411 tidy error: Documents\GitHub\rust\src\librustc_resolve\diagnostics.rs:83: __diagnostic_used!(E0411); tidy error: Documents\GitHub\rust\src\librustc_resolve\diagnostics.rs:84: err.code(DiagnosticId::Error("E0411".to_owned())); tidy error: duplicate error code: 424 tidy error: Documents\GitHub\rust\src\librustc_resolve\diagnostics.rs:90: debug!("smart_resolve_path_fragment: E0424, source={:?}", source); tidy error: Documents\GitHub\rust\src\librustc_resolve\diagnostics.rs:92: __diagnostic_used!(E0424); tidy error: Documents\GitHub\rust\src\librustc_resolve\diagnostics.rs:93: err.code(DiagnosticId::Error("E0424".to_owned())); some tidy checks failed ``` </details> I'd like to fix this but I don't know what to do. I will work on later. Please let me know if you have any solutions. r? @petrochenkov
2019-04-17Make assert! ensure the macro is parsed completelyAlexey Shmalko-2/+9
2019-04-17Rename modulesYuki OKUSHI-1/+1
2019-04-17Rename diagnostics to error_codesYuki OKUSHI-0/+0
2019-04-17Fix comments around test harness generationAlexey Shmalko-1/+1