Files
rust/tests/ui/issues
bors ff6dc928c5 Auto merge of #142390 - cjgillot:mir-liveness, r=davidtwco
Perform unused assignment and unused variables lints on MIR.

Rebase of https://github.com/rust-lang/rust/pull/101500

Fixes https://github.com/rust-lang/rust/issues/51003.

The first commit moves detection of uninhabited types from the current liveness pass to MIR building.

In order to keep the same level of diagnostics, I had to instrument MIR a little more:
- keep for which original local a guard local is created;
- store in the `VarBindingForm` the list of introducer places and whether this was a shorthand pattern.

I am not very proud of the handling of self-assignments. The proposed scheme is in two parts: first detect probable self-assignments, by pattern matching on MIR, and second treat them specially during dataflow analysis. I welcome ideas.

Please review carefully the changes in tests. There are many small changes to behaviour, and I'm not sure all of them are desirable.
2025-10-12 13:00:04 +00:00
..
2025-04-03 21:41:58 +00:00
2025-06-06 20:52:34 +00:00
2025-02-04 10:57:49 +00:00
2025-02-03 19:00:22 +00:00
2025-10-11 20:50:21 +00:00
2024-01-13 12:46:58 -05:00
2024-07-06 14:24:20 +02:00
2023-05-01 16:15:13 +08:00
2025-08-26 14:46:11 +02:00
2023-04-08 21:32:55 +00:00
2025-10-01 07:39:03 +00:00
2024-01-05 10:00:59 +00:00
2025-08-14 18:18:42 +02:00
2025-08-14 18:18:42 +02:00
2025-08-22 08:58:45 +02:00
2023-11-16 17:00:23 +00:00
2024-04-29 14:53:38 +02:00
2025-08-14 18:18:42 +02:00
2025-08-14 18:18:42 +02:00
2023-01-15 19:46:20 +00:00
2023-01-15 19:46:20 +00:00
2025-08-22 13:16:44 +08:00
2025-08-22 13:16:44 +08:00
2024-11-22 02:32:26 +00:00
2023-06-26 08:56:32 +00:00