rust/compiler/rustc_typeck
Dylan DPC c7d200441b
Rollup merge of #94460 - eholk:reenable-drop-tracking-tests, r=tmiasko
Reenable generator drop tracking tests and fix mutation handling

The previous PR, #94068, was overly zealous in counting mutations as borrows, which effectively nullified drop tracking. We would have caught this except the drop tracking tests were still ignored, despite having the option of using the `-Zdrop-tracking` flag now.

This PR fixes the issue introduced by #94068 by only counting mutations as borrows the mutated place has a project. This is sufficient to distinguish `x.y = 42` (which should count as a borrow of `x`) from `x = 42` (which is not a borrow of `x` because the whole variable is overwritten).

This PR also re-enables the drop tracking regression tests using the `-Zdrop-tracking` flag so we will avoid introducing these sorts of issues in the future.

Thanks to ``@tmiasko`` for noticing this problem and pointing it out!

r? ``@tmiasko``
2022-03-05 04:46:37 +01:00
..
src Rollup merge of #94460 - eholk:reenable-drop-tracking-tests, r=tmiasko 2022-03-05 04:46:37 +01:00
Cargo.toml Fix control flow handling in generator_interior 2022-01-18 14:25:26 -08:00
README.md

For high-level intro to how type checking works in rustc, see the type checking chapter of the rustc dev guide.