Skip to content

Use StorageAlloc in DSE - #165075

Closed
dianqk wants to merge 2 commits into
rust-lang:mainfrom
dianqk:storage-alloc-dse
Closed

dianqk wants to merge 2 commits into
rust-lang:mainfrom
dianqk:storage-alloc-dse

Conversation

@dianqk

@dianqk dianqk commented Oct 28, 2026

Copy link
Copy Markdown
Member

Alternative to #165074. It depends on #163335.

When eliminating a dead assignment, we leave a storage allocation statement behind, so that the allocation's location is preserved.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 28, 2026
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job test-pr-check-2 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
    Checking regex-automata v0.4.13
[RUSTC-TIMING] cargo_metadata test:false 0.872
    Checking tracing-error v0.2.1
[RUSTC-TIMING] tracing_error test:false 0.088
error[E0004]: non-exhaustive patterns: `&StatementKind::StorageAlloc(_)` not covered
   --> src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs:238:11
    |
238 |     match &statement.kind {
    |           ^^^^^^^^^^^^^^^ pattern `&StatementKind::StorageAlloc(_)` not covered
    |
note: `StatementKind<'_>` defined here
   --> compiler/rustc_middle/src/mir/syntax.rs:307:1
    |
307 | pub enum StatementKind<'tcx> {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
392 |     StorageAlloc(Local),
    |     ------------ not covered
    = note: the matched value is of type `&StatementKind<'_>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
    |
265 ~         | StatementKind::Nop => Ok(()),
266 ~         &StatementKind::StorageAlloc(_) => todo!(),
    |

For more information about this error, try `rustc --explain E0004`.
[RUSTC-TIMING] clippy_utils test:false 2.419
error: could not compile `clippy_utils` (lib) due to 1 previous error

@dianqk dianqk closed this Oct 29, 2026
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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