summary refs log tree commit diff
path: root/src/librustc_mir/transform
AgeCommit message (Collapse)AuthorLines
2019-04-07Update commentOliver Scherer-1/+1
2019-04-07Add more regression tests for accidental promotionOliver Scherer-2/+2
2019-04-07Function arguments should never get promotedOliver Scherer-1/+1
2019-03-16Schedule the demolition of `IsNotPromotable`Oliver Scherer-0/+2
2019-03-16Don't promote function calls to nonpromotable thingsOliver Scherer-5/+2
2019-02-25Auto merge of #57609 - matthewjasper:more-restrictive-match, r=pnkfelixbors-85/+20
Use normal mutable borrows in matches `ref mut` borrows are currently two-phase with NLL enabled. This changes them to be proper mutable borrows. To accommodate this, first the position of fake borrows is changed: ```text [ 1. Pre-match ] | [ (old create fake borrows) ] [ 2. Discriminant testing -- check discriminants ] <-+ | | | (once a specific arm is chosen) | | | [ (old read fake borrows) ] | [ 3. Create "guard bindings" for arm ] | [ (create fake borrows) ] | | | [ 4. Execute guard code ] | [ (read fake borrows) ] --(guard is false)-----------+ | | (guard results in true) | [ 5. Create real bindings and execute arm ] | [ Exit match ] ``` The following additional changes are made to accommodate `ref mut` bindings: * We no longer create fake `Shared` borrows. These borrows are no longer needed for soundness, just to avoid some arguably strange cases. * `Shallow` borrows no longer conflict with existing borrows, avoiding conflicting access between the guard borrow access and the `ref mut` borrow. There is some further clean up done in this PR: * Avoid the "later used here" note for Shallow borrows (since it's not relevant with the message provided) * Make any use of a two-phase borrow activate it. * Simplify the cleanup_post_borrowck passes into a single pass. cc #56254 r? @nikomatsakis
2019-02-24Rollup merge of #58511 - oli-obk:const_to_op, r=RalfJungMazdak Farrokhzad-1/+1
Const to op simplification r? @RalfJung alternative to https://github.com/rust-lang/rust/pull/58486
2019-02-21Simplify the cleanup_post_borrowck passesMatthew Jasper-85/+20
2019-02-20hir: HirId-ify intravisitljedrz-1/+1
2019-02-17Rollup merge of #58509 - phansch:add_myself_to_clippy_toolstate_maintainers, ↵kennytm-14/+26
r=oli-obk Notify myself when Clippy toolstate changes
2019-02-16Add `eval` prefix to clarify what the function doesOliver Scherer-1/+1
2019-02-16Expose const -> op functions that don't allow violiting const eval invariantsOliver Scherer-1/+1
2019-02-16Rollup merge of #58196 - varkor:const-fn-feature-gate-error, r=oli-obkkennytm-1/+11
Add specific feature gate error for const-unstable features Before: ``` error: `impl Trait` in const fn is unstable --> src/lib.rs:7:19 | 7 | const fn foo() -> impl T { | ^^^^^^ error: aborting due to previous error ``` After: ``` error[E0723]: `impl Trait` in const fn is unstable (see issue #57563) --> src/lib.rs:7:19 | 7 | const fn foo() -> impl T { | ^^^^^^ = help: add #![feature(const_fn)] to the crate attributes to enable error: aborting due to previous error ``` This improves the situation with https://github.com/rust-lang/rust/issues/57563. Fixes https://github.com/rust-lang/rust/issues/57544. Fixes https://github.com/rust-lang/rust/issues/54469. r? @oli-obk
2019-02-15Auto merge of #57880 - Zoxc:error-on-cycle, r=michaelwoeristerbors-14/+26
Always emit an error for a query cycle r? @michaelwoerister cc @nikomatsakis @wesleywiser
2019-02-15Always emit an error for a query cycleJohn Kåre Alsaker-14/+26
2019-02-14Add specific error for unstable const fn featuresvarkor-1/+11
2019-02-14rustc_mir: compute all the qualification bits separately in qualify_consts.Eduard-Mihai Burtescu-363/+504
2019-02-14rustc_mir: rename qualify_consts::Qualifier to ConstCx and keep in Checker ↵Eduard-Mihai Burtescu-34/+35
as a field.
2019-02-14rustc_mir: do not treat NEEDS_DROP as unexpected in qualify_consts.Eduard-Mihai Burtescu-8/+3
2019-02-14rustc_mir: avoid having an Option around each local qualification in ↵Eduard-Mihai Burtescu-59/+48
qualify_consts.
2019-02-14rustc_mir: rename `Qualif::for_ty to `Qualif::any_value_of_ty`.Eduard-Mihai Burtescu-14/+19
2019-02-14rustc_mir: remove qualify_consts::Qualif::FN_ARGUMENT.Eduard-Mihai Burtescu-12/+4
2019-02-14rustc_mir: remove outdated `const fn` stability diagnostic.Eduard-Mihai Burtescu-22/+4
2019-02-14rustc_mir: split qualify_consts' checking and value qualification.Eduard-Mihai Burtescu-451/+608
2019-02-14rustc_mir: split off some qualify_consts::Checker fields into a State struct.Eduard-Mihai Burtescu-61/+73
2019-02-14rustc_mir: rename qualify_consts::Qualifier to Checker.Eduard-Mihai Burtescu-18/+18
2019-02-14Rollup merge of #58301 - RalfJung:fat-ptr-eq, r=oli-obkMazdak Farrokhzad-18/+16
Enable comparing fat pointers Also refactor our binops a bit to make that happen more easily. r? @oli-obk
2019-02-13make bin_op and unary_op APIs consistently work on ImmTyRalf Jung-5/+4
2019-02-13make OpTy.op private, and ImmTy.imm public insteadRalf Jung-13/+12
2019-02-13HirId-ify hir::BodyIdljedrz-2/+2
2019-02-12Auto merge of #58341 - alexreg:cosmetic-2-doc-comments, r=steveklabnikbors-12/+12
Cosmetic improvements to doc comments This has been factored out from https://github.com/rust-lang/rust/pull/58036 to only include changes to documentation comments (throughout the rustc codebase). r? @steveklabnik Once you're happy with this, maybe we could get it through with r=1, so it doesn't constantly get invalidated? (I'm not sure this will be an issue, but just in case...) Anyway, thanks for your advice so far!
2019-02-12Auto merge of #58098 - oli-obk:maybe_allow_internal_unstable, r=petrochenkovbors-1/+1
Require a list of features in `#[allow_internal_unstable]` The blanket-permission slip is not great and will likely give us trouble some point down the road.
2019-02-12Auto merge of #58246 - pmccarter:master, r=oli-obkbors-0/+4
Make `saturating_add` and `saturating_sub` `const` functions Fixes #58030
2019-02-11Require a list of features to allow in `allow_internal_unstable`Oliver Scherer-1/+1
2019-02-10rustc: doc commentsAlexander Regueiro-12/+12
2019-02-10Auto merge of #58103 - RalfJung:mir-shim-dump, r=eddybbors-70/+75
Make -Zdump-mir dump shims Fixes https://github.com/rust-lang/rust/issues/53532 by (a) making the MIR shim generation use the MIR pass infrastructure, and (b) fixing said infrastructure to handle the fallout. Cc @eddyb @oli-obk
2019-02-09Auto merge of #58207 - nnethercote:intern_lazy_const, r=oli-obkbors-3/+3
Make `intern_lazy_const` actually intern its argument. Currently it just unconditionally allocates it in the arena. For a "Clean Check" build of the the `packed-simd` benchmark, this change reduces both the `max-rss` and `faults` counts by 59%; it slightly (~3%) increases the instruction counts but the `wall-time` is unchanged. For the same builds of a few other benchmarks, `max-rss` and `faults` drop by 1--5%, but instruction counts and `wall-time` changes are in the noise. Fixes #57432, fixes #57829.
2019-02-09fix rebase falloutRalf Jung-27/+27
2019-02-09pass full InstanceDef to run_passesRalf Jung-43/+48
2019-02-08Remove #[macro_use] extern crate bitflagsTaiki Endo-1/+1
2019-02-08librustc_mir => 2018Taiki Endo-83/+87
2019-02-06Allow const assignment for int saturating_sub() for #58030Patrick McCarter-0/+2
2019-02-06Auto merge of #56123 - oli-obk:import_miri_from_future, r=eddybbors-2/+27
Add a forever unstable opt-out of const qualification checks r? @eddyb cc @RalfJung @Centril basically a forever unstable way to screw with const things in horribly unsafe, unsound and incoherent ways. Note that this does *not* affect miri except by maybe violating assumptions that miri makes. But there's no change in how miri evaluates things.
2019-02-06Make `intern_lazy_const` actually intern its argument.Nicholas Nethercote-3/+3
Currently it just unconditionally allocates it in the arena. For a "Clean Check" build of the the `packed-simd` benchmark, this change reduces both the `max-rss` and `faults` counts by 59%; it slightly (~3%) increases the instruction counts but the `wall-time` is unchanged. For the same builds of a few other benchmarks, `max-rss` and `faults` drop by 1--5%, but instruction counts and `wall-time` changes are in the noise. Fixes #57432, fixes #57829.
2019-02-05Allow const assignment for int saturating_add() calls for #58030Patrick McCarter-0/+2
2019-02-02hir: add HirId to main Hir nodesljedrz-1/+1
2019-01-31Add a forever unstable opt-out of const qualification checksOliver Scherer-2/+27
2019-01-29Only store the result of mir_borrowck for closuresJohn Kåre Alsaker-2/+2
2019-01-27Update generator transform and generated function signatureWim Looman-0/+45
2019-01-22Span fixupOliver Scherer-1/+1