rust/compiler/rustc_mir_dataflow
Tomasz Miąsko 23e3840014 Remove dead unwinds before drop elaboration
As a part of drop elaboration, we identify dead unwinds, i.e., unwind
edges on a drop terminators which are known to be unreachable, because
there is no need to drop anything.

Previously, the data flow framework was informed about the dead unwinds,
and it assumed those edges are absent from MIR. Unfortunately, the data
flow framework wasn't consistent in maintaining this assumption.

In particular, if a block was reachable only through a dead unwind edge,
its state was propagated to other blocks still. This became an issue in
the context of change removes DropAndReplace terminator, since it
introduces initialization into cleanup blocks.

To avoid this issue, remove unreachable unwind edges before the drop
elaboration, and elaborate only blocks that remain reachable.
2023-02-23 14:05:03 +01:00
..
locales errors: generate typed identifiers in each crate 2023-02-22 09:15:53 +00:00
src Remove dead unwinds before drop elaboration 2023-02-23 14:05:03 +01:00
Cargo.toml remove unused imports 2023-02-06 17:40:18 +03:00