Skip to content

Commit 096629e

Browse files
committed
Auto merge of rust-lang#142390 - cjgillot:mir-liveness, r=davidtwco
Perform unused assignment and unused variables lints on MIR. Rebase of rust-lang#101500 Fixes rust-lang#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.
2 parents 55c4531 + bebc230 commit 096629e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

std/src/sync/poison.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@
6060
//! while it is locked exclusively (write mode). If a panic occurs in any reader,
6161
//! then the lock will not be poisoned.
6262
63+
// If we are not unwinding, `PoisonError` is uninhabited.
64+
#![cfg_attr(not(panic = "unwind"), expect(unreachable_code))]
65+
6366
#[stable(feature = "rust1", since = "1.0.0")]
6467
pub use self::condvar::Condvar;
6568
#[unstable(feature = "mapped_lock_guards", issue = "117108")]

0 commit comments

Comments
 (0)