about summary refs log tree commit diff
path: root/src/libsyntax/mut_visit.rs
AgeCommit message (Collapse)AuthorLines
2019-08-27Cleanup: Consistently use `Param` instead of `Arg` #62426Kevin Per-6/+6
2019-08-24Modifies how Arg, Arm, Field, FieldPattern and Variant are visitedCaio-49/+77
Part of the necessary work to accomplish #63468.
2019-08-18Auto merge of #61708 - dlrobertson:or-patterns-0, r=centrilbors-2/+3
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-17Initial implementation of or patternsvarkor-2/+3
2019-08-17Remove SyntaxContext from {ast, hir}::{GlobalAsm, InlineAsm}Matthew Jasper-1/+1
We now store it in the `Span` of the expression or item.
2019-08-15Remove `Spanned` from `{ast,hir}::FieldPat`Vadim Petrochenkov-4/+1
2019-08-15Remove `Spanned` from `ast::Mac`Vadim Petrochenkov-2/+2
2019-08-14Rollup merge of #63543 - c410-f3r:variant, r=c410-f3rMazdak Farrokhzad-1/+1
Merge Variant and Variant_ Extracted from #63468.
2019-08-14Merge Variant and Variant_Caio-1/+1
2019-08-13Add NodeId for Arm, Field and FieldPatCaio-3/+9
2019-08-04Auto merge of #63213 - varkor:itemkind-tyalias, r=Centrilbors-2/+2
Rename `ItemKind::Ty` to `ItemKind::TyAlias` The current name is not entirely clear without context and `TyAlias` is consistent with `ItemKind::TraitAlias`.
2019-08-04Rename `ItemImplKind::Type` to `ItemImplKind::TyAlias`varkor-1/+1
2019-08-04Rename `ItemKind::Ty` to `ItemKind::TyAlias`varkor-1/+1
2019-08-04Auto merge of #62816 - estebank:type-ascription-macros, r=petrochenkovbors-1/+1
Point at type ascription before macro invocation on expansion parse error Fix https://github.com/rust-lang/rust/issues/47666. Follow up to https://github.com/rust-lang/rust/pull/62791. r? @petrochenkov
2019-08-03Auto merge of #63180 - varkor:trait-alias-impl-trait, r=Centrilbors-2/+2
Change opaque type syntax from `existential type` to type alias `impl Trait` This implements a new feature gate `type_alias_impl_trait` (this is slightly different from the originally proposed feature name, but matches what has been used in discussion since), deprecating the old `existential_types` feature. The syntax for opaque types has been changed. In addition, the "existential" terminology has been replaced with "opaque", as per previous discussion and the RFC. This makes partial progress towards implementing https://github.com/rust-lang/rust/issues/63063. r? @Centril
2019-08-02Replace "existential" by "opaque"varkor-2/+2
2019-08-02libsyntax: Unconfigure tests during normal buildVadim Petrochenkov-74/+3
2019-07-30Point at type ascription before macro invocation on expansion parse errorEsteban Küber-1/+1
2019-07-30Unsupport the await!(..) macro.Mazdak Farrokhzad-1/+1
2019-07-28Rollup merge of #61856 - c410-f3r:attrs-fn, r=matthewjasperMazdak Farrokhzad-1/+2
Lint attributes on function arguments Fixes #61238. cc #60406
2019-07-28Adjust 'ast::PatKind::{TupleStruct,Tuple,Slice}'.Mazdak Farrokhzad-8/+4
2019-07-28Add 'ast::PatKind::Rest'.Mazdak Farrokhzad-1/+1
2019-07-27Lint attributes on function argumentsCaio-1/+2
2019-07-15pprust: Fix formatting regressions from the previous commitsVadim Petrochenkov-1/+1
Fix some remaining cases of bad formatting Update some failing tests
2019-06-29Remove io::Result from syntax::printMark Rousskov-2/+1
Since we're now writing directly to the vector, there's no need to thread results through the whole printing infrastructure
2019-06-24Auto merge of #62075 - Centril:guardless-match-arms, r=petrochenkovbors-11/+1
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-23Remove redundant syntax::ast::Guard.Mazdak Farrokhzad-11/+1
2019-06-23let_chains: Remove ast::ExprKind::{IfLet, WhileLet} from visitors and ↵Mazdak Farrokhzad-12/+4
introduce ::Let.
2019-06-18Remove the HirId/NodeId from where clausesMatthew Jasper-2/+1
Also give them a span in the HIR
2019-06-09Allow attributes in formal function parametersCaio-1/+2
2019-06-07syntax: Treat error literals in more principled wayVadim Petrochenkov-2/+1
2019-06-06Address review commentsVadim Petrochenkov-0/+2
2019-06-06syntax: Use `Token` in visitors and fix a mut visitor testVadim Petrochenkov-8/+16
2019-06-06syntax: Remove duplicate span from `token::Ident`Vadim Petrochenkov-1/+0
2019-06-06syntax: Remove duplicate span from `token::Lifetime`Vadim Petrochenkov-1/+0
2019-06-06syntax: Use `Token` in `TokenTree::Token`Vadim Petrochenkov-3/+3
2019-06-06syntax: Rename `Token` into `TokenKind`Vadim Petrochenkov-3/+3
2019-06-05Implemented for function bounds, type bounds, and named existential types.Alexander Regueiro-7/+16
2019-06-03syntax: revert `ast::AsyncArgument` and associated changes.Eduard-Mihai Burtescu-39/+3
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-24Remove `ObsoleteInPlace`varkor-4/+0
2019-05-23Auto merge of #60174 - matthewjasper:add-match-arm-scopes, r=pnkfelixbors-1/+5
Add match arm scopes and other scope fixes * Add drop and lint scopes for match arms. * Lint attributes are now respected on match arms. * Make sure we emit a StorageDead if we diverge when initializing a temporary. * Adjust MIR pretty printing of scopes for locals. * Don't generate duplicate lint scopes for `let statements`. * Add some previously missing fake borrows for matches. closes #46525 cc @rust-lang/compiler
2019-05-22Eliminate unnecessary `Ident::with_empty_ctxt`sVadim Petrochenkov-2/+1
2019-05-22Simplify use of keyword symbolsVadim Petrochenkov-2/+2
2019-05-21Give match arms an HirId and a SpanMatthew Jasper-1/+5
2019-05-21Move `edition` outside the hygiene lock and avoid accessing itJohn Kåre Alsaker-3/+3
2019-05-12syntax: Remove some legacy nonterminal tokensVadim Petrochenkov-4/+0
2019-05-07Implement built-in await syntaxTaylor Cramer-0/+1
Adds support for .await under the existing async_await feature gate. Moves macro-like await! syntax to the await_macro feature gate. Removes support for `await` as a non-keyword under the `async_await` feature.
2019-05-01Ensure that drop order of `async fn` matches `fn`.David Wood-3/+11
This commit modifies the lowering of `async fn` arguments so that the drop order matches the equivalent `fn`. Previously, async function arguments were lowered as shown below: async fn foo(<pattern>: <ty>) { async move { } } // <-- dropped as you "exit" the fn // ...becomes... fn foo(__arg0: <ty>) { async move { let <pattern> = __arg0; } // <-- dropped as you "exit" the async block } After this PR, async function arguments will be lowered as: async fn foo(<pattern>: <ty>, <pattern>: <ty>, <pattern>: <ty>) { async move { } } // <-- dropped as you "exit" the fn // ...becomes... fn foo(__arg0: <ty>, __arg1: <ty>, __arg2: <ty>) { async move { let __arg2 = __arg2; let <pattern> = __arg2; let __arg1 = __arg1; let <pattern> = __arg1; let __arg0 = __arg0; let <pattern> = __arg0; } // <-- dropped as you "exit" the async block } If `<pattern>` is a simple ident, then it is lowered to a single `let <pattern> = <pattern>;` statement as an optimization.
2019-04-21Introduce `ArgSource` for diagnostics.David Wood-1/+13
This commit introduces an `ArgSource` enum that is lowered into the HIR so that diagnostics can correctly refer to the argument pattern's original name rather than the generated pattern.
2019-04-21Add `AsyncArgument` to AST.David Wood-1/+9
This commit adds an `AsyncArgument` struct to the AST that contains the generated argument and statement that will be used in HIR lowering, name resolution and def collection.