summary refs log tree commit diff
path: root/src/libsyntax
AgeCommit message (Collapse)AuthorLines
2019-08-03review commentsEsteban Küber-3/+4
2019-08-03Fix another caseEsteban Küber-3/+12
2019-08-03Make the parser TokenStream more resilient after mismatched delimiter recoveryEsteban Küber-0/+3
2019-07-22Rollup merge of #62792 - goodmanjonathan:beta, r=estebankPietro Albini-1/+1
2019-07-22Cancel unemitted diagnostics during error recoveryEsteban Küber-8/+9
2019-07-22Correctly break out of recovery loopEsteban Küber-2/+3
2019-07-22Handle errors during error recovery gracefullyEsteban Küber-4/+7
2019-07-18Don't drop DiagnosticBuilder if parsing failsJonathan Goodman-1/+1
Beta backport of #62668. 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.
2019-07-02more nits + typosNiko Matsakis-1/+1
2019-07-02feature-gate member constraints outside of async-awaitNiko Matsakis-0/+3
Minimizes risk.
2019-07-01Auto merge of #62253 - Centril:rollup-115uuuq, r=Centrilbors-8/+18
Rollup of 8 pull requests Successful merges: - #62062 (Use a more efficient iteration order for forward dataflow) - #62063 (Use a more efficient iteration order for backward dataflow) - #62224 (rustdoc: remove unused derives and variants) - #62228 (Extend the #[must_use] lint to boxed types) - #62235 (Extend the `#[must_use]` lint to arrays) - #62239 (Fix a typo) - #62241 (Always parse 'async unsafe fn' + properly ban in 2015) - #62248 (before_exec actually will only get deprecated with 1.37) Failed merges: r? @ghost
2019-07-01Auto merge of #61682 - Centril:stabilize-type_alias_enum_variants, ↵bors-3/+2
r=petrochenkov Stabilize `type_alias_enum_variants` in Rust 1.37.0 Stabilize `#![feature(type_alias_enum_variants)]` which allows type-relative resolution with highest priority to `enum` variants in both expression and pattern contexts. For example, you may now write: ```rust enum Option<T> { None, Some(T), } type OptAlias<T> = Option<T>; fn work_on_alias(x: Option<u8>) -> u8 { match x { OptAlias::Some(y) => y + 1, OptAlias::None => 0, } } ``` Closes https://github.com/rust-lang/rfcs/issues/2218 Closes https://github.com/rust-lang/rust/issues/52118 r? @petrochenkov
2019-06-29Always parse 'async unsafe fn' + properly ban in 2015.Mazdak Farrokhzad-8/+18
2019-06-27Rollup merge of #62160 - ia0:question_mark_macro_sep, r=petrochenkovMazdak Farrokhzad-2/+0
Remove outdated question_mark_macro_sep lint
2019-06-27Rollup merge of #62154 - mark-i-m:old-fixme, r=CentrilMazdak Farrokhzad-1/+1
Remove old fixme fixed in https://github.com/rust-lang/rust/pull/60160 r? @Centril
2019-06-27Rollup merge of #62131 - Xanewok:clip-some-nits, r=petrochenkovMazdak Farrokhzad-25/+25
libsyntax: Fix some Clippy warnings When I was working on it before a lot of these popped up in the RLS so I figured I'll send a small patch fixing only the (hopefully) uncontroversial ones. Others that could be also fixed included also [`clippy::print_with_newline`](https://rust-lang.github.io/rust-clippy/master/index.html#print_with_newline) and [`clippy::cast_lossless`](https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless). Should I add them as well? since most of it touches libsyntax... r? @petrochenkov
2019-06-27Rollup merge of #62124 - matklad:without-with, r=petrochenkovMazdak Farrokhzad-139/+121
refactor lexer to use idiomatic borrowing
2019-06-26Remove outdated question_mark_macro_sep lintJulien Cretin-2/+0
2019-06-26remove old fixmeMark Mansi-1/+1
2019-06-26Fix clippy::print_with_newlineIgor Matuszewski-1/+1
2019-06-26Fix clippy::redundant_field_namesIgor Matuszewski-24/+24
2019-06-25cleanup: rename name_from to symbol_fromAleksey Kladov-20/+19
Lexer uses Symbols for a lot of stuff, not only for identifiers, so the "name" terminology is just confusing.
2019-06-25refactor lexer to use idiomatic borrowingAleksey Kladov-121/+104
2019-06-25Auto merge of #60732 - jswrenn:arbitrary_enum_discriminant, r=pnkfelixbors-41/+75
Implement arbitrary_enum_discriminant Implements RFC rust-lang/rfcs#2363 (tracking issue #60553).
2019-06-24Auto merge of #62075 - Centril:guardless-match-arms, r=petrochenkovbors-31/+10
Remove `ast::Guard` With the introduction of `ast::ExprKind::Let` in https://github.com/rust-lang/rust/pull/60861, the `ast::Guard` structure is now redundant in terms of representing [`if let` guards](https://github.com/rust-lang/rust/issues/51114) in AST since it can be represented by `ExprKind::Let` syntactically. Therefore, we remove `ast::Guard` here. However, we keep `hir::Guard` because the semantic representation is a different matter and this story is more unclear right now (might involve `goto 'arm` in HIR or something...). r? @petrochenkov
2019-06-23Auto merge of #62070 - ia0:rustfmt, r=petrochenkovbors-235/+273
Run rustfmt on some libsyntax files As part of #62008, run rustfmt on: - src/libsyntax/ext/tt/macro_rules.rs - src/libsyntax/ext/tt/quoted.rs There is no semantic change. To fix potential merge conflicts, simply choose the other side then run rustfmt and fix any tidy check (like line length).
2019-06-23Auto merge of #60861 - Centril:let-chains-ast-intro, r=petrochenkovbors-153/+138
[let_chains, 2/6] Introduce `Let(..)` in AST, remove IfLet + WhileLet and parse let chains Here we remove `ast::ExprKind::{IfLet, WhileLet}` and introduce `ast::ExprKind::Let`. Moreover, we also: + connect the parsing logic for let chains + introduce the feature gate + rewire HIR lowering a bit. However, this does not connect the new syntax to semantics in HIR. That will be the subject of a subsequent PR. Per https://github.com/rust-lang/rust/issues/53667#issuecomment-471583239. Next step after https://github.com/rust-lang/rust/pull/59288. cc @Manishearth re. Clippy. r? @oli-obk
2019-06-23Run rustfmtJulien Cretin-235/+273
2019-06-23Remove redundant syntax::ast::Guard.Mazdak Farrokhzad-31/+10
2019-06-23Rollup merge of #62068 - ia0:fix_meta_var, r=petrochenkovMazdak Farrokhzad-6/+6
Fix meta-variable binding errors in macros 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. Found by https://github.com/rust-lang/rust/pull/62008
2019-06-23Rollup merge of #62051 - Centril:unused-derive-, r=petrochenkovMazdak Farrokhzad-4/+0
Lint empty `#[derive()]` as unused attribute. Closes https://github.com/rust-lang/rust/issues/54651. cc https://github.com/rust-lang/rust/issues/55112 r? @petrochenkov
2019-06-23let_chains: note re. back-compat wrt. expr beginning.Mazdak Farrokhzad-1/+3
2019-06-23Fix meta-variable binding errors in macrosJulien Cretin-6/+6
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-23let_chains: More accurately describe `ast::ExprKind::Let`.Mazdak Farrokhzad-1/+1
Co-Authored-By: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
2019-06-23let_chains: Fix bugs in pretty printing.Mazdak Farrokhzad-14/+46
2019-06-23let_chains: Refactor parse_{if,while}_expr a bit.Mazdak Farrokhzad-9/+12
2019-06-23let_chains: Move feature gating to pre-expansion.Mazdak Farrokhzad-28/+28
2019-06-23let_chains: Inline visit_expr_with_let_maybe_allowed.Mazdak Farrokhzad-0/+1
2019-06-23let_chains: readd kw::let to ident_can_begin_expr.Mazdak Farrokhzad-3/+2
2019-06-23let_chains: scrutinee -> conditionMazdak Farrokhzad-1/+1
2019-06-23let_chains: Fix outdated doc-comment re. 'parse_if_expr'.Mazdak Farrokhzad-1/+1
2019-06-23let_chains: Improve documentation for ast::ExprKind::Let(..).Mazdak Farrokhzad-1/+4
2019-06-23let_chains: Comment out Let in ident_can_begin_expr.Mazdak Farrokhzad-1/+2
2019-06-23let_chains: Add feature gate.Mazdak Farrokhzad-1/+30
2019-06-23let_chains: Add support for parsing let expressions.Mazdak Farrokhzad-53/+22
2019-06-23let_chains: Handle it in AST pretty printing.Mazdak Farrokhzad-40/+14
2019-06-23let_chains: Remove ast::ExprKind::{IfLet, WhileLet} from visitors and ↵Mazdak Farrokhzad-26/+8
introduce ::Let.
2019-06-23let_chains: Remove ast::ExprKind::{IfLet, WhileLet} and introduce ::Let.Mazdak Farrokhzad-15/+5
2019-06-22Lint empty 'derive()' as unused attribute.Mazdak Farrokhzad-4/+0
2019-06-22Lint on 'cfg_attr(,).'Mazdak Farrokhzad-10/+11