Commit Graph

15 Commits

Author SHA1 Message Date
Camille Gillot a1e42f96f6 Simplify new_local. 2025-10-19 02:22:18 +00:00
dianqk 571412f819 mir-opt: Eliminate dead ref statements 2025-10-02 14:55:50 +08:00
Camille Gillot 599e8db838 Use MirPatch in simplify_branches. 2025-09-28 19:52:28 +00:00
Camille Gillot ce677c7db8 Update compiler/rustc_mir_transform/src/patch.rs
Co-authored-by: lcnr <rust@lcnr.de>
2025-09-23 20:38:38 -03:00
Camille Gillot 3c232fe38f Make term_patch_map sparse. 2025-09-20 13:53:58 +00:00
Camille Gillot b216cf34b1 Avoid invalidating from MirPatch::apply. 2025-09-18 01:09:53 +00:00
dianqk 24e553e6bc mir: Use the new method for BasicBlockData 2025-06-29 20:39:13 +08:00
dianqk 9f9cd5e283 mir: Add a new method to statement
Avoid introducing a large number of changes when adding optional initialization fields.
2025-06-29 20:13:36 +08:00
Andrew Zhogin cce706ec3c Fix for async drop ice with partly dropped tuple 2025-04-29 21:41:15 +07:00
Andrew Zhogin c366756a85 AsyncDrop implementation using shim codegen of async_drop_in_place::{closure}, scoped async drop added. 2025-04-28 16:23:13 +07:00
Yotam Ofek 4b63362f3d Use newtype_index!-generated types more idiomatically 2025-04-14 16:17:06 +00:00
Nicholas Nethercote 5d2d11fd5d Rename ClearCrossCrate::assert_crate_local.
As `unwrap_crate_local`, because it follows exactly the standard form of
an `unwrap` function.
2025-02-21 07:12:13 +11:00
Nicholas Nethercote e3316ae453 Improve MirPatch documentation and naming.
It's currently lacking comments. This commit adds some, which is useful
because there are some methods with non-obvious behaviour.

The commit also renames two things:
- `patch_map` becomes `term_patch_map`, because it's only about
  terminators.
- `is_patched` becomes `is_term_patched`, for the same reason.

(I would guess that originally `MirPatch` only handled terminators, and
then over time it expanded to allow other modifications, but these names
weren't updated.)
2025-02-18 13:12:50 +11:00
Scott McMurray 7e35729bfc Don't project into NonNull when dropping a Box 2025-02-15 23:20:52 -08:00
Nicholas Nethercote 28b75a384e Move MirPatch from rustc_middle to rustc_mir_transform.
Because it's only used in `rustc_mir_transform`. (Presumably it is
currently in `rustc_middle` because lots of other MIR-related stuff is,
but that's not a hard requirement.) And because `rustc_middle` is huge
and it's always good to make it smaller.
2025-02-14 16:15:57 +11:00