Skip to content

Some place analysis tweaks - #159637

Merged
rust-bors[bot] merged 4 commits into
rust-lang:mainfrom
nnethercote:Place-Analysis-tweaks
Jul 27, 2026
Merged

Some place analysis tweaks#159637
rust-bors[bot] merged 4 commits into
rust-lang:mainfrom
nnethercote:Place-Analysis-tweaks

Conversation

@nnethercote

Copy link
Copy Markdown
Contributor

Details in individual commits.

r? @cjgillot

Use the one that's passed in.
- By improving various comments.
- By renaming some fields. This gives a clear split between
  `move_outs`/`move_out_loc_map`/`move_out_path_map` and
  `inits`/`init_loc_map`/`init_path_map`.
By using an iterator instead of a manual loop.
It always has the same value as `mark_inactive_variants_as_uninit`, and
it's only read if `mark_inactive_variants_as_uninit` is true.
@rustbot

rustbot commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 21, 2026
InactiveVariants::Inactives(data.variants.clone())
}
_ => return,
SwitchTargetIndex::Otherwise => InactiveVariants::Inactives(data.variants.clone()),

@cjgillot cjgillot Jul 26, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the guard removed? And not just changed to be if self.mark_inactive_variants_as_uninit?

View changes since the review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair question, because the reason is non-obvious: apply_switch_int_edge_effect is only called if get_switch_int_data returns Some. (This happens within Forward::apply_effects_in_block.) And get_switch_int_data returns None if the condition is false. So the _ => return, is unreachable in practice.

@cjgillot

Copy link
Copy Markdown
Contributor

@bors r+

@rust-bors

rust-bors Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 3fb482f has been approved by cjgillot

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 26, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jul 27, 2026
… r=cjgillot

Some place analysis tweaks

Details in individual commits.

r? @cjgillot
rust-bors Bot pushed a commit that referenced this pull request Jul 27, 2026
…uwer

Rollup of 8 pull requests

Successful merges:

 - #159085 (Fix decoding attributes of `SyntheticCoroutineBody`)
 - #159554 (feat: Update method signature of int_from_ascii)
 - #159637 (Some place analysis tweaks)
 - #159961 (sanitize_standard_fds: Miri supports poll now)
 - #159967 (rustc_target: callconv: mips64: Return structs with single f128 in FPRs)
 - #159253 (Add suggestions for using `#[export_name]` instead of `#[link_name]` on static)
 - #159840 (Fix opaque type ICE in late lints under the next-generation trait solver)
 - #159956 (Fix observable intermediate state in `thread::add_spawn_hook`)
rust-bors Bot pushed a commit that referenced this pull request Jul 27, 2026
…uwer

Rollup of 8 pull requests

Successful merges:

 - #159085 (Fix decoding attributes of `SyntheticCoroutineBody`)
 - #159554 (feat: Update method signature of int_from_ascii)
 - #159637 (Some place analysis tweaks)
 - #159961 (sanitize_standard_fds: Miri supports poll now)
 - #159967 (rustc_target: callconv: mips64: Return structs with single f128 in FPRs)
 - #159253 (Add suggestions for using `#[export_name]` instead of `#[link_name]` on static)
 - #159840 (Fix opaque type ICE in late lints under the next-generation trait solver)
 - #159956 (Fix observable intermediate state in `thread::add_spawn_hook`)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jul 27, 2026
… r=cjgillot

Some place analysis tweaks

Details in individual commits.

r? @cjgillot
rust-bors Bot pushed a commit that referenced this pull request Jul 27, 2026
…uwer

Rollup of 14 pull requests

Successful merges:

 - #158417 (Avoid ICE when cfg_eval recovers no item from derive input)
 - #159085 (Fix decoding attributes of `SyntheticCoroutineBody`)
 - #159554 (feat: Update method signature of int_from_ascii)
 - #159637 (Some place analysis tweaks)
 - #159649 (Normalize region obligations before regionck)
 - #159961 (sanitize_standard_fds: Miri supports poll now)
 - #159967 (rustc_target: callconv: mips64: Return structs with single f128 in FPRs)
 - #159253 (Add suggestions for using `#[export_name]` instead of `#[link_name]` on static)
 - #159804 (Expand docs for fs::metadata and fs::symlink_metadata)
 - #159821 (Update expect message using the recommended style in binary_heap module)
 - #159840 (Fix opaque type ICE in late lints under the next-generation trait solver)
 - #159956 (Fix observable intermediate state in `thread::add_spawn_hook`)
 - #159991 (std: make send_process_group_signal unsupported on VxWorks)
 - #159996 (Detect when a macro without exclamation mark uses square brackets)
@rust-bors
rust-bors Bot merged commit d30eb65 into rust-lang:main Jul 27, 2026
13 checks passed
@rustbot rustbot added this to the 1.99.0 milestone Jul 27, 2026
rust-timer added a commit that referenced this pull request Jul 27, 2026
Rollup merge of #159637 - nnethercote:Place-Analysis-tweaks, r=cjgillot

Some place analysis tweaks

Details in individual commits.

r? @cjgillot
@nnethercote
nnethercote deleted the Place-Analysis-tweaks branch July 27, 2026 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants