about summary refs log tree commit diff
path: root/src/librustc
AgeCommit message (Collapse)AuthorLines
2019-04-28Fix lint findings in librustcflip1995-41/+41
2019-04-28Implement internal lintsflip1995-10/+122
- USAGE_OF_QUALIFIED_TY - TY_PASS_BY_REFERENCE
2019-04-28Rollup merge of #60347 - JohnTitor:remove-flags, r=matthewjasperMazdak Farrokhzad-4/+0
Remove `-Z two-phase-borrows` and `-Z two-phase-beyond-autoref` fixes #60331
2019-04-28Rollup merge of #60270 - alexcrichton:metadata-multi-cgu, r=oli-obkMazdak Farrokhzad-3/+2
rustc: Flag metadata compatible with multiple CGUs It looks like the `OutputType::Metadata` kind in the compiler was misclassified in #38571 long ago by accident as incompatible with codegen units and a single output file. This means that if you emit both a linkable artifact and metadata it silently turns off multiple codegen units unintentionally! This commit corrects the situation to ensure that if `--emit metadata` is used it doesn't implicitly disable multiple codegen units. This will ensure we don't accidentally regress compiler performance when striving to implement pipelined compilation!
2019-04-28Remove two-phase-beyond-autorefYuki OKUSHI-2/+0
2019-04-28Remove two-phase-borrowsYuki OKUSHI-2/+0
2019-04-27Auto merge of #60288 - Zoxc:update-rayon, r=nikomatsakisbors-2/+2
Update rustc-rayon version r? @nikomatsakis
2019-04-27Rollup merge of #60292 - varkor:ty-tuple-substs, r=nikomatsakisMazdak Farrokhzad-35/+65
Replace the `&'tcx List<Ty<'tcx>>` in `TyKind::Tuple` with `SubstsRef<'tcx>` Part of the suggested refactoring for https://github.com/rust-lang/rust/issues/42340. As expected, this is a little messy, because there are many places that the components of tuples are expected to be types, rather than arbitrary kinds. However, it should open up the way for a refactoring of `TyS` itself. r? @nikomatsakis
2019-04-27Auto merge of #59540 - Zoxc:the-arena-2, r=michaelwoeristerbors-37/+72
Use arenas to avoid Lrc in queries #1 Based on https://github.com/rust-lang/rust/pull/59536.
2019-04-26Update handling of Tuplevarkor-32/+53
2019-04-26Replace `&'tcx List<Ty<'tcx>>` in `Tuple` with `SubstsRef<'tcx>`varkor-1/+1
2019-04-26Add expect_ty method to Kindvarkor-2/+11
2019-04-26Update rustc-rayon versionJohn Kåre Alsaker-2/+2
2019-04-26Auto merge of #60167 - varkor:tidy-filelength, r=matthewjasperbors-0/+12
Add a tidy check for files with over 3,000 lines Files with a large number of lines can cause issues in GitHub (e.g. https://github.com/rust-lang/rust/issues/60015) and also tend to be indicative of opportunities to refactor into less monolithic structures. This adds a new check to tidy to warn against files that have more than 3,000 lines, as suggested in https://github.com/rust-lang/rust/issues/60015#issuecomment-483868594. (This number was chosen fairly arbitrarily as a reasonable indicator of size.) This check can be ignored with `// ignore-tidy-filelength`. Existing files with greater than 3,000 lines currently ignore the check, but this helps us spot when files are getting too large. (We might try to split up all files larger than this in the future, as in https://github.com/rust-lang/rust/issues/60015).
2019-04-26Rollup merge of #60247 - spastorino:place2_3, r=oli-obkMazdak Farrokhzad-52/+86
Implement Debug for Place using Place::iterate r? @oli-obk
2019-04-26Rollup merge of #60225 - Centril:hir-exprkind-use-in-for-loops, r=oli-obkMazdak Farrokhzad-46/+83
Introduce hir::ExprKind::Use and employ in for loop desugaring. In the `for $pat in $expr $block` desugaring we end with a `{ let _result = $match_expr; _result }` construct which makes `for` loops into a terminating scope and affects drop order. The construct was introduced in year 2015 by @pnkfelix in https://github.com/rust-lang/rust/pull/21984. This PR replaces the construct with `hir::ExprKind::Use(P<hir::Expr>)` which is equivalent semantically but should hopefully be less costly in terms of compile time performance (to be determined). This is extracted out of https://github.com/rust-lang/rust/pull/59288/commits/91b0abdfb23f980d2e5d5c30bc65ed8e95b04788 from https://github.com/rust-lang/rust/pull/59288 for easier review and so that the perf implications wrt. `for`-loops can be measured. r? @oli-obk
2019-04-26Rollup merge of #60183 - tmandry:chalk-builtin-copy-clone, r=scalexmMazdak Farrokhzad-10/+4
Chalkify: Add builtin Copy/Clone r? @nikomatsakis
2019-04-25ignore-tidy-filelength on all files with greater than 3000 linesvarkor-0/+12
2019-04-25Auto merge of #59111 - gilescope:generator-better-errors, r=nikomatsakisbors-28/+95
Improved error message when type must be bound due to generator. Fixes #58930. Keen to get some feedback - is this as minimal as we can get it or is there an existing visitor I could repurpose?
2019-04-25Update trait queriesJohn Kåre Alsaker-16/+55
2019-04-25Update trait_impls_ofJohn Kåre Alsaker-4/+4
2019-04-25Update mir_const_qualifJohn Kåre Alsaker-1/+2
2019-04-25Update rvalue_promotable_mapJohn Kåre Alsaker-6/+5
2019-04-25Update region_scope_treeJohn Kåre Alsaker-4/+4
2019-04-25rustc: Flag metadata compatible with multiple CGUsAlex Crichton-3/+2
It looks like the `OutputType::Metadata` kind in the compiler was misclassified in #38571 long ago by accident as incompatible with codegen units and a single output file. This means that if you emit both a linkable artifact and metadata it silently turns off multiple codegen units unintentionally! This commit corrects the situation to ensure that if `--emit metadata` is used it doesn't implicitly disable multiple codegen units. This will ensure we don't accidentally regress compiler performance when striving to implement pipelined compilation!
2019-04-25Improved error message when type must be bound due to generator.Giles Cope-28/+95
Error now mentions type var name and span is highlighted.
2019-04-25Implement Debug for Place using Place::iterateSantiago Pastorino-52/+86
2019-04-25Introduce hir::ExprKind::Use and employ in for loop desugaring.Mazdak Farrokhzad-46/+83
Here, ExprKind::Use(P<Expr>) tweaks the drop order to act the same way as '{ let _tmp = expr; _tmp }' does.
2019-04-25Auto merge of #59042 - ljedrz:HirIdification_rework_map, r=Zoxcbors-175/+160
HirIdification: rework Map The next iteration of HirIdification (#57578). - remove `NodeId` from `Entry` - change `Map::map` to an `FxHashMap<HirId, Entry>` - base the `NodeId` `Map` methods on `HirId` ones (reverses the current state) - HirIdify `librustdoc` a little bit (some `NodeId` `Map` methods were converted to work on `HirId`s) The second change might have performance implications, so I'd do a perf run to be sure it's fine; it simplifies the codebase and shouldn't have an impact as long as the `Map` searches are cached (which is now possible thanks to using `HirId`s). r? @Zoxc
2019-04-25Update inferred_outlives_ofJohn Kåre Alsaker-6/+2
2019-04-24hir: make NodeId methods depend on HirId onesljedrz-118/+102
2019-04-24hir: remove NodeId from Entry & simplify Mapljedrz-78/+79
2019-04-24Rollup merge of #59739 - cramertj:stabilize, r=withoutboatsMazdak Farrokhzad-0/+11
Stabilize futures_api cc https://github.com/rust-lang/rust/issues/59725. Based on https://github.com/rust-lang/rust/pull/59733 and https://github.com/rust-lang/rust/pull/59119 -- only the last two commits here are relevant. r? @withoutboats , @oli-obk for the introduction of `rustc_allow_const_fn_ptr`.
2019-04-24Rollup merge of #56278 - eddyb:mir-debuginfo-proof, r=nikomatsakisMazdak Farrokhzad-51/+15
Future-proof MIR for dedicated debuginfo. This is #56231 without the last commit (the one that actually moves to `VarDebuginfo`). Nothing should be broken, but it should no longer depend on debuginfo for anything else. r? @nikomatsakis
2019-04-23Add rustc_allow_const_fn_ptrTaylor Cramer-0/+11
2019-04-23rustc: dissuade compiler developers from misusing upvar debuginfo.Eduard-Mihai Burtescu-7/+11
2019-04-23rustc: don't track var_hir_id or mutability in mir::UpvarDecl.Eduard-Mihai Burtescu-10/+5
2019-04-23Rollup merge of #60177 - rasendubi:rustdoc-comments, r=varkorMazdak Farrokhzad-148/+145
Promote rust comments to rustdoc
2019-04-23Rollup merge of #59823 - davidtwco:issue-54716, r=cramertjMazdak Farrokhzad-79/+236
[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-23rustc_mir: don't rely on mir::UpvarDecl in the MIR borrowck.Eduard-Mihai Burtescu-35/+0
2019-04-23Auto merge of #60152 - stepnivlk:visit_subpats-removal, r=varkorbors-6/+5
Remove `visit_subpats` parameter from `check_pat` The core idea is to keep track of current ID directly in `EllipsisInclusiveRangePatterns` struct and early return in `check_pat` based on it. Fixes https://github.com/rust-lang/rust/issues/60043. r? @varkor
2019-04-23Auto merge of #60125 - estebank:continue-evaluating, r=oli-obkbors-8/+4
Don't stop evaluating due to errors before borrow checking r? @oli-obk Fix #60005. Follow up to #59903. Blocked on #53708, fixing the ICE in `src/test/ui/consts/match_ice.rs`.
2019-04-22Remove redundant code in copy_clone_conditionsTyler Mandry-10/+4
This was left over from when closure copy and clone were gated behind feature flags.
2019-04-23Remove visit_subpats from check_pat in favor of state in ↵Tomas Koutsky-6/+5
EllipsisInclusiveRangePatterns
2019-04-22Fix ICE related to #53708Esteban Küber-8/+4
2019-04-22Promote rust comments to rustdocAlexey Shmalko-148/+145
2019-04-22Remove double trailing newlinesvarkor-9/+0
2019-04-21Enable migrate mode by default on the 2015 editionMatthew Jasper-70/+11
This also fully stabilizes two-phase borrows on all editions
2019-04-21Correct lowering order to avoid ICE after rebase.David Wood-11/+17
This commit changes the order that arguments and bodies of async functions are lowered so that when the body attempts to `lower_def` of a upvar then the id has already been assigned by lowering the argument first.
2019-04-21Introduce `ArgSource` for diagnostics.David Wood-15/+53
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.