about summary refs log tree commit diff
path: root/compiler/rustc_mir_dataflow/src/drop_flag_effects.rs
AgeCommit message (Collapse)AuthorLines
2025-07-28use let chains in hir, lint, mirKivooeo-3/+2
2025-07-08Apply effects to otherwise edge in dataflow analysisAmogh Shivaram-7/+21
2025-02-14Move drop elaboration infrastructure.Nicholas Nethercote-1/+20
`rustc_mir_dataflow/src/elaborate_drops.rs` contains some infrastructure used by a few MIR passes: the `elaborate_drop` function, the `DropElaborator` trait, etc. `rustc_mir_transform/src/elaborate_drops.rs` (same file name, different crate) contains the `ElaborateDrops` pass. It relies on a lot of the infrastructure from `rustc_mir_dataflow/src/elaborate_drops.rs`. It turns out that the drop infrastructure is only used in `rustc_mir_transform`, so this commit moves it there. (The only exception is the small `DropFlagState` type, which is moved to the existing `rustc_mir_dataflow/src/drop_flag_effects.rs`.) The file is renamed from `rustc_mir_dataflow/src/elaborate_drops.rs` to `rustc_mir_transform/src/elaborate_drop.rs` (with no trailing `s`) because (a) the `elaborate_drop` function is the most important export, and (b) `rustc_mir_transform/src/elaborate_drops.rs` already exists. All the infrastructure pieces that used to be `pub` are now `pub(crate)`, because they are now only used within `rustc_mir_transform`.
2024-10-27compiler: Add rustc_abi dependence to the compilerJubilee Young-1/+1
Depend on rustc_abi in compiler crates that use it indirectly but have not yet taken on that dependency, and are not entangled in my other PRs. This leaves an "excise rustc_target" step after the dust settles.
2024-07-29Stop using MoveDataParamEnv for places that don't need a param-envMichael Goulet-5/+2
2024-07-29Reformat `use` declarations.Nicholas Nethercote-1/+1
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-05-23Remove `#[macro_use] extern crate tracing` from `rustc_mir_dataflow`.Nicholas Nethercote-0/+1
2023-11-24Remove unused arguments from `on_all_children_bits`.Nicholas Nethercote-31/+11
`on_all_children_bits` has two arguments that are unused: `tcx` and `body`. This was not detected by the compiler because it's a recursive function. This commit removes them, and removes lots of other arguments and fields that are no longer necessary.
2023-11-23Avoid unnecessary exports.Nicholas Nethercote-1/+1
2023-11-23Remove `indexes` module.Nicholas Nethercote-2/+1
It's not useful, and only obfuscates things.
2023-10-21Remove on_all_drop_children_bits.Camille GILLOT-23/+0
As drop elaboration only tracks places that need dropping, is has become equivalent to `on_all_children_bits`.
2023-10-21Remove is_terminal_path.Camille GILLOT-59/+1
That information is redundant. Is the path is terminal, `first_child` will already be `None`.
2023-01-30Treat Drop as a rmw operationGiacomo Pasini-1/+12
Previously, a Drop terminator was considered a move in MIR. This commit changes the behavior to only treat Drop as a mutable access to the dropped place. In order for this change to be correct, we need to guarantee that a) A dropped value won't be used again b) Places that appear in a drop won't be used again before a subsequent initialization. We can ensure this to be correct at MIR construction because Drop will only be emitted when a variable goes out of scope, thus having: (a) as there is no way of reaching the old value. drop-elaboration will also remove any uninitialized drop. (b) as the place can't be named following the end of the scope. However, the initialization status, previously tracked by moves, should also be tied to the execution of a Drop, hence the additional logic in the dataflow analyses.
2022-12-08Inline and remove `place_contents_drop_state_cannot_differ`.Nicholas Nethercote-51/+46
It has a single call site and is hot enough to be worth inlining. And make sure `is_terminal_path` is inlined, too.
2022-02-19Adopt let else in more placesest31-6/+4
2021-09-07Move the dataflow framework to its own crate.Camille GILLOT-0/+270