about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2019-07-23Rollup merge of #62869 - matklad:feature-gate, r=Mark-SimulacrumMark Rousskov-0/+3
add rustc_private as a proper language feature gate At the moment, `rustc_private` as a (library) feature exists by accident: `char::is_xid_start`, `char::is_xid_continue` methods in libcore define it. cc https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/How.20to.20declare.20new.20langauge.20feature.3F I don't know if this is at all reasonable, but at least tests seem to pass locally. That probably means that we can remove/rename to something more resonable the feature in libcore in the next release?
2019-07-23Rollup merge of #62851 - matklad:unescape, r=petrochenkovMark Rousskov-609/+5
move unescape module to rustc_lexer It makes sense to keep the definition of escape sequences closer to the lexer itself, and it is also a bit of code that I would like to share with rust-analyzer. r? @petrochenkov
2019-07-23Rollup merge of #62791 - estebank:type-ascription, r=petrochenkovMark Rousskov-65/+73
Handle more cases of typos misinterpreted as type ascription Fix #60933, #54516. CC #47666, #34255, #48016.
2019-07-23cleanup: Remove `extern crate serialize as rustc_serialize`sVadim Petrochenkov-11/+7
2019-07-23Make path::resolve a method on ExtCtxtJonas Schievink-36/+30
2019-07-23Make #[doc(include)] paths behave like other pathsJonas Schievink-5/+2
This makes them relative to the containing file instead of the crate root
2019-07-23libsyntax: factor out file path resolvingJonas Schievink-27/+35
This allows the same logic used by `include_X!` macros to be used by `#[doc(include)]`.
2019-07-22Make the parser TokenStream more resilient after mismatched delimiter recoveryEsteban Küber-0/+3
2019-07-22Rollup merge of #62870 - matklad:issue-62863, r=petrochenkovMazdak Farrokhzad-1/+1
fix lexing of comments with many \r closes #62863
2019-07-22add rustc_private as a proper language feature gateAleksey Kladov-0/+3
At the moment, `rustc_private` as a (library) feature exists by accident: `char::is_xid_start`, `char::is_xid_continue` methods in libcore define it.
2019-07-22fix lexing of comments with many \rAleksey Kladov-1/+1
closes #62863
2019-07-21Fix typo in Unicode character nameAndrew Dassonville-1/+1
2019-07-21move unescape module to rustc_lexerAleksey Kladov-609/+5
2019-07-20Introduce rustc_lexerAleksey Kladov-1251/+536
The idea here is to make a reusable library out of the existing rust-lexer, by separating out pure lexing and rustc-specific concerns, like spans, error reporting an interning. So, rustc_lexer operates directly on `&str`, produces simple tokens which are a pair of type-tag and a bit of original text, and does not report errors, instead storing them as flags on the token.
2019-07-20Auto merge of #62008 - ia0:issues_61053, r=petrochenkovbors-67/+683
Add meta-variable checks in macro definitions This is an implementation of #61053. It is not sound (some errors are not reported) and not complete (reports may not be actual errors). This is due to the possibility to define macros in macros in indirect ways. See module documentation of `macro_check` for more details. What remains to be done: - [x] Migrate from an error to an allow-by-default lint. - [x] Add more comments in particular for the handling of nested macros. - [x] Add more tests if needed. - [x] Try to avoid cloning too much (one idea is to use lists on the stack). - [ ] Run crater with deny-by-default lint (measure rate of false positives). - [ ] Remove extra commit for deny-by-default lint - [x] Create a PR to remove the old `question_mark_macro_sep` lint #62160
2019-07-19review commentsEsteban Küber-16/+10
2019-07-19Implement checks for meta-variables in macrosJulien Cretin-46/+650
2019-07-19Remember the span of the Kleene operator in macrosJulien Cretin-21/+33
This is needed for having complete error messages where reporting macro variable errors. Here is what they would look like: error: meta-variable repeats with different kleene operator --> $DIR/issue-61053-different-kleene.rs:3:57 | LL | ( $( $i:ident = $($j:ident),+ );* ) => { $( $( $i = $j; )* )* }; | - expected repetition ^^ - conflicting repetition
2019-07-19Handle more cases of typos misinterpreted as type ascriptionEsteban Küber-61/+75
2019-07-19Adjust other names after the `Mark` renamingVadim Petrochenkov-35/+35
2019-07-19libsyntax: Remove `Mark` into `ExpnId`Vadim Petrochenkov-25/+25
2019-07-18Auto merge of #61749 - davidtwco:rfc-2203-const-array-repeat-exprs, r=eddybbors-2/+5
rustc/rustc_mir: Implement RFC 2203. This PR implements RFC 2203, allowing constants in array repeat expressions. Part of #49147. r? @eddyb
2019-07-16Rollup merge of #62703 - ↵Mark Rousskov-3/+3
fakenine:normalize_use_of_backticks_compiler_messages_p6, r=eddyb normalize use of backticks in compiler messages for libsyntax/parse https://github.com/rust-lang/rust/issues/60532
2019-07-16Rollup merge of #62666 - estebank:preempt-ice, r=eddybMark Rousskov-8/+9
Cancel unemitted diagnostics during error recovery Follow up to https://github.com/rust-lang/rust/pull/62604. Use @eddyb's preferred style and catch other case of the same problem. r? @eddyb
2019-07-15Rollup merge of #62668 - goodmanjonathan:fix-62660, r=estebankMark Rousskov-1/+1
Fix #62660 If the explicitly given type of a `self` parameter fails to parse correctly, we need to propagate the error rather than dropping it and causing an ICE. Fixes #62660.
2019-07-15Rollup merge of #62646 - estebank:wording, r=petrochenkovMark Rousskov-3/+3
Tweak wording in feature gate errors
2019-07-16normalize use of backticks in compiler messages for libsyntax/parseSamy Kacimi-3/+3
https://github.com/rust-lang/rust/issues/60532
2019-07-15pprust: Support `macro` macrosVadim Petrochenkov-8/+23
2019-07-15pprust: Fix formatting regressions from the previous commitsVadim Petrochenkov-11/+14
Fix some remaining cases of bad formatting Update some failing tests
2019-07-15pprust: Do not convert attributes into `MetaItem`s for printingVadim Petrochenkov-15/+11
Fixes https://github.com/rust-lang/rust/issues/62628
2019-07-15pprust: Remove the box from `print_tts`Vadim Petrochenkov-2/+4
Wrap the whole attribute into a box instead
2019-07-15pprust: Use `print_mac_common` for delimited token groupsVadim Petrochenkov-28/+44
2019-07-15pprust: Use `print_mac_common` for attributesVadim Petrochenkov-4/+18
2019-07-15pprust: Use `print_mac_common` for `macro_rules` definitionsVadim Petrochenkov-26/+16
2019-07-15pprust: Move some methods to the `PrintState` traitVadim Petrochenkov-135/+132
So that path and macro argument printing code can be shared
2019-07-15Auto merge of #62670 - estebank:extern-fn-with-body, r=petrochenkovbors-15/+62
Detect `fn` with a body in an `extern` block Fix #62109.
2019-07-14Auto merge of #62643 - estebank:parse-recovery-type-errs, r=petrochenkovbors-2/+4
Do not emit type errors after parse error in last statement of block When recovering from a parse error inside a block, do not emit type errors generating on that block's recovered return expression. Fix #57383.
2019-07-14Auto merge of #62638 - estebank:issue-62554, r=petrochenkovbors-19/+14
Use snippet instead of pprinting statement Fix #62554.
2019-07-13review commentEsteban Küber-1/+1
2019-07-13Detect `fn` with a body in an `extern` blockEsteban Küber-15/+62
2019-07-13Don't drop DiagnosticBuilder if parsing failsJonathan Goodman-1/+1
If the explicitly given type of a `self` parameter fails to parse correctly, we need to propagate the error rather than dropping it and causing an ICE. Fixes #62660.
2019-07-13Cancel unemitted diagnostics during error recoveryEsteban Küber-8/+9
2019-07-13Tweak wording in feature gate errorsEsteban Küber-3/+3
2019-07-13Rollup merge of #62651 - matthewjasper:rustc-macro-hygiene, r=petrochenkovMazdak Farrokhzad-6/+4
Make some rustc macros more hygienic
2019-07-13Rollup merge of #62604 - estebank:unemitted-err-ice, r=pnkfelixMazdak Farrokhzad-4/+7
Handle errors during error recovery gracefully Fix #62546.
2019-07-13Make `register_[long_]diagnostics` hygienicMatthew Jasper-4/+4
2019-07-13Make `newtype_index` hygienic and use allow_internal_unstableMatthew Jasper-2/+0
2019-07-12Do not emit type errors after parse error in last statement of blockEsteban Küber-2/+4
When recovering from a parse error inside a block, do not emit type errors generating on that block's recovered return expression. Fix #57383.
2019-07-12Use snippet instead of pprinting statementEsteban Küber-19/+14
2019-07-12Rollup merge of #62607 - estebank:this-mem-is-out-of-control, r=petrochenkovMazdak Farrokhzad-2/+3
Correctly break out of recovery loop Fix #61858.