Rollup merge of #93751 - eholk:issue-93648-drop-tracking-projection, r=tmiasko

Drop tracking: track borrows of projections

Previous efforts to ignore partially consumed values meant we were also not considering borrows of a projection. This led to cases where we'd miss borrowed types which MIR expected to be there, leading to ICEs.

This PR also includes the `-Zdrop-tracking` flag from #93313. If that PR lands first, I'll rebase to drop the commit from this one.

Fixes #93648
This commit is contained in:
Yuki Okushi 2022-02-09 14:12:24 +09:00 committed by GitHub
commit a07eed99f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 33 additions and 19 deletions

View file

@ -0,0 +1,12 @@
// edition:2021
// build-pass
// compile-flags: -Zdrop-tracking
fn main() {
let _ = async {
let mut s = (String::new(),);
s.0.push_str("abc");
std::mem::drop(s);
async {}.await;
};
}