about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEric Holk <ericholk@microsoft.com>2022-09-13 14:41:07 -0700
committerEric Holk <ericholk@microsoft.com>2022-09-13 15:16:19 -0700
commit5671a7611924fef91cc69d6a394412f4e990e4e4 (patch)
treea17b27b1b6d1d5e14f6933a435dae5bdfce69835
parentb950ae44e08c549029368f95d0af833ca1e92016 (diff)
downloadrust-5671a7611924fef91cc69d6a394412f4e990e4e4.tar.gz
rust-5671a7611924fef91cc69d6a394412f4e990e4e4.zip
Update partial-drop-partial-reinit.rs
-rw-r--r--src/test/ui/async-await/partial-drop-partial-reinit.drop_tracking.stderr35
-rw-r--r--src/test/ui/async-await/partial-drop-partial-reinit.no_drop_tracking.stderr (renamed from src/test/ui/async-await/partial-drop-partial-reinit.stderr)6
-rw-r--r--src/test/ui/async-await/partial-drop-partial-reinit.rs11
3 files changed, 45 insertions, 7 deletions
diff --git a/src/test/ui/async-await/partial-drop-partial-reinit.drop_tracking.stderr b/src/test/ui/async-await/partial-drop-partial-reinit.drop_tracking.stderr
new file mode 100644
index 00000000000..17b4ef7bdc6
--- /dev/null
+++ b/src/test/ui/async-await/partial-drop-partial-reinit.drop_tracking.stderr
@@ -0,0 +1,35 @@
+error[E0277]: `NotSend` cannot be sent between threads safely
+  --> $DIR/partial-drop-partial-reinit.rs:9:16
+   |
+LL |     gimme_send(foo());
+   |     ---------- ^^^^^ `NotSend` cannot be sent between threads safely
+   |     |
+   |     required by a bound introduced by this call
+...
+LL | async fn foo() {
+   |                - within this `impl Future<Output = ()>`
+   |
+   = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `NotSend`
+   = note: required because it appears within the type `(NotSend,)`
+   = note: required because it captures the following types: `ResumeTy`, `(NotSend,)`, `()`, `impl Future<Output = ()>`
+note: required because it's used within this `async fn` body
+  --> $DIR/partial-drop-partial-reinit.rs:31:16
+   |
+LL |   async fn foo() {
+   |  ________________^
+LL | |
+LL | |
+LL | |     let mut x = (NotSend {},);
+...  |
+LL | |     bar().await;
+LL | | }
+   | |_^
+note: required by a bound in `gimme_send`
+  --> $DIR/partial-drop-partial-reinit.rs:17:18
+   |
+LL | fn gimme_send<T: Send>(t: T) {
+   |                  ^^^^ required by this bound in `gimme_send`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/async-await/partial-drop-partial-reinit.stderr b/src/test/ui/async-await/partial-drop-partial-reinit.no_drop_tracking.stderr
index 05f5358340a..34d8a159f10 100644
--- a/src/test/ui/async-await/partial-drop-partial-reinit.stderr
+++ b/src/test/ui/async-await/partial-drop-partial-reinit.no_drop_tracking.stderr
@@ -1,5 +1,5 @@
 error[E0277]: `NotSend` cannot be sent between threads safely
-  --> $DIR/partial-drop-partial-reinit.rs:6:16
+  --> $DIR/partial-drop-partial-reinit.rs:9:16
    |
 LL |     gimme_send(foo());
    |     ---------- ^^^^^ `NotSend` cannot be sent between threads safely
@@ -13,7 +13,7 @@ LL | async fn foo() {
    = note: required because it appears within the type `(NotSend,)`
    = note: required because it captures the following types: `ResumeTy`, `(NotSend,)`, `impl Future<Output = ()>`, `()`
 note: required because it's used within this `async fn` body
-  --> $DIR/partial-drop-partial-reinit.rs:28:16
+  --> $DIR/partial-drop-partial-reinit.rs:31:16
    |
 LL |   async fn foo() {
    |  ________________^
@@ -25,7 +25,7 @@ LL | |     bar().await;
 LL | | }
    | |_^
 note: required by a bound in `gimme_send`
-  --> $DIR/partial-drop-partial-reinit.rs:14:18
+  --> $DIR/partial-drop-partial-reinit.rs:17:18
    |
 LL | fn gimme_send<T: Send>(t: T) {
    |                  ^^^^ required by this bound in `gimme_send`
diff --git a/src/test/ui/async-await/partial-drop-partial-reinit.rs b/src/test/ui/async-await/partial-drop-partial-reinit.rs
index fe0fce7afd9..7d097e72fb4 100644
--- a/src/test/ui/async-await/partial-drop-partial-reinit.rs
+++ b/src/test/ui/async-await/partial-drop-partial-reinit.rs
@@ -1,4 +1,7 @@
 // edition:2021
+// revisions: no_drop_tracking drop_tracking
+// [drop_tracking] compile-flags: -Zdrop-tracking=yes
+// [no_drop_tracking] compile-flags: -Zdrop-tracking=no
 #![feature(negative_impls)]
 #![allow(unused)]
 
@@ -12,8 +15,8 @@ fn main() {
 }
 
 fn gimme_send<T: Send>(t: T) {
-//~^ NOTE required by this bound
-//~| NOTE required by a bound
+    //~^ NOTE required by this bound
+    //~| NOTE required by a bound
     drop(t);
 }
 
@@ -26,8 +29,8 @@ impl Drop for NotSend {
 impl !Send for NotSend {}
 
 async fn foo() {
-//~^ NOTE used within this `async fn` body
-//~| NOTE within this `impl Future
+    //~^ NOTE used within this `async fn` body
+    //~| NOTE within this `impl Future
     let mut x = (NotSend {},);
     drop(x.0);
     x.0 = NotSend {};