summary refs log tree commit diff
path: root/compiler/rustc_mir_dataflow/src
AgeCommit message (Collapse)AuthorLines
2021-11-23Auto merge of #90788 - ecstatic-morse:issue-90752, r=wesleywiserbors-6/+67
Mark places as initialized when mutably borrowed Fixes the example in #90752, but does not handle some corner cases involving raw pointers and unsafe. See [this comment](https://github.com/rust-lang/rust/issues/90752#issuecomment-965822895) for more information, or the second test. Although I talked about both `MaybeUninitializedPlaces` and `MaybeInitializedPlaces` in #90752, this PR only changes the latter. That's because "maybe uninitialized" is the conservative choice, and marking them as definitely initialized (`!maybe_uninitialized`) when a mutable borrow is created could lead to problems if `addr_of_mut` to an uninitialized local is allowed. Additionally, places cannot become uninitialized via a mutable reference, so if a place is definitely initialized, taking a mutable reference to it should not change that. I think it's correct to ignore interior mutability as nbdd0121 suggests below. Their analysis doesn't work inside of `core::cell`, which *does* have access to `UnsafeCell`'s field, but that won't be an issue unless we explicitly instantiate one with an `enum` within that module. r? `@wesleywiser`
2021-11-13Mark mutably borrowed places as maybe initializedDylan MacKenzie-6/+67
2021-11-11Use `associated_item_def_ids` moreMatthew Jasper-7/+2
2021-11-03Remove `MaybeMutBorrowedLocals`Tomasz Miąsko-148/+17
2021-10-23Ignore errors re: unreachable blocks in dataflow cursor unit testsDylan MacKenzie-0/+9
2021-10-23update cfg(bootstrap)Pietro Albini-1/+0
2021-10-16Adopt let_else across the compilerest31-6/+3
This performs a substitution of code following the pattern: let <id> = if let <pat> = ... { identity } else { ... : ! }; To simplify it to: let <pat> = ... { identity } else { ... : ! }; By adopting the let_else feature.
2021-10-07comma-related changesEliza Weisman-1/+1
Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2021-10-07make them structured while i'm hereEliza Weisman-2/+2
Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2021-10-07demote `rustc_peek` traces look not user-facingEliza Weisman-2/+2
Signed-off-by: Eliza Weisman <eliza@buoyant.io>
2021-10-05Rollup merge of #89532 - ecstatic-morse:maybe-live-locals-enum, ↵Manish Goregaokar-0/+31
r=oli-obk,tmiasko Document behavior of `MaybeLiveLocals` regarding enums and field-senstivity This arose from a [discussion on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/MaybeLiveLocals.20and.20Discriminants) where a new contributor attempted to implement a dead-store elimination pass using this analysis. They ran into a nasty hack around `SetDiscriminant` the effect of which is to lets handle assignments of literals to enum-typed locals (e.g. `x = Some(4)`) correctly. This took me a while to figure out. Document this oddity, so the next person will have an easier time, and add a test to enshrine the current behavior. r? ``@tmiasko``
2021-10-04Discuss field-sensitivity and enums in context of `MaybeLiveLocals`Dylan MacKenzie-0/+31
2021-10-04Rollup merge of #89508 - jhpratt:stabilize-const_panic, r=joshtriplettJubilee-1/+1
Stabilize `const_panic` Closes #51999 FCP completed in #89006 ```@rustbot``` label +A-const-eval +A-const-fn +T-lang cc ```@oli-obk``` for review (not `r?`'ing as not on lang team)
2021-10-04Stabilize `const_panic`Jacob Pratt-1/+1
2021-10-03Replace Fn impls with RPIT impls in rustc_indexbjorn3-3/+4
This is cleaner and removes an unstable feature usage
2021-09-28More tracing instrumentationOli Scherer-12/+6
2021-09-25Introduce `Rvalue::ShallowInitBox`Gary Guo-0/+2
2021-09-15Make rustc_mir_dataflow::framework::graphviz and ↵Will Crichton-2/+2
rustc_mir_transform::MirPass public
2021-09-13Introduce NullOp::AlignOfGary Guo-1/+1
2021-09-08Rebase fallout.Camille GILLOT-0/+1
2021-09-07Rename rustc_mir to rustc_const_eval.Camille GILLOT-1/+1
2021-09-07Move the dataflow framework to its own crate.Camille GILLOT-0/+7657