about summary refs log tree commit diff
path: root/src/librustc_passes
AgeCommit message (Collapse)AuthorLines
2019-06-23let_chains: Change AST validation strategy slightly.Mazdak Farrokhzad-34/+45
2019-06-23let_chains: Handle disallowing of let chains in places lowering won't support.Mazdak Farrokhzad-58/+67
2019-06-20rename hir::map::expect_expr_by_hir_id to expect_exprljedrz-1/+1
2019-06-19Rollup merge of #61941 - cramertj:no-more-yield-errors, r=centrilMazdak Farrokhzad-1/+1
Preserve generator and yield source for error messages Previously, error messages after HIR lowering all referred to generators and yield, regardless of whether the original source was a generator or an async/await body. This change tracks the kind of each generator and yield source in order to provide appropriately tailored error messages. Fixes #60615.
2019-06-18Preserve generator and yield source for error messagesTaylor Cramer-1/+1
Previously, error messages after HIR lowering all referred to generators and yield, regardless of whether the original source was a generator or an async/await body. This change tracks the kind of each generator and yield source in order to provide appropriately tailored error messages.
2019-06-18rustc: remove 'x: 'y bounds (except from comments/strings).Eduard-Mihai Burtescu-2/+2
2019-06-17remove _by_hir_id if there is no NodeId counterpartljedrz-1/+1
2019-06-17replace some uses of NodeId with HirIdljedrz-2/+2
2019-06-14Unify all uses of 'gcx and 'tcx.Eduard-Mihai Burtescu-11/+11
2019-06-12Run `rustfmt --file-lines ...` for changes from previous commits.Eduard-Mihai Burtescu-8/+2
2019-06-12rustc: remove some unnecessary lifetimes in -> TyCtxt methods.Eduard-Mihai Burtescu-1/+1
2019-06-12rustc: replace `TyCtxt<'tcx, 'gcx, 'tcx>` with `TyCtxt<'gcx, 'tcx>`.Eduard-Mihai Burtescu-8/+8
2019-06-12Fix fallout from `deny(unused_lifetimes)`.Eduard-Mihai Burtescu-3/+3
2019-06-12rustc: replace `TyCtxt<'a, 'gcx, 'tcx>` with `TyCtxt<'tcx, 'gcx, 'tcx>`.Eduard-Mihai Burtescu-16/+17
2019-06-12Auto merge of #60669 - c410-f3r:attrs-fn, r=petrochenkovbors-2/+43
Allow attributes in formal function parameters Implements https://github.com/rust-lang/rust/issues/60406. This is my first contribution to the compiler and since this is a large and complex project, I am not fully aware of the consequences of the changes I have made. **TODO** - [x] Forbid some built-in attributes. - [x] Expand cfg/cfg_attr
2019-06-11Add deny(unused_lifetimes) to all the crates that have deny(internal).Eduard-Mihai Burtescu-0/+1
2019-06-09Allow attributes in formal function parametersCaio-2/+43
2019-06-05Use both existential-type desugaring and where-clause (predicate) desugaring ↵Alexander Regueiro-7/+39
depending on context.
2019-06-05Implemented for function bounds, type bounds, and named existential types.Alexander Regueiro-11/+13
2019-06-05Aggregation of drive-by cosmetic changes.Alexander Regueiro-16/+19
2019-06-03syntax: revert `ast::AsyncArgument` and associated changes.Eduard-Mihai Burtescu-3/+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-06-01rustc: track the body owner DefId in MC and EUV.Eduard-Mihai Burtescu-2/+9
2019-05-26Rename "Associated*" to "Assoc*"Andrew Xu-1/+1
We are going to uniform the terminology of all associated items. Methods that may or may not have `self` are called "associated functions". Because `AssociatedFn` is a bit long, we rename `Associated` to `Assoc`.
2019-05-24Remove `ObsoleteInPlace`varkor-23/+0
2019-05-23Auto merge of #60174 - matthewjasper:add-match-arm-scopes, r=pnkfelixbors-1/+1
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-22Simplify use of keyword symbolsVadim Petrochenkov-4/+4
2019-05-21Give match arms an HirId and a SpanMatthew Jasper-1/+1
2019-05-13Auto merge of #60630 - nnethercote:use-Symbol-more, r=petrochenkovbors-11/+13
Use `Symbol` more A `Symbol` can be equated with a string (e.g. `&str`). This involves a TLS lookup to get the chars (and a Mutex lock in a parallel compiler) and then a char-by-char comparison. This functionality is convenient but avoids one of the main benefits of `Symbol`s, which is fast equality comparisons. This PR removes the `Symbol`/string equality operations, forcing a lot of existing string occurrences to become `Symbol`s. Fortunately, these are almost all static strings (many are attribute names) and we can add static `Symbol`s as necessary, and very little extra interning occurs. The benefits are (a) a slight speedup (possibly greater in a parallel compiler), and (b) the code is a lot more principled about `Symbol` use. The main downside is verbosity, particularly with more `use syntax::symbol::symbols` items. r? @Zoxc
2019-05-13Return a `Symbol` from `name_or_empty` functions.Nicholas Nethercote-5/+5
2019-05-13Pass a `Symbol` to `check_name`, `emit_feature_err`, and related functions.Nicholas Nethercote-6/+8
2019-05-12ast_validation: comments -> doc commentsMazdak Farrokhzad-11/+11
2019-05-10Remove hir::ExprKind::If and replace it with lowering to hir::ExprKind::Match.Mazdak Farrokhzad-9/+0
2019-05-05Auto merge of #60567 - Manishearth:rollup-rjagqnw, r=Manishearthbors-1/+2
Rollup of 5 pull requests Successful merges: - #60131 (Fix broken link in rustc_plugin doc) - #60426 (Stop `-O`/`-C opt-level` and `-g`/`-C debuginfo` conflicting) - #60515 (use span instead of div for since version) - #60530 (rustc: rename all occurences of "freevar" to "upvar".) - #60536 (Correct code points to match their textual description) Failed merges: r? @ghost
2019-05-05Auto merge of #60237 - saleemjaffer:issue-56166-miri-fntype-arg-passing, r=eddybbors-0/+7
Move pointee_info_at from rustc_codegen_llvm to rustc_target. Makes progress towards #56166. This is a continuation of https://github.com/rust-lang/rust/pull/57150. @oli-obk Should I close the older PR?
2019-05-05rustc: rename all occurences of "freevar" to "upvar".Eduard-Mihai Burtescu-1/+1
2019-05-05rustc: replace uses of with_freevars with the freevars query.Eduard-Mihai Burtescu-1/+2
2019-05-04Early error for mixing order of const and type parametersvarkor-3/+17
2019-05-04adding HasParamEnv traitSaleem Jaffer-0/+7
2019-05-03rustc: rename hir::def::Def to Res (short for "resolution").Eduard-Mihai Burtescu-16/+16
2019-05-03rustc: factor most DefId-containing variants out of Def and into DefKind.Eduard-Mihai Burtescu-8/+11
2019-05-03Rollup merge of #60409 - JohnTitor:error-for-existential-type, r=oli-obkMazdak Farrokhzad-1/+9
Require a trait in the bounds of existential types Fixes #53090 r? @oli-obk
2019-04-30Rename hir::ExprKind::Use to ::DropTemps and improve docs.Mazdak Farrokhzad-1/+1
2019-04-30Use multispanYuki OKUSHI-2/+4
2019-04-30Add error for existential typesYuki OKUSHI-0/+6
2019-04-27Auto merge of #59540 - Zoxc:the-arena-2, r=michaelwoeristerbors-3/+2
Use arenas to avoid Lrc in queries #1 Based on https://github.com/rust-lang/rust/pull/59536.
2019-04-25Update rvalue_promotable_mapJohn Kåre Alsaker-3/+2
2019-04-25Introduce hir::ExprKind::Use and employ in for loop desugaring.Mazdak Farrokhzad-6/+3
Here, ExprKind::Use(P<Expr>) tweaks the drop order to act the same way as '{ let _tmp = expr; _tmp }' does.
2019-04-23Rollup merge of #59823 - davidtwco:issue-54716, r=cramertjMazdak Farrokhzad-3/+3
[wg-async-await] Drop `async fn` arguments in async block Fixes #54716. This PR modifies the HIR lowering (and some other places to make this work) so that unused arguments to a async function are always dropped inside the async move block and not at the end of the function body. ``` async fn foo(<pattern>: <type>) { async move { } } // <-- dropped as you "exit" the fn // ...becomes... fn foo(__arg0: <ty>) { async move { let <pattern>: <ty> = __arg0; } // <-- dropped as you "exit" the async block } ``` However, the exact ordering of drops is not the same as a regular function, [as visible in this playground example](https://play.rust-lang.org/?version=stable&mode=debug&edition=2015&gist=be39af1a58e5d430be1eb3c722cb1ec3) - I believe this to be an unrelated issue. There is a [Zulip topic](https://rust-lang.zulipchat.com/#narrow/stream/187312-t-compiler.2Fwg-async-await/topic/.2354716.20drop.20order) for this. r? @cramertj cc @nikomatsakis
2019-04-21Add `AsyncArgument` to AST.David Wood-3/+3
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.
2019-04-21Remove mutability from `Def::Static`Vadim Petrochenkov-1/+1