about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2019-08-21fix rebaseEsteban Küber-1/+1
2019-08-21FormattingEsteban Küber-24/+45
2019-08-21Add terminal_width debugging flagEsteban Küber-7/+17
2019-08-21Rollup merge of #63717 - petrochenkov:eager, r=matthewjasperMazdak Farrokhzad-9/+8
Fix nested eager expansions in arguments of `format_args` Fixes https://github.com/rust-lang/rust/issues/63460 Fixes https://github.com/rust-lang/rust/issues/63685 (regression from making `format_args` opaque - https://github.com/rust-lang/rust/pull/63114) r? @matthewjasper
2019-08-21Rollup merge of #63762 - rust-lang:fix-async-date, r=Mark-SimulacrumMazdak Farrokhzad-1/+1
`async_await` was stabilized in 1.39.0, not 1.38.0. r? @Mark-Simulacrum
2019-08-21Rollup merge of #63759 - Centril:parse-default-async-fn, r=petrochenkovMazdak Farrokhzad-0/+1
Allow 'default async fn' to parse. - Parse default async fn. Fixes #63716. (`cherry-pick`ed from 3rd commit in https://github.com/rust-lang/rust/pull/63749.) r? @petrochenkov
2019-08-21Rollup merge of #63755 - Centril:simplify-prexp-gating, r=petrochenkovMazdak Farrokhzad-28/+34
Use dedicated type for spans in pre-expansion gating. - Simplify the overall pre-expansion gating "experience".
2019-08-21Rollup merge of #63721 - Mark-Simulacrum:decouple-error-index, r=matthewjasperMazdak Farrokhzad-124/+4
Do not emit JSON dumps of diagnostic codes This decouples the error index generator from libsyntax for the most part (though it still depends on librustdoc for the markdown parsing and generation). Fixes #34588
2019-08-21resolve/expand: Rename some things for clarity and add commentsVadim Petrochenkov-4/+7
2019-08-21expand: Do not do questionable span adjustment before eagerly expanding an ↵Vadim Petrochenkov-4/+1
expression Maybe it made sense when it was introduced, but now it's doing something incorrect.
2019-08-21expand: Keep the correct current expansion ID for eager expansionsVadim Petrochenkov-1/+0
Solve the problem of `ParentScope` entries for eager expansions not exising in the resolver map by creating them on demand.
2019-08-21async_await was stabilized in 1.39.0, not 1.38.0.Mazdak Farrokhzad-1/+1
2019-08-20Allow 'default async fn' to parse.Mazdak Farrokhzad-0/+1
2019-08-20Use dedicated type for spans in pre-expansion gating.Mazdak Farrokhzad-28/+34
2019-08-20Rollup merge of #63209 - Centril:stabilize-async-await, r=cramertjMazdak Farrokhzad-17/+2
Stabilize `async_await` in Rust 1.39.0 Here we stabilize: - free and inherent `async fn`s, - the `<expr>.await` expression form, - and the `async move? { ... }` block form. Closes https://github.com/rust-lang/rust/issues/62149. Closes https://github.com/rust-lang/rust/issues/50547. All the blockers are now closed. <details> - [x] FCP in https://github.com/rust-lang/rust/issues/62149 - [x] https://github.com/rust-lang/rust/issues/61949; PR in https://github.com/rust-lang/rust/pull/62849. - [x] https://github.com/rust-lang/rust/issues/62517; PR in https://github.com/rust-lang/rust/pull/63376. - [x] https://github.com/rust-lang/rust/issues/63225; PR in https://github.com/rust-lang/rust/pull/63501 - [x] https://github.com/rust-lang/rust/issues/63388; PR in https://github.com/rust-lang/rust/pull/63499 - [x] https://github.com/rust-lang/rust/issues/63500; PR in https://github.com/rust-lang/rust/pull/63501 - [x] https://github.com/rust-lang/rust/issues/62121#issuecomment-506884048 - [x] Some tests for control flow (PR https://github.com/rust-lang/rust/pull/63387): - `?` - `return` in `async` blocks - `break` - [x] https://github.com/rust-lang/rust/pull/61775#issuecomment-506883180, i.e. tests for https://github.com/rust-lang/rust/pull/60944 with `async fn`s instead). PR in https://github.com/rust-lang/rust/pull/63383 </details> r? @cramertj
2019-08-20Remove serialization of diagnostics to filesMark Rousskov-124/+4
This is no longer used by the index generator and was always an unstable compiler detail, so strip it out. This also leaves in RUSTC_ERROR_METADATA_DST since the stage0 compiler still needs it to be set.
2019-08-20Stabilize 'async_await'.Mazdak Farrokhzad-17/+2
2019-08-19glue tokens when building token streamAleksey Kladov-10/+34
2019-08-19remove composite tokens support from the lexerAleksey Kladov-37/+20
2019-08-18Auto merge of #62948 - matklad:failable-file-loading, r=petrochenkovbors-66/+15
Normalize newlines when loading files Fixes #62865
2019-08-18Auto merge of #61708 - dlrobertson:or-patterns-0, r=centrilbors-28/+80
Initial implementation of or-patterns An incomplete implementation of or-patterns (e.g. `Some(0 | 1)` as a pattern). This patch set aims to implement initial parsing of `or-patterns`. Related to: #54883 CC @alexreg @varkor r? @Centril
2019-08-17resolve/expand: Rename some things for clarityVadim Petrochenkov-19/+21
2019-08-17initial implementation of or-pattern parsingDan Robertson-40/+59
Initial implementation of parsing or-patterns e.g., `Some(Foo | Bar)`. This is a partial implementation of RFC 2535.
2019-08-17Initial implementation of or patternsvarkor-11/+44
2019-08-17Remove SyntaxContext from {ast, hir}::{GlobalAsm, InlineAsm}Matthew Jasper-4/+2
We now store it in the `Span` of the expression or item.
2019-08-17Rollup merge of #63545 - Centril:gate-yield-preexp, r=oli-obkMazdak Farrokhzad-30/+16
Feature gate 'yield $expr?' pre-expansion Also improve the overall ergonomics of pre-expansion gating in general. r? @Zoxc
2019-08-16Simplify pre-expansion gating in general.Mazdak Farrokhzad-32/+10
2019-08-16Feature gate 'yield ?' pre-expansion.Mazdak Farrokhzad-5/+13
2019-08-16Rollup merge of #63525 - matklad:centraliza-file-loading, r=petrochenkovMazdak Farrokhzad-8/+25
Make sure that all file loading happens via SourceMap That way, callers don't need to repeat "let's add this to sm manually for tracking dependencies" trick. It should make it easier to switch to using `FileLoader` for binary files in the future as well cc #62948 r? @petrochenkov
2019-08-15hygiene: `ExpnInfo` -> `ExpnData`Vadim Petrochenkov-28/+28
For naming consistency with everything else in this area
2019-08-15syntax_pos: Remove the duplicate global editionVadim Petrochenkov-29/+6
It was introduced to avoid going through `hygiene_data`, but now it's read only once, when `ParseSess` is created, so going through a lock is ok.
2019-08-15hygiene: Merge `ExpnInfo` and `InternalExpnData`Vadim Petrochenkov-8/+12
2019-08-15hygiene: Remove `Option`s from functions returning `ExpnInfo`Vadim Petrochenkov-24/+17
The expansion info is not optional and should always exist
2019-08-15`Ident::with_empty_ctxt` -> `Ident::with_dummy_span`Vadim Petrochenkov-13/+13
`Ident` has had a full span rather than just a `SyntaxContext` for a long time now.
2019-08-15syntax_pos: `NO_EXPANSION`/`SyntaxContext::empty()` -> `SyntaxContext::root()`Vadim Petrochenkov-24/+22
For consistency with `ExpnId::root`. Also introduce a helper `Span::with_root_ctxt` for creating spans with `SyntaxContext::root()` context
2019-08-15syntax_pos: Introduce a helper for checking whether a span comes from expansionVadim Petrochenkov-1/+1
2019-08-15Remove `Spanned` from `{ast,hir}::FieldPat`Vadim Petrochenkov-28/+20
2019-08-15Remove `Spanned` from `ast::Mac`Vadim Petrochenkov-42/+47
2019-08-15Remove `Spanned` from `mk_name_value_item_str` and `expr_to_spanned_string`Vadim Petrochenkov-16/+18
2019-08-15Make sure that all file loading happens via SourceMapAleksey Kladov-8/+25
That way, callers don't need to repeat "let's add this to sm manually for tracking dependencies" trick. It should make it easier to switch to using `FileLoader` for binary files in the future as well
2019-08-14Rollup merge of #63543 - c410-f3r:variant, r=c410-f3rMazdak Farrokhzad-32/+33
Merge Variant and Variant_ Extracted from #63468.
2019-08-14Rollup merge of #63542 - c410-f3r:node_ids, r=petrochenkovMazdak Farrokhzad-3/+18
Add NodeId for Arm, Field and FieldPat Extracted from #63468
2019-08-14Rollup merge of #63537 - petrochenkov:novisit, r=alexcrichtonMazdak Farrokhzad-19/+13
expand: Unimplement `MutVisitor` on `MacroExpander` Each call to `fully_expand_fragment` is something unique, interesting, and requiring attention. It represents a "root" of expansion and its use means that something unusual is happening, like eager expansion or expansion performed outside of the primary expansion pass. So, it shouldn't hide under a generic visitor call. Also, from all the implemented visitor methods only two were actually used. cc https://github.com/rust-lang/rust/pull/63468#discussion_r313504119
2019-08-14Rollup merge of #63528 - petrochenkov:anyany, r=estebankMazdak Farrokhzad-33/+6
syntax: Remove `DummyResult::expr_only` The effect is that if a built-in macro both returns an erroneous AST fragment and is used in unexpected position, then the incorrect position error won't be reported. This combination of two errors should be rare and isn't worth an extra field that makes people ask questions in comments. (There wasn't even a test making sure it worked.) Addresses https://github.com/rust-lang/rust/pull/63468#discussion_r313504644 r? @estebank
2019-08-14Rollup merge of #63490 - Centril:cleanup-pat-parser, r=petrochenkovMazdak Farrokhzad-190/+235
libsyntax: cleanup and refactor `pat.rs` A smaller refactoring & cleanup of `pat.rs` (best read commit by commit). r? @petrochenkov
2019-08-14Rollup merge of #62984 - nathanwhit:extra_semi_lint, r=varkorMazdak Farrokhzad-1/+16
Add lint for excess trailing semicolons Closes #60876. A caveat (not necessarily a negative, but something to consider) with this implementation is that excess semicolons after return/continue/break now also cause an 'unreachable statement' warning. For the following example: ``` fn main() { extra_semis(); } fn extra_semis() -> i32 { let mut sum = 0;;; for i in 0..10 { if i == 5 { continue;; } else if i == 9 { break;; } else { sum += i;; } } return sum;; } ``` The output is: ``` warning: unnecessary trailing semicolons --> src/main.rs:5:21 | 5 | let mut sum = 0;;; | ^^ help: remove these semicolons | = note: `#[warn(redundant_semicolon)]` on by default warning: unnecessary trailing semicolon --> src/main.rs:8:22 | 8 | continue;; | ^ help: remove this semicolon warning: unnecessary trailing semicolon --> src/main.rs:10:19 | 10 | break;; | ^ help: remove this semicolon warning: unnecessary trailing semicolon --> src/main.rs:12:22 | 12 | sum += i;; | ^ help: remove this semicolon warning: unnecessary trailing semicolon --> src/main.rs:15:16 | 15 | return sum;; | ^ help: remove this semicolon warning: unreachable statement --> src/main.rs:8:22 | 8 | continue;; | ^ | = note: `#[warn(unreachable_code)]` on by default warning: unreachable statement --> src/main.rs:10:19 | 10 | break;; | ^ warning: unreachable statement --> src/main.rs:15:16 | 15 | return sum;; | ^ ```
2019-08-14Merge Variant and Variant_Caio-32/+33
2019-08-14remove special handling of \r\n from the lexerAleksey Kladov-66/+15
2019-08-14Rollup merge of #63530 - ehuss:typo-statemement, r=centrilMazdak Farrokhzad-1/+1
Fix typo in error message.
2019-08-14Rollup merge of #63508 - estebank:compromice, r=petrochenkovMazdak Farrokhzad-6/+9
Do not ICE when synthesizing spans falling inside unicode chars Fix https://github.com/rust-lang/rust/issues/61226.