about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorYuki Okushi <jtitor@2k36.org>2022-02-09 14:12:24 +0900
committerGitHub <noreply@github.com>2022-02-09 14:12:24 +0900
commita07eed99f6505aeefa97aa7f73f8fb70ee5eb12f (patch)
tree3ac549d8d59d0e72f2380abb2063ad4e23d95792 /src
parent68fa9b198aaef41b173f5dbf4b2822765ce5007c (diff)
parent97b24f3236a59c920b8978604739fcd274c678de (diff)
downloadrust-a07eed99f6505aeefa97aa7f73f8fb70ee5eb12f.tar.gz
rust-a07eed99f6505aeefa97aa7f73f8fb70ee5eb12f.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/test/ui/async-await/issue-93648.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/ui/async-await/issue-93648.rs b/src/test/ui/async-await/issue-93648.rs
new file mode 100644
index 00000000000..4ce3ac1e874
--- /dev/null
+++ b/src/test/ui/async-await/issue-93648.rs
@@ -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;
+    };
+}