]> git.lizzy.rs Git - rust.git/commit - src/tools/miri
Auto merge of #87998 - nneonneo:master, r=oli-obk
authorbors <bors@rust-lang.org>
Thu, 30 Sep 2021 13:23:09 +0000 (13:23 +0000)
committerbors <bors@rust-lang.org>
Thu, 30 Sep 2021 13:23:09 +0000 (13:23 +0000)
commit6dc08b909b469d58dd8fa54c57ab193b8cf95257
treee36e8cf2e12a47008d6c4cb8935d8d860af4febf
parentc6007fdc7059c677a6c089e8d2915b264c0d1326
parent6ff5b471ef7806c40e57b9e83107ce4d62012d1b
Auto merge of #87998 - nneonneo:master, r=oli-obk

Avoid spurious "previous iteration of loop" errors

Only follow backwards edges during `get_moved_indexes` if the move path is definitely initialized at loop entry. Otherwise, the error occurred prior to the loop, so we ignore the backwards edges to avoid generating misleading "value moved here, in previous iteration of loop" errors.

This patch also slightly improves the analysis of inits, including `NonPanicPathOnly` initializations (which are ignored by `drop_flag_effects::for_location_inits`). This is required for the definite initialization analysis, but may also help find certain skipped reinits in rare cases.

Patch passes all non-ignored src/test/ui testcases.

Fixes #72649.
compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs