about summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2019-10-15Remove unnecessary `use crate::sess::ParseSess;`.Mazdak Farrokhzad-1/+0
2019-10-15Rollup merge of #65428 - phansch:rename_db_var, r=CentrilMazdak Farrokhzad-15/+15
Refactor: Rename `db` locals to `diag` https://github.com/rust-lang/rust/pull/64272 replaced `DiagnosticBuilder` with `Diagnostic` in some places. This PR just renames the db variable from `db` to `diag` where it wasn't renamed. r? @Mark-Simulacrum
2019-10-15Rollup merge of #65426 - ↵Mazdak Farrokhzad-2/+2
nnethercote:rm-custom-LocalInternedString-PartialEq-impls, r=petrochenkov Remove custom `PartialEq` impls for `LocalInternedString`. This is on-trend with the recent changes simplifying `LocalInternedString` and reducing its use. r? @petrochenkov
2019-10-15Rollup merge of #65376 - Centril:syntax-extractions-1, r=petrochenkovMazdak Farrokhzad-368/+380
syntax: misc extractions Part of https://github.com/rust-lang/rust/pull/65324. r? @petrochenkov
2019-10-15syntax::parse::sess -> syntax::sessMazdak Farrokhzad-21/+32
2019-10-15move parse_lit to expr.rsMazdak Farrokhzad-177/+170
2019-10-15syntax: extract sess.rs for ParseSessMazdak Farrokhzad-119/+132
2019-10-15move maybe_report_invalid_custom_discriminants to feature_gateMazdak Farrokhzad-55/+50
2019-10-15Stabilize proc macros generating `macro_rules` itemsVadim Petrochenkov-45/+4
2019-10-15Refactor: Rename `db` locals to `diag`Philipp Hansch-15/+15
https://github.com/rust-lang/rust/pull/64272 replaced `DiagnosticBuilder` with `Diagnostic` in some places. This commit just renames the DB variable from `db` to `diag` where it wasn't renamed.
2019-10-15Remove custom `PartialEq` impls for `LocalInternedString`.Nicholas Nethercote-2/+2
This is on-trend with the recent changes simplifying `LocalInternedString` and reducing its use.
2019-10-14Rollup merge of #65410 - Centril:intersection-pat-recover, r=davidtwco,varkorTyler Mandry-1/+62
syntax: add parser recovery for intersection- / and-patterns `p1 @ p2` Fixes https://github.com/rust-lang/rust/issues/65400. The recovery comes in two flavors: 1. We know that `p2` is a binding so we can invert as `p2 @ p1`: ```rust error: pattern on wrong side of `@` --> $DIR/intersection-patterns.rs:13:9 | LL | Some(x) @ y => {} | -------^^^- | | | | | binding on the right, should be to the left | pattern on the left, should be to the right | help: switch the order: `y @ Some(x)` ``` 2. Otherwise we emit a generic diagnostic for the lack of support for intersection patterns: ```rust error: left-hand side of `@` must be a binding --> $DIR/intersection-patterns.rs:23:9 | LL | Some(x) @ Some(y) => {} | -------^^^------- | | | | | also a pattern | interpreted as a pattern, not a binding | = note: bindings are `x`, `mut x`, `ref x`, and `ref mut x` ``` For more on and-patterns, see e.g. https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/pattern-matching#and-pattern. r? @davidtwco cc @varkor @lzutao
2019-10-14Rollup merge of #65398 - estebank:capitalization-only, r=varkorTyler Mandry-1/+8
Bring attention to suggestions when the only difference is capitalization CC #65386.
2019-10-14Rollup merge of #65261 - nnethercote:rm-Option-from-TokenStream, r=petrochenkovTyler Mandry-153/+109
Remove `Option` from `TokenStream` A code simplification. r? @petrochenkov
2019-10-14pprust: `p1@p2` -> `p1 @ p2`Mazdak Farrokhzad-1/+2
2019-10-14recover_intersection_pat: adjust wordingMazdak Farrokhzad-3/+3
2019-10-14syntax: use `PatKind::Wild` as our `::Err` equivalent.Mazdak Farrokhzad-10/+10
2019-10-14syntax: add recovery for intersection patterns `p1 @ p2`Mazdak Farrokhzad-0/+60
2019-10-14Rollup merge of #65392 - Centril:nt-to-tt, r=Mark-SimulacrumMazdak Farrokhzad-139/+138
Move `Nonterminal::to_tokenstream` to parser & don't rely directly on parser in lowering Split out from https://github.com/rust-lang/rust/pull/65324. r? @petrochenkov
2019-10-14Rollup merge of #65363 - Centril:less-pprust, r=Mark-SimulacrumMazdak Farrokhzad-77/+57
Remove implicit dependencies on syntax::pprust Part of https://github.com/rust-lang/rust/pull/65324. The main goal here is to facilitate the eventual move of pprust out from libsyntax and because an AST definition typically should not depend on its pretty printer. r? @estebank
2019-10-14Rollup merge of #65362 - Centril:extract_fun, r=petrochenkovMazdak Farrokhzad-487/+491
syntax: consolidate function parsing in item.rs Extracted from https://github.com/rust-lang/rust/pull/65324. r? @estebank
2019-10-13Bring attention to suggestions when the only difference is capitalizationEsteban Küber-1/+8
2019-10-14Lazify some `mac_placeholder()` calls.Nicholas Nethercote-7/+7
This avoids some unnecessary creation of empty token streams.
2019-10-14Use `TokenStream::default()` in more places.Nicholas Nethercote-2/+2
2019-10-14Remove the `Option` in `TokenStream`.Nicholas Nethercote-144/+100
It means an allocation is required to create an empty `TokenStream`, but all other operations are simpler and marginally faster due to not having to check for `None`. Overall it simplifies the code for a negligible performance effect. The commit also removes `TokenStream::empty` by implementing `Default`, which is now possible.
2019-10-13token: extract Nonterminal::to_tokenstream to parser.Mazdak Farrokhzad-139/+138
2019-10-13Rollup merge of #65214 - Amanieu:cfg_atomic, r=alexcrichtonMazdak Farrokhzad-0/+1
Split non-CAS atomic support off into target_has_atomic_load_store This PR implements my proposed changes in https://github.com/rust-lang/rust/issues/32976#issuecomment-518542029 by removing `target_has_atomic = "cas"` and splitting `target_has_atomic` into two separate `cfg`s: * `target_has_atomic = 8/16/32/64/128`: This indicates the largest width that the target can atomically CAS (which implies support for all atomic operations). * ` target_has_atomic_load_store = 8/16/32/64/128`: This indicates the largest width that the target can support loading or storing atomically (but may not support CAS). cc #32976 r? @alexcrichton
2019-10-13syntax: consolidate function parsing in `item.rs`Mazdak Farrokhzad-487/+491
2019-10-13Rollup merge of #65360 - Centril:mbrpt, r=petrochenkovMazdak Farrokhzad-25/+27
mbe: reduce panictry! uses. Extracted from https://github.com/rust-lang/rust/pull/65324. r? @petrochenkov
2019-10-13Rollup merge of #65359 - Centril:sil, r=davidtwcoMazdak Farrokhzad-9/+7
simplify integer_lit Extracted from https://github.com/rust-lang/rust/pull/65324. r? @davidtwco
2019-10-13Rollup merge of #65358 - Centril:smsf, r=davidtwcoMazdak Farrokhzad-14/+8
simplify maybe_stage_features Extracted from https://github.com/rust-lang/rust/pull/65324. r? @estebank
2019-10-13Rollup merge of #65357 - Centril:simplify-maybe-annotate-with-ascription, ↵Mazdak Farrokhzad-9/+11
r=davidtwco syntax: simplify maybe_annotate_with_ascription Split out from https://github.com/rust-lang/rust/pull/65324. r? @estebank
2019-10-13Collect occurrences of for mismatched braces diagnosticwangxiangqing-1/+4
Change-Id: I20ba0b62308370ee961141fa1aefc4b9c9f0cb3a
2019-10-13Collect occurrences of for mismatched braces diagnosticwangxiangqing-3/+17
Change-Id: I20ba0b62308370ee961141fa1aefc4b9c9f0cb3a
2019-10-13tokenstream: don't depend on pprustMazdak Farrokhzad-11/+7
2019-10-13ast: remove implicit pprust dependency via Display.Mazdak Farrokhzad-25/+44
Instead just use `pprust::path_to_string(..)` where needed. This has two benefits: a) The AST definition is now independent of printing it. (Therefore we get closer to extracting a data-crate.) b) Debugging should be easier as program flow is clearer.
2019-10-13ast: don't use pprust in DebugMazdak Farrokhzad-41/+6
2019-10-13mbe: reduce panictry! uses.Mazdak Farrokhzad-25/+27
2019-10-13simplify integer_litMazdak Farrokhzad-9/+7
2019-10-13simplify maybe_stage_featuresMazdak Farrokhzad-14/+8
2019-10-13syntax: simplify maybe_annotate_with_ascriptionMazdak Farrokhzad-9/+11
2019-10-12compress the function, remove the assert check.Guanqun Lu-11/+2
2019-10-12replace the hand-written binary search with the library oneGuanqun Lu-13/+5
2019-10-11Auto merge of #64716 - jonhoo:stabilize-mem-take, r=SimonSapinbors-1/+0
Stabilize mem::take (mem_take) Tracking issue: https://github.com/rust-lang/rust/issues/61129 r? @matklad
2019-10-09Auto merge of #65198 - nnethercote:fix-65080, r=Mark-Simulacrumbors-61/+80
Speed up `TokenStream` concatenation This PR fixes the quadratic behaviour identified in #65080. r? @Mark-Simulacrum
2019-10-09Rollup merge of #65037 - anp:track-caller, r=oli-obkMazdak Farrokhzad-0/+5
`#[track_caller]` feature gate (RFC 2091 1/N) RFC text: https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md Tracking issue: https://github.com/rust-lang/rust/issues/47809 I started with @ayosec's commit to add the feature gate with tests and rebased it onto current master. I fixed up some tidy lints and added a test.
2019-10-08Stabilize mem::take (mem_take)Jon Gjengset-1/+0
Tracking issue: https://github.com/rust-lang/rust/issues/61129
2019-10-08Rollup merge of #64284 - Mark-Simulacrum:include-warn, r=petrochenkovMazdak Farrokhzad-0/+1
Warn if include macro fails to include entire file This currently introduces an error, mainly because that was just simpler, and I'm not entirely certain if we can introduce a lint without an RFC and such. This is primarily to get feedback on the approach and overall aim -- in particular, do we think this is helpful? If so, we probably will need lang-team sign off and decide if it should be an error (as currently introduced by this PR), a lint, or a warning. r? @petrochenkov cc https://github.com/rust-lang/rust/issues/35560
2019-10-08Split non-CAS atomic support off into target_has_atomic_load_storeAmanieu d'Antras-0/+1
2019-10-08Rollup merge of #64918 - GuillaumeGomez:long-err-explanation-E0551, r=oli-obkMazdak Farrokhzad-1/+19
Add long error explanation for E0551 Part of #61137