diff --git a/tests/ui/async-await/async-await-let-else.drop-tracking.stderr b/tests/ui/async-await/async-await-let-else.drop-tracking.stderr deleted file mode 100644 index fb83ca90a3787..0000000000000 --- a/tests/ui/async-await/async-await-let-else.drop-tracking.stderr +++ /dev/null @@ -1,106 +0,0 @@ -error: future cannot be sent between threads safely - --> $DIR/async-await-let-else.rs:48:13 - | -LL | is_send(foo(Some(true))); - | ^^^^^^^^^^^^^^^ future returned by `foo` is not `Send` - | - = help: within `impl Future`, the trait `Send` is not implemented for `Rc<()>` -note: future is not `Send` as this value is used across an await - --> $DIR/async-await-let-else.rs:11:14 - | -LL | let r = Rc::new(()); - | - has type `Rc<()>` which is not `Send` -LL | bar().await - | ^^^^^^ await occurs here, with `r` maybe used later -LL | }; - | - `r` is later dropped here -note: required by a bound in `is_send` - --> $DIR/async-await-let-else.rs:19:15 - | -LL | fn is_send(_: T) {} - | ^^^^ required by this bound in `is_send` - -error[E0277]: `Rc<()>` cannot be sent between threads safely - --> $DIR/async-await-let-else.rs:50:13 - | -LL | async fn foo2(x: Option) { - | - within this `impl Future` -... -LL | is_send(foo2(Some(true))); - | ------- ^^^^^^^^^^^^^^^^ `Rc<()>` cannot be sent between threads safely - | | - | required by a bound introduced by this call - | - = help: within `impl Future`, the trait `Send` is not implemented for `Rc<()>` -note: required because it's used within this `async fn` body - --> $DIR/async-await-let-else.rs:27:29 - | -LL | async fn bar2(_: T) -> ! { - | _____________________________^ -LL | | panic!() -LL | | } - | |_^ - = note: required because it captures the following types: `ResumeTy`, `Option`, `impl Future`, `()` -note: required because it's used within this `async fn` body - --> $DIR/async-await-let-else.rs:21:32 - | -LL | async fn foo2(x: Option) { - | ________________________________^ -LL | | let Some(_) = x else { -LL | | bar2(Rc::new(())).await -LL | | }; -LL | | } - | |_^ -note: required by a bound in `is_send` - --> $DIR/async-await-let-else.rs:19:15 - | -LL | fn is_send(_: T) {} - | ^^^^ required by this bound in `is_send` - -error: future cannot be sent between threads safely - --> $DIR/async-await-let-else.rs:52:13 - | -LL | is_send(foo3(Some(true))); - | ^^^^^^^^^^^^^^^^ future returned by `foo3` is not `Send` - | - = help: within `impl Future`, the trait `Send` is not implemented for `Rc<()>` -note: future is not `Send` as this value is used across an await - --> $DIR/async-await-let-else.rs:33:28 - | -LL | (Rc::new(()), bar().await); - | ----------- ^^^^^^ - `Rc::new(())` is later dropped here - | | | - | | await occurs here, with `Rc::new(())` maybe used later - | has type `Rc<()>` which is not `Send` -note: required by a bound in `is_send` - --> $DIR/async-await-let-else.rs:19:15 - | -LL | fn is_send(_: T) {} - | ^^^^ required by this bound in `is_send` - -error: future cannot be sent between threads safely - --> $DIR/async-await-let-else.rs:54:13 - | -LL | is_send(foo4(Some(true))); - | ^^^^^^^^^^^^^^^^ future returned by `foo4` is not `Send` - | - = help: within `impl Future`, the trait `Send` is not implemented for `Rc<()>` -note: future is not `Send` as this value is used across an await - --> $DIR/async-await-let-else.rs:41:14 - | -LL | let r = Rc::new(()); - | - has type `Rc<()>` which is not `Send` -LL | bar().await; - | ^^^^^^ await occurs here, with `r` maybe used later -... -LL | }; - | - `r` is later dropped here -note: required by a bound in `is_send` - --> $DIR/async-await-let-else.rs:19:15 - | -LL | fn is_send(_: T) {} - | ^^^^ required by this bound in `is_send` - -error: aborting due to 4 previous errors - -For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/async-await/async-await-let-else.drop_tracking.stderr b/tests/ui/async-await/async-await-let-else.drop_tracking.stderr deleted file mode 100644 index dee90262fd443..0000000000000 --- a/tests/ui/async-await/async-await-let-else.drop_tracking.stderr +++ /dev/null @@ -1,106 +0,0 @@ -error: future cannot be sent between threads safely - --> $DIR/async-await-let-else.rs:48:13 - | -LL | is_send(foo(Some(true))); - | ^^^^^^^^^^^^^^^ future returned by `foo` is not `Send` - | - = help: within `impl Future`, the trait `Send` is not implemented for `Rc<()>` -note: future is not `Send` as this value is used across an await - --> $DIR/async-await-let-else.rs:11:15 - | -LL | let r = Rc::new(()); - | - has type `Rc<()>` which is not `Send` -LL | bar().await - | ^^^^^ await occurs here, with `r` maybe used later -LL | }; - | - `r` is later dropped here -note: required by a bound in `is_send` - --> $DIR/async-await-let-else.rs:19:15 - | -LL | fn is_send(_: T) {} - | ^^^^ required by this bound in `is_send` - -error[E0277]: `Rc<()>` cannot be sent between threads safely - --> $DIR/async-await-let-else.rs:50:13 - | -LL | async fn foo2(x: Option) { - | - within this `impl Future` -... -LL | is_send(foo2(Some(true))); - | ------- ^^^^^^^^^^^^^^^^ `Rc<()>` cannot be sent between threads safely - | | - | required by a bound introduced by this call - | - = help: within `impl Future`, the trait `Send` is not implemented for `Rc<()>` -note: required because it's used within this `async fn` body - --> $DIR/async-await-let-else.rs:27:29 - | -LL | async fn bar2(_: T) -> ! { - | _____________________________^ -LL | | panic!() -LL | | } - | |_^ - = note: required because it captures the following types: `ResumeTy`, `Option`, `impl Future`, `()` -note: required because it's used within this `async fn` body - --> $DIR/async-await-let-else.rs:21:32 - | -LL | async fn foo2(x: Option) { - | ________________________________^ -LL | | let Some(_) = x else { -LL | | bar2(Rc::new(())).await -LL | | }; -LL | | } - | |_^ -note: required by a bound in `is_send` - --> $DIR/async-await-let-else.rs:19:15 - | -LL | fn is_send(_: T) {} - | ^^^^ required by this bound in `is_send` - -error: future cannot be sent between threads safely - --> $DIR/async-await-let-else.rs:52:13 - | -LL | is_send(foo3(Some(true))); - | ^^^^^^^^^^^^^^^^ future returned by `foo3` is not `Send` - | - = help: within `impl Future`, the trait `Send` is not implemented for `Rc<()>` -note: future is not `Send` as this value is used across an await - --> $DIR/async-await-let-else.rs:33:29 - | -LL | (Rc::new(()), bar().await); - | ----------- ^^^^^ - `Rc::new(())` is later dropped here - | | | - | | await occurs here, with `Rc::new(())` maybe used later - | has type `Rc<()>` which is not `Send` -note: required by a bound in `is_send` - --> $DIR/async-await-let-else.rs:19:15 - | -LL | fn is_send(_: T) {} - | ^^^^ required by this bound in `is_send` - -error: future cannot be sent between threads safely - --> $DIR/async-await-let-else.rs:54:13 - | -LL | is_send(foo4(Some(true))); - | ^^^^^^^^^^^^^^^^ future returned by `foo4` is not `Send` - | - = help: within `impl Future`, the trait `Send` is not implemented for `Rc<()>` -note: future is not `Send` as this value is used across an await - --> $DIR/async-await-let-else.rs:41:15 - | -LL | let r = Rc::new(()); - | - has type `Rc<()>` which is not `Send` -LL | bar().await; - | ^^^^^ await occurs here, with `r` maybe used later -... -LL | }; - | - `r` is later dropped here -note: required by a bound in `is_send` - --> $DIR/async-await-let-else.rs:19:15 - | -LL | fn is_send(_: T) {} - | ^^^^ required by this bound in `is_send` - -error: aborting due to 4 previous errors - -For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/async-await/async-await-let-else.drop_tracking_mir.stderr b/tests/ui/async-await/async-await-let-else.drop_tracking_mir.stderr deleted file mode 100644 index e3fcceaa3921a..0000000000000 --- a/tests/ui/async-await/async-await-let-else.drop_tracking_mir.stderr +++ /dev/null @@ -1,100 +0,0 @@ -error: future cannot be sent between threads safely - --> $DIR/async-await-let-else.rs:48:13 - | -LL | is_send(foo(Some(true))); - | ^^^^^^^^^^^^^^^ future returned by `foo` is not `Send` - | - = help: within `impl Future`, the trait `Send` is not implemented for `Rc<()>` -note: future is not `Send` as this value is used across an await - --> $DIR/async-await-let-else.rs:11:15 - | -LL | let r = Rc::new(()); - | - has type `Rc<()>` which is not `Send` -LL | bar().await - | ^^^^^ await occurs here, with `r` maybe used later -note: required by a bound in `is_send` - --> $DIR/async-await-let-else.rs:19:15 - | -LL | fn is_send(_: T) {} - | ^^^^ required by this bound in `is_send` - -error[E0277]: `Rc<()>` cannot be sent between threads safely - --> $DIR/async-await-let-else.rs:50:13 - | -LL | async fn foo2(x: Option) { - | - within this `impl Future` -... -LL | is_send(foo2(Some(true))); - | ------- ^^^^^^^^^^^^^^^^ `Rc<()>` cannot be sent between threads safely - | | - | required by a bound introduced by this call - | - = help: within `impl Future`, the trait `Send` is not implemented for `Rc<()>` -note: required because it's used within this `async fn` body - --> $DIR/async-await-let-else.rs:27:29 - | -LL | async fn bar2(_: T) -> ! { - | _____________________________^ -LL | | panic!() -LL | | } - | |_^ - = note: required because it captures the following types: `impl Future` -note: required because it's used within this `async fn` body - --> $DIR/async-await-let-else.rs:21:32 - | -LL | async fn foo2(x: Option) { - | ________________________________^ -LL | | let Some(_) = x else { -LL | | bar2(Rc::new(())).await -LL | | }; -LL | | } - | |_^ -note: required by a bound in `is_send` - --> $DIR/async-await-let-else.rs:19:15 - | -LL | fn is_send(_: T) {} - | ^^^^ required by this bound in `is_send` - -error: future cannot be sent between threads safely - --> $DIR/async-await-let-else.rs:52:13 - | -LL | is_send(foo3(Some(true))); - | ^^^^^^^^^^^^^^^^ future returned by `foo3` is not `Send` - | - = help: within `impl Future`, the trait `Send` is not implemented for `Rc<()>` -note: future is not `Send` as this value is used across an await - --> $DIR/async-await-let-else.rs:33:29 - | -LL | (Rc::new(()), bar().await); - | ----------- ^^^^^ await occurs here, with `Rc::new(())` maybe used later - | | - | has type `Rc<()>` which is not `Send` -note: required by a bound in `is_send` - --> $DIR/async-await-let-else.rs:19:15 - | -LL | fn is_send(_: T) {} - | ^^^^ required by this bound in `is_send` - -error: future cannot be sent between threads safely - --> $DIR/async-await-let-else.rs:54:13 - | -LL | is_send(foo4(Some(true))); - | ^^^^^^^^^^^^^^^^ future returned by `foo4` is not `Send` - | - = help: within `impl Future`, the trait `Send` is not implemented for `Rc<()>` -note: future is not `Send` as this value is used across an await - --> $DIR/async-await-let-else.rs:41:15 - | -LL | let r = Rc::new(()); - | - has type `Rc<()>` which is not `Send` -LL | bar().await; - | ^^^^^ await occurs here, with `r` maybe used later -note: required by a bound in `is_send` - --> $DIR/async-await-let-else.rs:19:15 - | -LL | fn is_send(_: T) {} - | ^^^^ required by this bound in `is_send` - -error: aborting due to 4 previous errors - -For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/async-await/async-await-let-else.no-drop-tracking.stderr b/tests/ui/async-await/async-await-let-else.no-drop-tracking.stderr deleted file mode 100644 index d3c5e80a30df4..0000000000000 --- a/tests/ui/async-await/async-await-let-else.no-drop-tracking.stderr +++ /dev/null @@ -1,90 +0,0 @@ -error: future cannot be sent between threads safely - --> $DIR/async-await-let-else.rs:48:13 - | -LL | is_send(foo(Some(true))); - | ^^^^^^^^^^^^^^^ future returned by `foo` is not `Send` - | - = help: within `impl Future`, the trait `Send` is not implemented for `Rc<()>` -note: future is not `Send` as this value is used across an await - --> $DIR/async-await-let-else.rs:11:14 - | -LL | let r = Rc::new(()); - | - has type `Rc<()>` which is not `Send` -LL | bar().await - | ^^^^^^ await occurs here, with `r` maybe used later -LL | }; - | - `r` is later dropped here -note: required by a bound in `is_send` - --> $DIR/async-await-let-else.rs:19:15 - | -LL | fn is_send(_: T) {} - | ^^^^ required by this bound in `is_send` - -error: future cannot be sent between threads safely - --> $DIR/async-await-let-else.rs:50:13 - | -LL | is_send(foo2(Some(true))); - | ^^^^^^^^^^^^^^^^ future returned by `foo2` is not `Send` - | - = help: within `impl Future`, the trait `Send` is not implemented for `Rc<()>` -note: future is not `Send` as this value is used across an await - --> $DIR/async-await-let-else.rs:23:26 - | -LL | bar2(Rc::new(())).await - | ----------- ^^^^^^ await occurs here, with `Rc::new(())` maybe used later - | | - | has type `Rc<()>` which is not `Send` -LL | }; - | - `Rc::new(())` is later dropped here -note: required by a bound in `is_send` - --> $DIR/async-await-let-else.rs:19:15 - | -LL | fn is_send(_: T) {} - | ^^^^ required by this bound in `is_send` - -error: future cannot be sent between threads safely - --> $DIR/async-await-let-else.rs:52:13 - | -LL | is_send(foo3(Some(true))); - | ^^^^^^^^^^^^^^^^ future returned by `foo3` is not `Send` - | - = help: within `impl Future`, the trait `Send` is not implemented for `Rc<()>` -note: future is not `Send` as this value is used across an await - --> $DIR/async-await-let-else.rs:33:28 - | -LL | (Rc::new(()), bar().await); - | ----------- ^^^^^^ - `Rc::new(())` is later dropped here - | | | - | | await occurs here, with `Rc::new(())` maybe used later - | has type `Rc<()>` which is not `Send` -note: required by a bound in `is_send` - --> $DIR/async-await-let-else.rs:19:15 - | -LL | fn is_send(_: T) {} - | ^^^^ required by this bound in `is_send` - -error: future cannot be sent between threads safely - --> $DIR/async-await-let-else.rs:54:13 - | -LL | is_send(foo4(Some(true))); - | ^^^^^^^^^^^^^^^^ future returned by `foo4` is not `Send` - | - = help: within `impl Future`, the trait `Send` is not implemented for `Rc<()>` -note: future is not `Send` as this value is used across an await - --> $DIR/async-await-let-else.rs:41:14 - | -LL | let r = Rc::new(()); - | - has type `Rc<()>` which is not `Send` -LL | bar().await; - | ^^^^^^ await occurs here, with `r` maybe used later -... -LL | }; - | - `r` is later dropped here -note: required by a bound in `is_send` - --> $DIR/async-await-let-else.rs:19:15 - | -LL | fn is_send(_: T) {} - | ^^^^ required by this bound in `is_send` - -error: aborting due to 4 previous errors - diff --git a/tests/ui/async-await/async-await-let-else.rs b/tests/ui/async-await/async-await-let-else.rs index 113d576b5e762..a3c7226056b29 100644 --- a/tests/ui/async-await/async-await-let-else.rs +++ b/tests/ui/async-await/async-await-let-else.rs @@ -1,7 +1,4 @@ // edition:2021 -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir use std::rc::Rc; diff --git a/tests/ui/async-await/async-await-let-else.no_drop_tracking.stderr b/tests/ui/async-await/async-await-let-else.stderr similarity index 85% rename from tests/ui/async-await/async-await-let-else.no_drop_tracking.stderr rename to tests/ui/async-await/async-await-let-else.stderr index ece4e51ecff10..b47201502f6d9 100644 --- a/tests/ui/async-await/async-await-let-else.no_drop_tracking.stderr +++ b/tests/ui/async-await/async-await-let-else.stderr @@ -1,12 +1,12 @@ error: future cannot be sent between threads safely - --> $DIR/async-await-let-else.rs:48:13 + --> $DIR/async-await-let-else.rs:45:13 | LL | is_send(foo(Some(true))); | ^^^^^^^^^^^^^^^ future returned by `foo` is not `Send` | = help: within `impl Future`, the trait `Send` is not implemented for `Rc<()>` note: future is not `Send` as this value is used across an await - --> $DIR/async-await-let-else.rs:11:15 + --> $DIR/async-await-let-else.rs:8:15 | LL | let r = Rc::new(()); | - has type `Rc<()>` which is not `Send` @@ -15,20 +15,20 @@ LL | bar().await LL | }; | - `r` is later dropped here note: required by a bound in `is_send` - --> $DIR/async-await-let-else.rs:19:15 + --> $DIR/async-await-let-else.rs:16:15 | LL | fn is_send(_: T) {} | ^^^^ required by this bound in `is_send` error: future cannot be sent between threads safely - --> $DIR/async-await-let-else.rs:50:13 + --> $DIR/async-await-let-else.rs:47:13 | LL | is_send(foo2(Some(true))); | ^^^^^^^^^^^^^^^^ future returned by `foo2` is not `Send` | = help: within `impl Future`, the trait `Send` is not implemented for `Rc<()>` note: future is not `Send` as this value is used across an await - --> $DIR/async-await-let-else.rs:23:27 + --> $DIR/async-await-let-else.rs:20:27 | LL | bar2(Rc::new(())).await | ----------- ^^^^^ await occurs here, with `Rc::new(())` maybe used later @@ -37,20 +37,20 @@ LL | bar2(Rc::new(())).await LL | }; | - `Rc::new(())` is later dropped here note: required by a bound in `is_send` - --> $DIR/async-await-let-else.rs:19:15 + --> $DIR/async-await-let-else.rs:16:15 | LL | fn is_send(_: T) {} | ^^^^ required by this bound in `is_send` error: future cannot be sent between threads safely - --> $DIR/async-await-let-else.rs:52:13 + --> $DIR/async-await-let-else.rs:49:13 | LL | is_send(foo3(Some(true))); | ^^^^^^^^^^^^^^^^ future returned by `foo3` is not `Send` | = help: within `impl Future`, the trait `Send` is not implemented for `Rc<()>` note: future is not `Send` as this value is used across an await - --> $DIR/async-await-let-else.rs:33:29 + --> $DIR/async-await-let-else.rs:30:29 | LL | (Rc::new(()), bar().await); | ----------- ^^^^^ - `Rc::new(())` is later dropped here @@ -58,20 +58,20 @@ LL | (Rc::new(()), bar().await); | | await occurs here, with `Rc::new(())` maybe used later | has type `Rc<()>` which is not `Send` note: required by a bound in `is_send` - --> $DIR/async-await-let-else.rs:19:15 + --> $DIR/async-await-let-else.rs:16:15 | LL | fn is_send(_: T) {} | ^^^^ required by this bound in `is_send` error: future cannot be sent between threads safely - --> $DIR/async-await-let-else.rs:54:13 + --> $DIR/async-await-let-else.rs:51:13 | LL | is_send(foo4(Some(true))); | ^^^^^^^^^^^^^^^^ future returned by `foo4` is not `Send` | = help: within `impl Future`, the trait `Send` is not implemented for `Rc<()>` note: future is not `Send` as this value is used across an await - --> $DIR/async-await-let-else.rs:41:15 + --> $DIR/async-await-let-else.rs:38:15 | LL | let r = Rc::new(()); | - has type `Rc<()>` which is not `Send` @@ -81,7 +81,7 @@ LL | bar().await; LL | }; | - `r` is later dropped here note: required by a bound in `is_send` - --> $DIR/async-await-let-else.rs:19:15 + --> $DIR/async-await-let-else.rs:16:15 | LL | fn is_send(_: T) {} | ^^^^ required by this bound in `is_send` diff --git a/tests/ui/async-await/async-error-span.drop_tracking_mir.stderr b/tests/ui/async-await/async-error-span.drop_tracking_mir.stderr deleted file mode 100644 index 2f29ee6cdb0a1..0000000000000 --- a/tests/ui/async-await/async-error-span.drop_tracking_mir.stderr +++ /dev/null @@ -1,24 +0,0 @@ -error[E0277]: `()` is not a future - --> $DIR/async-error-span.rs:10:20 - | -LL | fn get_future() -> impl Future { - | ^^^^^^^^^^^^^^^^^^^^^^^^ `()` is not a future - | - = help: the trait `Future` is not implemented for `()` - = note: () must be a future or must implement `IntoFuture` to be awaited - -error[E0282]: type annotations needed - --> $DIR/async-error-span.rs:16:9 - | -LL | let a; - | ^ - | -help: consider giving `a` an explicit type - | -LL | let a: /* Type */; - | ++++++++++++ - -error: aborting due to 2 previous errors - -Some errors have detailed explanations: E0277, E0282. -For more information about an error, try `rustc --explain E0277`. diff --git a/tests/ui/async-await/async-error-span.no_drop_tracking.stderr b/tests/ui/async-await/async-error-span.no_drop_tracking.stderr deleted file mode 100644 index 99a674a2684c4..0000000000000 --- a/tests/ui/async-await/async-error-span.no_drop_tracking.stderr +++ /dev/null @@ -1,25 +0,0 @@ -error[E0277]: `()` is not a future - --> $DIR/async-error-span.rs:10:20 - | -LL | fn get_future() -> impl Future { - | ^^^^^^^^^^^^^^^^^^^^^^^^ `()` is not a future - | - = help: the trait `Future` is not implemented for `()` - = note: () must be a future or must implement `IntoFuture` to be awaited - -error[E0698]: type inside `async fn` body must be known in this context - --> $DIR/async-error-span.rs:16:9 - | -LL | let a; - | ^ cannot infer type - | -note: the type is part of the `async fn` body because of this `await` - --> $DIR/async-error-span.rs:19:18 - | -LL | get_future().await; - | ^^^^^ - -error: aborting due to 2 previous errors - -Some errors have detailed explanations: E0277, E0698. -For more information about an error, try `rustc --explain E0277`. diff --git a/tests/ui/async-await/async-error-span.rs b/tests/ui/async-await/async-error-span.rs index c9ecf359e3de5..86d459bf084b1 100644 --- a/tests/ui/async-await/async-error-span.rs +++ b/tests/ui/async-await/async-error-span.rs @@ -1,6 +1,3 @@ -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir // edition:2018 // Regression test for issue #62382. @@ -13,9 +10,7 @@ fn get_future() -> impl Future { } async fn foo() { - let a; - //[no_drop_tracking,drop_tracking]~^ ERROR type inside `async fn` body must be known in this context - //[drop_tracking_mir]~^^ ERROR type annotations needed + let a; //~ ERROR type inside `async fn` body must be known in this context get_future().await; } diff --git a/tests/ui/async-await/async-error-span.drop_tracking.stderr b/tests/ui/async-await/async-error-span.stderr similarity index 86% rename from tests/ui/async-await/async-error-span.drop_tracking.stderr rename to tests/ui/async-await/async-error-span.stderr index 99a674a2684c4..68fb385718eb7 100644 --- a/tests/ui/async-await/async-error-span.drop_tracking.stderr +++ b/tests/ui/async-await/async-error-span.stderr @@ -1,5 +1,5 @@ error[E0277]: `()` is not a future - --> $DIR/async-error-span.rs:10:20 + --> $DIR/async-error-span.rs:7:20 | LL | fn get_future() -> impl Future { | ^^^^^^^^^^^^^^^^^^^^^^^^ `()` is not a future @@ -8,13 +8,13 @@ LL | fn get_future() -> impl Future { = note: () must be a future or must implement `IntoFuture` to be awaited error[E0698]: type inside `async fn` body must be known in this context - --> $DIR/async-error-span.rs:16:9 + --> $DIR/async-error-span.rs:13:9 | LL | let a; | ^ cannot infer type | note: the type is part of the `async fn` body because of this `await` - --> $DIR/async-error-span.rs:19:18 + --> $DIR/async-error-span.rs:14:18 | LL | get_future().await; | ^^^^^ diff --git a/tests/ui/async-await/async-fn-nonsend.drop_tracking_mir.stderr b/tests/ui/async-await/async-fn-nonsend.drop_tracking_mir.stderr deleted file mode 100644 index 219945e0971b9..0000000000000 --- a/tests/ui/async-await/async-fn-nonsend.drop_tracking_mir.stderr +++ /dev/null @@ -1,43 +0,0 @@ -error: future cannot be sent between threads safely - --> $DIR/async-fn-nonsend.rs:72:17 - | -LL | assert_send(non_send_temporary_in_match()); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `non_send_temporary_in_match` is not `Send` - | - = help: within `impl Future`, the trait `Send` is not implemented for `Rc<()>` -note: future is not `Send` as this value is used across an await - --> $DIR/async-fn-nonsend.rs:36:26 - | -LL | match Some(non_send()) { - | ---------------- has type `Option` which is not `Send` -LL | Some(_) => fut().await, - | ^^^^^ await occurs here, with `Some(non_send())` maybe used later -note: required by a bound in `assert_send` - --> $DIR/async-fn-nonsend.rs:67:24 - | -LL | fn assert_send(_: impl Send) {} - | ^^^^ required by this bound in `assert_send` - -error: future cannot be sent between threads safely - --> $DIR/async-fn-nonsend.rs:74:17 - | -LL | assert_send(non_sync_with_method_call()); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `non_sync_with_method_call` is not `Send` - | - = help: within `impl Future`, the trait `Send` is not implemented for `dyn std::fmt::Write` -note: future is not `Send` as this value is used across an await - --> $DIR/async-fn-nonsend.rs:49:15 - | -LL | let f: &mut std::fmt::Formatter = &mut get_formatter(); - | --------------- has type `Formatter<'_>` which is not `Send` -... -LL | fut().await; - | ^^^^^ await occurs here, with `get_formatter()` maybe used later -note: required by a bound in `assert_send` - --> $DIR/async-fn-nonsend.rs:67:24 - | -LL | fn assert_send(_: impl Send) {} - | ^^^^ required by this bound in `assert_send` - -error: aborting due to 2 previous errors - diff --git a/tests/ui/async-await/async-fn-nonsend.no_drop_tracking.stderr b/tests/ui/async-await/async-fn-nonsend.no_drop_tracking.stderr deleted file mode 100644 index b29d2e192f4f5..0000000000000 --- a/tests/ui/async-await/async-fn-nonsend.no_drop_tracking.stderr +++ /dev/null @@ -1,120 +0,0 @@ -error: future cannot be sent between threads safely - --> $DIR/async-fn-nonsend.rs:70:17 - | -LL | assert_send(local_dropped_before_await()); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `local_dropped_before_await` is not `Send` - | - = help: within `impl Future`, the trait `Send` is not implemented for `Rc<()>` -note: future is not `Send` as this value is used across an await - --> $DIR/async-fn-nonsend.rs:27:11 - | -LL | let x = non_send(); - | - has type `impl Debug` which is not `Send` -LL | drop(x); -LL | fut().await; - | ^^^^^ await occurs here, with `x` maybe used later -LL | } - | - `x` is later dropped here -note: required by a bound in `assert_send` - --> $DIR/async-fn-nonsend.rs:67:24 - | -LL | fn assert_send(_: impl Send) {} - | ^^^^ required by this bound in `assert_send` - -error: future cannot be sent between threads safely - --> $DIR/async-fn-nonsend.rs:72:17 - | -LL | assert_send(non_send_temporary_in_match()); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `non_send_temporary_in_match` is not `Send` - | - = help: within `impl Future`, the trait `Send` is not implemented for `Rc<()>` -note: future is not `Send` as this value is used across an await - --> $DIR/async-fn-nonsend.rs:36:26 - | -LL | match Some(non_send()) { - | ---------- has type `impl Debug` which is not `Send` -LL | Some(_) => fut().await, - | ^^^^^ await occurs here, with `non_send()` maybe used later -... -LL | } - | - `non_send()` is later dropped here -note: required by a bound in `assert_send` - --> $DIR/async-fn-nonsend.rs:67:24 - | -LL | fn assert_send(_: impl Send) {} - | ^^^^ required by this bound in `assert_send` - -error: future cannot be sent between threads safely - --> $DIR/async-fn-nonsend.rs:74:17 - | -LL | assert_send(non_sync_with_method_call()); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `non_sync_with_method_call` is not `Send` - | - = help: within `impl Future`, the trait `Send` is not implemented for `dyn std::fmt::Write` -note: future is not `Send` as this value is used across an await - --> $DIR/async-fn-nonsend.rs:49:15 - | -LL | let f: &mut std::fmt::Formatter = &mut get_formatter(); - | --------------- has type `Formatter<'_>` which is not `Send` -... -LL | fut().await; - | ^^^^^ await occurs here, with `get_formatter()` maybe used later -LL | } -LL | } - | - `get_formatter()` is later dropped here -note: required by a bound in `assert_send` - --> $DIR/async-fn-nonsend.rs:67:24 - | -LL | fn assert_send(_: impl Send) {} - | ^^^^ required by this bound in `assert_send` - -error: future cannot be sent between threads safely - --> $DIR/async-fn-nonsend.rs:76:17 - | -LL | assert_send(non_sync_with_method_call_panic()); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `non_sync_with_method_call_panic` is not `Send` - | - = help: within `impl Future`, the trait `Send` is not implemented for `dyn std::fmt::Write` -note: future is not `Send` as this value is used across an await - --> $DIR/async-fn-nonsend.rs:56:15 - | -LL | let f: &mut std::fmt::Formatter = panic!(); - | - has type `&mut Formatter<'_>` which is not `Send` -LL | if non_sync().fmt(f).unwrap() == () { -LL | fut().await; - | ^^^^^ await occurs here, with `f` maybe used later -LL | } -LL | } - | - `f` is later dropped here -note: required by a bound in `assert_send` - --> $DIR/async-fn-nonsend.rs:67:24 - | -LL | fn assert_send(_: impl Send) {} - | ^^^^ required by this bound in `assert_send` - -error: future cannot be sent between threads safely - --> $DIR/async-fn-nonsend.rs:78:17 - | -LL | assert_send(non_sync_with_method_call_infinite_loop()); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `non_sync_with_method_call_infinite_loop` is not `Send` - | - = help: within `impl Future`, the trait `Send` is not implemented for `dyn std::fmt::Write` -note: future is not `Send` as this value is used across an await - --> $DIR/async-fn-nonsend.rs:63:15 - | -LL | let f: &mut std::fmt::Formatter = loop {}; - | - has type `&mut Formatter<'_>` which is not `Send` -LL | if non_sync().fmt(f).unwrap() == () { -LL | fut().await; - | ^^^^^ await occurs here, with `f` maybe used later -LL | } -LL | } - | - `f` is later dropped here -note: required by a bound in `assert_send` - --> $DIR/async-fn-nonsend.rs:67:24 - | -LL | fn assert_send(_: impl Send) {} - | ^^^^ required by this bound in `assert_send` - -error: aborting due to 5 previous errors - diff --git a/tests/ui/async-await/async-fn-nonsend.rs b/tests/ui/async-await/async-fn-nonsend.rs index ed440bd0182a6..d7f8d7ac546c0 100644 --- a/tests/ui/async-await/async-fn-nonsend.rs +++ b/tests/ui/async-await/async-fn-nonsend.rs @@ -1,8 +1,5 @@ -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir // edition:2018 -// compile-flags: --crate-type lib +// compile-flags: --crate-type lib -Zdrop-tracking use std::{cell::RefCell, fmt::Debug, rc::Rc}; @@ -68,13 +65,10 @@ fn assert_send(_: impl Send) {} pub fn pass_assert() { assert_send(local_dropped_before_await()); - //[no_drop_tracking]~^ ERROR future cannot be sent between threads safely assert_send(non_send_temporary_in_match()); //~^ ERROR future cannot be sent between threads safely assert_send(non_sync_with_method_call()); //~^ ERROR future cannot be sent between threads safely assert_send(non_sync_with_method_call_panic()); - //[no_drop_tracking]~^ ERROR future cannot be sent between threads safely assert_send(non_sync_with_method_call_infinite_loop()); - //[no_drop_tracking]~^ ERROR future cannot be sent between threads safely } diff --git a/tests/ui/async-await/async-fn-nonsend.drop_tracking.stderr b/tests/ui/async-await/async-fn-nonsend.stderr similarity index 89% rename from tests/ui/async-await/async-fn-nonsend.drop_tracking.stderr rename to tests/ui/async-await/async-fn-nonsend.stderr index 0515edaeda342..0d00fc072e14b 100644 --- a/tests/ui/async-await/async-fn-nonsend.drop_tracking.stderr +++ b/tests/ui/async-await/async-fn-nonsend.stderr @@ -1,12 +1,12 @@ error: future cannot be sent between threads safely - --> $DIR/async-fn-nonsend.rs:72:17 + --> $DIR/async-fn-nonsend.rs:68:17 | LL | assert_send(non_send_temporary_in_match()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `non_send_temporary_in_match` is not `Send` | = help: within `impl Future`, the trait `Send` is not implemented for `Rc<()>` note: future is not `Send` as this value is used across an await - --> $DIR/async-fn-nonsend.rs:36:26 + --> $DIR/async-fn-nonsend.rs:33:26 | LL | match Some(non_send()) { | ---------------- has type `Option` which is not `Send` @@ -16,20 +16,20 @@ LL | Some(_) => fut().await, LL | } | - `Some(non_send())` is later dropped here note: required by a bound in `assert_send` - --> $DIR/async-fn-nonsend.rs:67:24 + --> $DIR/async-fn-nonsend.rs:64:24 | LL | fn assert_send(_: impl Send) {} | ^^^^ required by this bound in `assert_send` error: future cannot be sent between threads safely - --> $DIR/async-fn-nonsend.rs:74:17 + --> $DIR/async-fn-nonsend.rs:70:17 | LL | assert_send(non_sync_with_method_call()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `non_sync_with_method_call` is not `Send` | = help: within `impl Future`, the trait `Send` is not implemented for `dyn std::fmt::Write` note: future is not `Send` as this value is used across an await - --> $DIR/async-fn-nonsend.rs:49:15 + --> $DIR/async-fn-nonsend.rs:46:15 | LL | let f: &mut std::fmt::Formatter = &mut get_formatter(); | --------------- has type `Formatter<'_>` which is not `Send` @@ -40,7 +40,7 @@ LL | } LL | } | - `get_formatter()` is later dropped here note: required by a bound in `assert_send` - --> $DIR/async-fn-nonsend.rs:67:24 + --> $DIR/async-fn-nonsend.rs:64:24 | LL | fn assert_send(_: impl Send) {} | ^^^^ required by this bound in `assert_send` diff --git a/tests/ui/async-await/awaiting-unsized-param.drop_tracking_mir.stderr b/tests/ui/async-await/awaiting-unsized-param.drop_tracking_mir.stderr deleted file mode 100644 index 02cf8310a504c..0000000000000 --- a/tests/ui/async-await/awaiting-unsized-param.drop_tracking_mir.stderr +++ /dev/null @@ -1,21 +0,0 @@ -warning: the feature `unsized_locals` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/awaiting-unsized-param.rs:5:31 - | -LL | #![feature(unsized_fn_params, unsized_locals)] - | ^^^^^^^^^^^^^^ - | - = note: see issue #48055 for more information - = note: `#[warn(incomplete_features)]` on by default - -error[E0277]: the size for values of type `(dyn Future + Unpin + 'static)` cannot be known at compilation time - --> $DIR/awaiting-unsized-param.rs:10:17 - | -LL | async fn bug(mut f: dyn Future + Unpin) -> T { - | ^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `(dyn Future + Unpin + 'static)` - = note: all values captured by value by a closure must have a statically known size - -error: aborting due to previous error; 1 warning emitted - -For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/async-await/awaiting-unsized-param.rs b/tests/ui/async-await/awaiting-unsized-param.rs index 2af8723b31241..e8b18bf37f866 100644 --- a/tests/ui/async-await/awaiting-unsized-param.rs +++ b/tests/ui/async-await/awaiting-unsized-param.rs @@ -1,6 +1,4 @@ // edition: 2021 -// revisions: no_drop_tracking drop_tracking_mir -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir #![feature(unsized_fn_params, unsized_locals)] //~^ WARN the feature `unsized_locals` is incomplete diff --git a/tests/ui/async-await/awaiting-unsized-param.no_drop_tracking.stderr b/tests/ui/async-await/awaiting-unsized-param.stderr similarity index 91% rename from tests/ui/async-await/awaiting-unsized-param.no_drop_tracking.stderr rename to tests/ui/async-await/awaiting-unsized-param.stderr index 02cf8310a504c..47a5dcebf25d6 100644 --- a/tests/ui/async-await/awaiting-unsized-param.no_drop_tracking.stderr +++ b/tests/ui/async-await/awaiting-unsized-param.stderr @@ -1,5 +1,5 @@ warning: the feature `unsized_locals` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/awaiting-unsized-param.rs:5:31 + --> $DIR/awaiting-unsized-param.rs:3:31 | LL | #![feature(unsized_fn_params, unsized_locals)] | ^^^^^^^^^^^^^^ @@ -8,7 +8,7 @@ LL | #![feature(unsized_fn_params, unsized_locals)] = note: `#[warn(incomplete_features)]` on by default error[E0277]: the size for values of type `(dyn Future + Unpin + 'static)` cannot be known at compilation time - --> $DIR/awaiting-unsized-param.rs:10:17 + --> $DIR/awaiting-unsized-param.rs:8:17 | LL | async fn bug(mut f: dyn Future + Unpin) -> T { | ^^^^^ doesn't have a size known at compile-time diff --git a/tests/ui/async-await/default-struct-update.rs b/tests/ui/async-await/default-struct-update.rs index daee8469a1406..64fb6280dd7bb 100644 --- a/tests/ui/async-await/default-struct-update.rs +++ b/tests/ui/async-await/default-struct-update.rs @@ -1,8 +1,6 @@ -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir // build-pass // edition:2018 +// compile-flags: -Zdrop-tracking=y fn main() { let _ = foo(); diff --git a/tests/ui/async-await/drop-and-assign.rs b/tests/ui/async-await/drop-and-assign.rs index e520dfbdccebb..fa3f3303677da 100644 --- a/tests/ui/async-await/drop-and-assign.rs +++ b/tests/ui/async-await/drop-and-assign.rs @@ -1,7 +1,5 @@ -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir // edition:2021 +// compile-flags: -Zdrop-tracking // build-pass struct A; diff --git a/tests/ui/async-await/drop-track-field-assign-nonsend.drop_tracking.stderr b/tests/ui/async-await/drop-track-field-assign-nonsend.drop_tracking.stderr deleted file mode 100644 index 80402d8424de0..0000000000000 --- a/tests/ui/async-await/drop-track-field-assign-nonsend.drop_tracking.stderr +++ /dev/null @@ -1,25 +0,0 @@ -error: future cannot be sent between threads safely - --> $DIR/drop-track-field-assign-nonsend.rs:45:17 - | -LL | assert_send(agent.handle()); - | ^^^^^^^^^^^^^^ future returned by `handle` is not `Send` - | - = help: within `impl Future`, the trait `Send` is not implemented for `Rc` -note: future is not `Send` as this value is used across an await - --> $DIR/drop-track-field-assign-nonsend.rs:23:39 - | -LL | let mut info = self.info_result.clone(); - | -------- has type `InfoResult` which is not `Send` -... -LL | let _ = send_element(element).await; - | ^^^^^ await occurs here, with `mut info` maybe used later -LL | } - | - `mut info` is later dropped here -note: required by a bound in `assert_send` - --> $DIR/drop-track-field-assign-nonsend.rs:40:19 - | -LL | fn assert_send(_: T) {} - | ^^^^ required by this bound in `assert_send` - -error: aborting due to previous error - diff --git a/tests/ui/async-await/drop-track-field-assign-nonsend.drop_tracking_mir.stderr b/tests/ui/async-await/drop-track-field-assign-nonsend.drop_tracking_mir.stderr deleted file mode 100644 index d9141cf4e3642..0000000000000 --- a/tests/ui/async-await/drop-track-field-assign-nonsend.drop_tracking_mir.stderr +++ /dev/null @@ -1,23 +0,0 @@ -error: future cannot be sent between threads safely - --> $DIR/drop-track-field-assign-nonsend.rs:45:17 - | -LL | assert_send(agent.handle()); - | ^^^^^^^^^^^^^^ future returned by `handle` is not `Send` - | - = help: within `impl Future`, the trait `Send` is not implemented for `Rc` -note: future is not `Send` as this value is used across an await - --> $DIR/drop-track-field-assign-nonsend.rs:23:39 - | -LL | let mut info = self.info_result.clone(); - | -------- has type `InfoResult` which is not `Send` -... -LL | let _ = send_element(element).await; - | ^^^^^ await occurs here, with `mut info` maybe used later -note: required by a bound in `assert_send` - --> $DIR/drop-track-field-assign-nonsend.rs:40:19 - | -LL | fn assert_send(_: T) {} - | ^^^^ required by this bound in `assert_send` - -error: aborting due to previous error - diff --git a/tests/ui/async-await/drop-track-field-assign-nonsend.no_drop_tracking.stderr b/tests/ui/async-await/drop-track-field-assign-nonsend.no_drop_tracking.stderr deleted file mode 100644 index 80402d8424de0..0000000000000 --- a/tests/ui/async-await/drop-track-field-assign-nonsend.no_drop_tracking.stderr +++ /dev/null @@ -1,25 +0,0 @@ -error: future cannot be sent between threads safely - --> $DIR/drop-track-field-assign-nonsend.rs:45:17 - | -LL | assert_send(agent.handle()); - | ^^^^^^^^^^^^^^ future returned by `handle` is not `Send` - | - = help: within `impl Future`, the trait `Send` is not implemented for `Rc` -note: future is not `Send` as this value is used across an await - --> $DIR/drop-track-field-assign-nonsend.rs:23:39 - | -LL | let mut info = self.info_result.clone(); - | -------- has type `InfoResult` which is not `Send` -... -LL | let _ = send_element(element).await; - | ^^^^^ await occurs here, with `mut info` maybe used later -LL | } - | - `mut info` is later dropped here -note: required by a bound in `assert_send` - --> $DIR/drop-track-field-assign-nonsend.rs:40:19 - | -LL | fn assert_send(_: T) {} - | ^^^^ required by this bound in `assert_send` - -error: aborting due to previous error - diff --git a/tests/ui/async-await/drop-track-field-assign-nonsend.rs b/tests/ui/async-await/drop-track-field-assign-nonsend.rs index 3e22280008fcf..b6c0fda15216a 100644 --- a/tests/ui/async-await/drop-track-field-assign-nonsend.rs +++ b/tests/ui/async-await/drop-track-field-assign-nonsend.rs @@ -1,8 +1,6 @@ -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir // Derived from an ICE found in tokio-xmpp during a crater run. // edition:2021 +// compile-flags: -Zdrop-tracking #![allow(dead_code)] diff --git a/tests/ui/async-await/field-assign-nonsend.drop_tracking.stderr b/tests/ui/async-await/drop-track-field-assign-nonsend.stderr similarity index 84% rename from tests/ui/async-await/field-assign-nonsend.drop_tracking.stderr rename to tests/ui/async-await/drop-track-field-assign-nonsend.stderr index e2e64c9ae0c4f..f36207b38a1ae 100644 --- a/tests/ui/async-await/field-assign-nonsend.drop_tracking.stderr +++ b/tests/ui/async-await/drop-track-field-assign-nonsend.stderr @@ -1,12 +1,12 @@ error: future cannot be sent between threads safely - --> $DIR/field-assign-nonsend.rs:45:17 + --> $DIR/drop-track-field-assign-nonsend.rs:43:17 | LL | assert_send(agent.handle()); | ^^^^^^^^^^^^^^ future returned by `handle` is not `Send` | = help: within `impl Future`, the trait `Send` is not implemented for `Rc` note: future is not `Send` as this value is used across an await - --> $DIR/field-assign-nonsend.rs:23:39 + --> $DIR/drop-track-field-assign-nonsend.rs:21:39 | LL | let mut info = self.info_result.clone(); | -------- has type `InfoResult` which is not `Send` @@ -16,7 +16,7 @@ LL | let _ = send_element(element).await; LL | } | - `mut info` is later dropped here note: required by a bound in `assert_send` - --> $DIR/field-assign-nonsend.rs:40:19 + --> $DIR/drop-track-field-assign-nonsend.rs:38:19 | LL | fn assert_send(_: T) {} | ^^^^ required by this bound in `assert_send` diff --git a/tests/ui/async-await/drop-track-field-assign.rs b/tests/ui/async-await/drop-track-field-assign.rs index b79d2af066a37..cfea7db2a1036 100644 --- a/tests/ui/async-await/drop-track-field-assign.rs +++ b/tests/ui/async-await/drop-track-field-assign.rs @@ -1,8 +1,6 @@ -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir // Derived from an ICE found in tokio-xmpp during a crater run. // edition:2021 +// compile-flags: -Zdrop-tracking // build-pass #![allow(dead_code)] diff --git a/tests/ui/async-await/field-assign-nonsend.drop_tracking_mir.stderr b/tests/ui/async-await/field-assign-nonsend.drop_tracking_mir.stderr deleted file mode 100644 index d1df8e91afa2c..0000000000000 --- a/tests/ui/async-await/field-assign-nonsend.drop_tracking_mir.stderr +++ /dev/null @@ -1,23 +0,0 @@ -error: future cannot be sent between threads safely - --> $DIR/field-assign-nonsend.rs:45:17 - | -LL | assert_send(agent.handle()); - | ^^^^^^^^^^^^^^ future returned by `handle` is not `Send` - | - = help: within `impl Future`, the trait `Send` is not implemented for `Rc` -note: future is not `Send` as this value is used across an await - --> $DIR/field-assign-nonsend.rs:23:39 - | -LL | let mut info = self.info_result.clone(); - | -------- has type `InfoResult` which is not `Send` -... -LL | let _ = send_element(element).await; - | ^^^^^ await occurs here, with `mut info` maybe used later -note: required by a bound in `assert_send` - --> $DIR/field-assign-nonsend.rs:40:19 - | -LL | fn assert_send(_: T) {} - | ^^^^ required by this bound in `assert_send` - -error: aborting due to previous error - diff --git a/tests/ui/async-await/field-assign-nonsend.rs b/tests/ui/async-await/field-assign-nonsend.rs index 3e22280008fcf..19315ef19f90f 100644 --- a/tests/ui/async-await/field-assign-nonsend.rs +++ b/tests/ui/async-await/field-assign-nonsend.rs @@ -1,6 +1,3 @@ -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir // Derived from an ICE found in tokio-xmpp during a crater run. // edition:2021 diff --git a/tests/ui/async-await/field-assign-nonsend.no_drop_tracking.stderr b/tests/ui/async-await/field-assign-nonsend.stderr similarity index 87% rename from tests/ui/async-await/field-assign-nonsend.no_drop_tracking.stderr rename to tests/ui/async-await/field-assign-nonsend.stderr index e2e64c9ae0c4f..481b236bbdb11 100644 --- a/tests/ui/async-await/field-assign-nonsend.no_drop_tracking.stderr +++ b/tests/ui/async-await/field-assign-nonsend.stderr @@ -1,12 +1,12 @@ error: future cannot be sent between threads safely - --> $DIR/field-assign-nonsend.rs:45:17 + --> $DIR/field-assign-nonsend.rs:42:17 | LL | assert_send(agent.handle()); | ^^^^^^^^^^^^^^ future returned by `handle` is not `Send` | = help: within `impl Future`, the trait `Send` is not implemented for `Rc` note: future is not `Send` as this value is used across an await - --> $DIR/field-assign-nonsend.rs:23:39 + --> $DIR/field-assign-nonsend.rs:20:39 | LL | let mut info = self.info_result.clone(); | -------- has type `InfoResult` which is not `Send` @@ -16,7 +16,7 @@ LL | let _ = send_element(element).await; LL | } | - `mut info` is later dropped here note: required by a bound in `assert_send` - --> $DIR/field-assign-nonsend.rs:40:19 + --> $DIR/field-assign-nonsend.rs:37:19 | LL | fn assert_send(_: T) {} | ^^^^ required by this bound in `assert_send` diff --git a/tests/ui/async-await/field-assign.rs b/tests/ui/async-await/field-assign.rs index b79d2af066a37..4887eff7efa29 100644 --- a/tests/ui/async-await/field-assign.rs +++ b/tests/ui/async-await/field-assign.rs @@ -1,6 +1,3 @@ -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir // Derived from an ICE found in tokio-xmpp during a crater run. // edition:2021 // build-pass diff --git a/tests/ui/async-await/issue-64130-1-sync.drop_tracking.stderr b/tests/ui/async-await/issue-64130-1-sync.drop_tracking.stderr deleted file mode 100644 index 56aa035f44bab..0000000000000 --- a/tests/ui/async-await/issue-64130-1-sync.drop_tracking.stderr +++ /dev/null @@ -1,25 +0,0 @@ -error: future cannot be shared between threads safely - --> $DIR/issue-64130-1-sync.rs:25:13 - | -LL | is_sync(bar()); - | ^^^^^ future returned by `bar` is not `Sync` - | - = help: within `impl Future`, the trait `Sync` is not implemented for `Foo` -note: future is not `Sync` as this value is used across an await - --> $DIR/issue-64130-1-sync.rs:18:11 - | -LL | let x = Foo; - | - has type `Foo` which is not `Sync` -LL | baz().await; - | ^^^^^ await occurs here, with `x` maybe used later -LL | drop(x); -LL | } - | - `x` is later dropped here -note: required by a bound in `is_sync` - --> $DIR/issue-64130-1-sync.rs:14:15 - | -LL | fn is_sync(t: T) { } - | ^^^^ required by this bound in `is_sync` - -error: aborting due to previous error - diff --git a/tests/ui/async-await/issue-64130-1-sync.drop_tracking_mir.stderr b/tests/ui/async-await/issue-64130-1-sync.drop_tracking_mir.stderr deleted file mode 100644 index ea1bfb9f9ac23..0000000000000 --- a/tests/ui/async-await/issue-64130-1-sync.drop_tracking_mir.stderr +++ /dev/null @@ -1,22 +0,0 @@ -error: future cannot be shared between threads safely - --> $DIR/issue-64130-1-sync.rs:25:13 - | -LL | is_sync(bar()); - | ^^^^^ future returned by `bar` is not `Sync` - | - = help: within `impl Future`, the trait `Sync` is not implemented for `Foo` -note: future is not `Sync` as this value is used across an await - --> $DIR/issue-64130-1-sync.rs:18:11 - | -LL | let x = Foo; - | - has type `Foo` which is not `Sync` -LL | baz().await; - | ^^^^^ await occurs here, with `x` maybe used later -note: required by a bound in `is_sync` - --> $DIR/issue-64130-1-sync.rs:14:15 - | -LL | fn is_sync(t: T) { } - | ^^^^ required by this bound in `is_sync` - -error: aborting due to previous error - diff --git a/tests/ui/async-await/issue-64130-1-sync.rs b/tests/ui/async-await/issue-64130-1-sync.rs index 44646e0e5f27b..1714cec5221de 100644 --- a/tests/ui/async-await/issue-64130-1-sync.rs +++ b/tests/ui/async-await/issue-64130-1-sync.rs @@ -1,6 +1,3 @@ -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir #![feature(negative_impls)] // edition:2018 @@ -16,7 +13,6 @@ fn is_sync(t: T) { } async fn bar() { let x = Foo; baz().await; - drop(x); } async fn baz() { } diff --git a/tests/ui/async-await/issue-64130-1-sync.no_drop_tracking.stderr b/tests/ui/async-await/issue-64130-1-sync.stderr similarity index 83% rename from tests/ui/async-await/issue-64130-1-sync.no_drop_tracking.stderr rename to tests/ui/async-await/issue-64130-1-sync.stderr index 56aa035f44bab..06d26ea73dc9e 100644 --- a/tests/ui/async-await/issue-64130-1-sync.no_drop_tracking.stderr +++ b/tests/ui/async-await/issue-64130-1-sync.stderr @@ -1,22 +1,21 @@ error: future cannot be shared between threads safely - --> $DIR/issue-64130-1-sync.rs:25:13 + --> $DIR/issue-64130-1-sync.rs:21:13 | LL | is_sync(bar()); | ^^^^^ future returned by `bar` is not `Sync` | = help: within `impl Future`, the trait `Sync` is not implemented for `Foo` note: future is not `Sync` as this value is used across an await - --> $DIR/issue-64130-1-sync.rs:18:11 + --> $DIR/issue-64130-1-sync.rs:15:11 | LL | let x = Foo; | - has type `Foo` which is not `Sync` LL | baz().await; | ^^^^^ await occurs here, with `x` maybe used later -LL | drop(x); LL | } | - `x` is later dropped here note: required by a bound in `is_sync` - --> $DIR/issue-64130-1-sync.rs:14:15 + --> $DIR/issue-64130-1-sync.rs:11:15 | LL | fn is_sync(t: T) { } | ^^^^ required by this bound in `is_sync` diff --git a/tests/ui/async-await/issue-64130-2-send.drop_tracking_mir.stderr b/tests/ui/async-await/issue-64130-2-send.drop_tracking_mir.stderr deleted file mode 100644 index 45e43525a206a..0000000000000 --- a/tests/ui/async-await/issue-64130-2-send.drop_tracking_mir.stderr +++ /dev/null @@ -1,26 +0,0 @@ -error: future cannot be sent between threads safely - --> $DIR/issue-64130-2-send.rs:24:13 - | -LL | is_send(bar()); - | ^^^^^ future returned by `bar` is not `Send` - | - = note: the trait bound `Unique: Send` is not satisfied -note: future is not `Send` as this value is used across an await - --> $DIR/issue-64130-2-send.rs:18:11 - | -LL | let x = Box::new(Foo); - | - has type `Box` which is not `Send` -LL | baz().await; - | ^^^^^ await occurs here, with `x` maybe used later -note: required by a bound in `is_send` - --> $DIR/issue-64130-2-send.rs:14:15 - | -LL | fn is_send(t: T) { } - | ^^^^ required by this bound in `is_send` -help: consider borrowing here - | -LL | is_send(&bar()); - | + - -error: aborting due to previous error - diff --git a/tests/ui/async-await/issue-64130-2-send.no_drop_tracking.stderr b/tests/ui/async-await/issue-64130-2-send.no_drop_tracking.stderr deleted file mode 100644 index d1717ad3310ab..0000000000000 --- a/tests/ui/async-await/issue-64130-2-send.no_drop_tracking.stderr +++ /dev/null @@ -1,28 +0,0 @@ -error: future cannot be sent between threads safely - --> $DIR/issue-64130-2-send.rs:24:13 - | -LL | is_send(bar()); - | ^^^^^ future returned by `bar` is not `Send` - | - = note: the trait bound `Unique: Send` is not satisfied -note: future is not `Send` as this value is used across an await - --> $DIR/issue-64130-2-send.rs:18:11 - | -LL | let x = Box::new(Foo); - | - has type `Box` which is not `Send` -LL | baz().await; - | ^^^^^ await occurs here, with `x` maybe used later -LL | } - | - `x` is later dropped here -note: required by a bound in `is_send` - --> $DIR/issue-64130-2-send.rs:14:15 - | -LL | fn is_send(t: T) { } - | ^^^^ required by this bound in `is_send` -help: consider borrowing here - | -LL | is_send(&bar()); - | + - -error: aborting due to previous error - diff --git a/tests/ui/async-await/issue-64130-2-send.rs b/tests/ui/async-await/issue-64130-2-send.rs index d6d855bac0762..7a6e5952cb956 100644 --- a/tests/ui/async-await/issue-64130-2-send.rs +++ b/tests/ui/async-await/issue-64130-2-send.rs @@ -1,6 +1,3 @@ -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir #![feature(negative_impls)] // edition:2018 @@ -14,7 +11,7 @@ impl !Send for Foo {} fn is_send(t: T) { } async fn bar() { - let x = Box::new(Foo); + let x = Foo; baz().await; } diff --git a/tests/ui/async-await/issue-64130-2-send.drop_tracking.stderr b/tests/ui/async-await/issue-64130-2-send.stderr similarity index 60% rename from tests/ui/async-await/issue-64130-2-send.drop_tracking.stderr rename to tests/ui/async-await/issue-64130-2-send.stderr index d1717ad3310ab..e71c78d6800e8 100644 --- a/tests/ui/async-await/issue-64130-2-send.drop_tracking.stderr +++ b/tests/ui/async-await/issue-64130-2-send.stderr @@ -1,28 +1,24 @@ error: future cannot be sent between threads safely - --> $DIR/issue-64130-2-send.rs:24:13 + --> $DIR/issue-64130-2-send.rs:21:13 | LL | is_send(bar()); | ^^^^^ future returned by `bar` is not `Send` | - = note: the trait bound `Unique: Send` is not satisfied + = help: within `impl Future`, the trait `Send` is not implemented for `Foo` note: future is not `Send` as this value is used across an await - --> $DIR/issue-64130-2-send.rs:18:11 + --> $DIR/issue-64130-2-send.rs:15:11 | -LL | let x = Box::new(Foo); - | - has type `Box` which is not `Send` +LL | let x = Foo; + | - has type `Foo` which is not `Send` LL | baz().await; | ^^^^^ await occurs here, with `x` maybe used later LL | } | - `x` is later dropped here note: required by a bound in `is_send` - --> $DIR/issue-64130-2-send.rs:14:15 + --> $DIR/issue-64130-2-send.rs:11:15 | LL | fn is_send(t: T) { } | ^^^^ required by this bound in `is_send` -help: consider borrowing here - | -LL | is_send(&bar()); - | + error: aborting due to previous error diff --git a/tests/ui/async-await/issue-64130-3-other.drop_tracking.stderr b/tests/ui/async-await/issue-64130-3-other.drop_tracking.stderr deleted file mode 100644 index b69f06da1cde5..0000000000000 --- a/tests/ui/async-await/issue-64130-3-other.drop_tracking.stderr +++ /dev/null @@ -1,27 +0,0 @@ -error[E0277]: the trait bound `Foo: Qux` is not satisfied in `impl Future` - --> $DIR/issue-64130-3-other.rs:27:12 - | -LL | async fn bar() { - | - within this `impl Future` -... -LL | is_qux(bar()); - | ^^^^^ within `impl Future`, the trait `Qux` is not implemented for `Foo` - | -note: future does not implement `Qux` as this value is used across an await - --> $DIR/issue-64130-3-other.rs:21:11 - | -LL | let x = Box::new(Foo); - | - has type `Box` which does not implement `Qux` -LL | baz().await; - | ^^^^^ await occurs here, with `x` maybe used later -LL | } - | - `x` is later dropped here -note: required by a bound in `is_qux` - --> $DIR/issue-64130-3-other.rs:17:14 - | -LL | fn is_qux(t: T) {} - | ^^^ required by this bound in `is_qux` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/async-await/issue-64130-3-other.drop_tracking_mir.stderr b/tests/ui/async-await/issue-64130-3-other.drop_tracking_mir.stderr deleted file mode 100644 index 1298371241ced..0000000000000 --- a/tests/ui/async-await/issue-64130-3-other.drop_tracking_mir.stderr +++ /dev/null @@ -1,25 +0,0 @@ -error[E0277]: the trait bound `Foo: Qux` is not satisfied in `impl Future` - --> $DIR/issue-64130-3-other.rs:27:12 - | -LL | async fn bar() { - | - within this `impl Future` -... -LL | is_qux(bar()); - | ^^^^^ within `impl Future`, the trait `Qux` is not implemented for `Foo` - | -note: future does not implement `Qux` as this value is used across an await - --> $DIR/issue-64130-3-other.rs:21:11 - | -LL | let x = Box::new(Foo); - | - has type `Box` which does not implement `Qux` -LL | baz().await; - | ^^^^^ await occurs here, with `x` maybe used later -note: required by a bound in `is_qux` - --> $DIR/issue-64130-3-other.rs:17:14 - | -LL | fn is_qux(t: T) {} - | ^^^ required by this bound in `is_qux` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/async-await/issue-64130-3-other.rs b/tests/ui/async-await/issue-64130-3-other.rs index 92d3b7c81fb62..630fb2c41cded 100644 --- a/tests/ui/async-await/issue-64130-3-other.rs +++ b/tests/ui/async-await/issue-64130-3-other.rs @@ -1,6 +1,3 @@ -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir #![feature(auto_traits)] #![feature(negative_impls)] // edition:2018 @@ -17,7 +14,7 @@ impl !Qux for Foo {} fn is_qux(t: T) {} async fn bar() { - let x = Box::new(Foo); + let x = Foo; baz().await; } diff --git a/tests/ui/async-await/issue-64130-3-other.no_drop_tracking.stderr b/tests/ui/async-await/issue-64130-3-other.stderr similarity index 77% rename from tests/ui/async-await/issue-64130-3-other.no_drop_tracking.stderr rename to tests/ui/async-await/issue-64130-3-other.stderr index b69f06da1cde5..4107784395f31 100644 --- a/tests/ui/async-await/issue-64130-3-other.no_drop_tracking.stderr +++ b/tests/ui/async-await/issue-64130-3-other.stderr @@ -1,5 +1,5 @@ error[E0277]: the trait bound `Foo: Qux` is not satisfied in `impl Future` - --> $DIR/issue-64130-3-other.rs:27:12 + --> $DIR/issue-64130-3-other.rs:24:12 | LL | async fn bar() { | - within this `impl Future` @@ -8,16 +8,16 @@ LL | is_qux(bar()); | ^^^^^ within `impl Future`, the trait `Qux` is not implemented for `Foo` | note: future does not implement `Qux` as this value is used across an await - --> $DIR/issue-64130-3-other.rs:21:11 + --> $DIR/issue-64130-3-other.rs:18:11 | -LL | let x = Box::new(Foo); - | - has type `Box` which does not implement `Qux` +LL | let x = Foo; + | - has type `Foo` which does not implement `Qux` LL | baz().await; | ^^^^^ await occurs here, with `x` maybe used later LL | } | - `x` is later dropped here note: required by a bound in `is_qux` - --> $DIR/issue-64130-3-other.rs:17:14 + --> $DIR/issue-64130-3-other.rs:14:14 | LL | fn is_qux(t: T) {} | ^^^ required by this bound in `is_qux` diff --git a/tests/ui/async-await/issue-64130-4-async-move.drop-tracking.stderr b/tests/ui/async-await/issue-64130-4-async-move.drop-tracking.stderr deleted file mode 100644 index 884619f4dd69d..0000000000000 --- a/tests/ui/async-await/issue-64130-4-async-move.drop-tracking.stderr +++ /dev/null @@ -1,26 +0,0 @@ -error: future cannot be sent between threads safely - --> $DIR/issue-64130-4-async-move.rs:20:17 - | -LL | pub fn foo() -> impl Future + Send { - | ^^^^^^^^^^^^^^^^^^ future created by async block is not `Send` - | - = help: the trait `Sync` is not implemented for `(dyn Any + Send + 'static)` -note: future is not `Send` as this value is used across an await - --> $DIR/issue-64130-4-async-move.rs:27:31 - | -LL | match client.status() { - | ------ has type `&Client` which is not `Send` -LL | 200 => { -LL | let _x = get().await; - | ^^^^^^ await occurs here, with `client` maybe used later -... -LL | } - | - `client` is later dropped here -help: consider moving this into a `let` binding to create a shorter lived borrow - --> $DIR/issue-64130-4-async-move.rs:25:15 - | -LL | match client.status() { - | ^^^^^^^^^^^^^^^ - -error: aborting due to previous error - diff --git a/tests/ui/async-await/issue-64130-4-async-move.no_drop_tracking.stderr b/tests/ui/async-await/issue-64130-4-async-move.no_drop_tracking.stderr deleted file mode 100644 index 60b7551ff8ad5..0000000000000 --- a/tests/ui/async-await/issue-64130-4-async-move.no_drop_tracking.stderr +++ /dev/null @@ -1,26 +0,0 @@ -error: future cannot be sent between threads safely - --> $DIR/issue-64130-4-async-move.rs:21:17 - | -LL | pub fn foo() -> impl Future + Send { - | ^^^^^^^^^^^^^^^^^^ future created by async block is not `Send` - | - = help: the trait `Sync` is not implemented for `(dyn Any + Send + 'static)` -note: future is not `Send` as this value is used across an await - --> $DIR/issue-64130-4-async-move.rs:27:23 - | -LL | match client.status() { - | ------ has type `&Client` which is not `Send` -LL | 200 => { -LL | get().await; - | ^^^^^ await occurs here, with `client` maybe used later -... -LL | } - | - `client` is later dropped here -help: consider moving this into a `let` binding to create a shorter lived borrow - --> $DIR/issue-64130-4-async-move.rs:25:15 - | -LL | match client.status() { - | ^^^^^^^^^^^^^^^ - -error: aborting due to previous error - diff --git a/tests/ui/async-await/issue-64130-4-async-move.rs b/tests/ui/async-await/issue-64130-4-async-move.rs index 5d68a808b1769..c333e160ef3d2 100644 --- a/tests/ui/async-await/issue-64130-4-async-move.rs +++ b/tests/ui/async-await/issue-64130-4-async-move.rs @@ -1,9 +1,6 @@ // edition:2018 -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir -// [drop_tracking_mir] check-pass -// [drop_tracking] check-pass +// check-pass +// compile-flags: -Zdrop-tracking=yes use std::any::Any; use std::future::Future; @@ -19,7 +16,6 @@ impl Client { async fn get() {} pub fn foo() -> impl Future + Send { - //[no_drop_tracking]~^ ERROR future cannot be sent between threads safely let client = Client(Box::new(true)); async move { match client.status() { diff --git a/tests/ui/async-await/issue-67252-unnamed-future.drop_tracking.stderr b/tests/ui/async-await/issue-67252-unnamed-future.drop_tracking.stderr deleted file mode 100644 index c4c0c43fc1346..0000000000000 --- a/tests/ui/async-await/issue-67252-unnamed-future.drop_tracking.stderr +++ /dev/null @@ -1,30 +0,0 @@ -error: future cannot be sent between threads safely - --> $DIR/issue-67252-unnamed-future.rs:21:11 - | -LL | spawn(async { - | ___________^ -LL | | let a = std::ptr::null_mut::<()>(); // `*mut ()` is not `Send` -LL | | AFuture.await; -LL | | drop(a); -LL | | }); - | |_____^ future created by async block is not `Send` - | - = help: within `{async block@$DIR/issue-67252-unnamed-future.rs:21:11: 25:6}`, the trait `Send` is not implemented for `*mut ()` -note: future is not `Send` as this value is used across an await - --> $DIR/issue-67252-unnamed-future.rs:23:17 - | -LL | let a = std::ptr::null_mut::<()>(); // `*mut ()` is not `Send` - | - has type `*mut ()` which is not `Send` -LL | AFuture.await; - | ^^^^^ await occurs here, with `a` maybe used later -LL | drop(a); -LL | }); - | - `a` is later dropped here -note: required by a bound in `spawn` - --> $DIR/issue-67252-unnamed-future.rs:9:13 - | -LL | fn spawn(_: T) {} - | ^^^^ required by this bound in `spawn` - -error: aborting due to previous error - diff --git a/tests/ui/async-await/issue-67252-unnamed-future.drop_tracking_mir.stderr b/tests/ui/async-await/issue-67252-unnamed-future.drop_tracking_mir.stderr deleted file mode 100644 index 0c4d8586ca637..0000000000000 --- a/tests/ui/async-await/issue-67252-unnamed-future.drop_tracking_mir.stderr +++ /dev/null @@ -1,22 +0,0 @@ -error: future cannot be sent between threads safely - --> $DIR/issue-67252-unnamed-future.rs:21:5 - | -LL | spawn(async { - | ^^^^^ future created by async block is not `Send` - | - = help: within `{async block@$DIR/issue-67252-unnamed-future.rs:21:11: 25:6}`, the trait `Send` is not implemented for `*mut ()` -note: future is not `Send` as this value is used across an await - --> $DIR/issue-67252-unnamed-future.rs:23:17 - | -LL | let a = std::ptr::null_mut::<()>(); // `*mut ()` is not `Send` - | - has type `*mut ()` which is not `Send` -LL | AFuture.await; - | ^^^^^ await occurs here, with `a` maybe used later -note: required by a bound in `spawn` - --> $DIR/issue-67252-unnamed-future.rs:9:13 - | -LL | fn spawn(_: T) {} - | ^^^^ required by this bound in `spawn` - -error: aborting due to previous error - diff --git a/tests/ui/async-await/issue-67252-unnamed-future.no_drop_tracking.stderr b/tests/ui/async-await/issue-67252-unnamed-future.no_drop_tracking.stderr deleted file mode 100644 index c4c0c43fc1346..0000000000000 --- a/tests/ui/async-await/issue-67252-unnamed-future.no_drop_tracking.stderr +++ /dev/null @@ -1,30 +0,0 @@ -error: future cannot be sent between threads safely - --> $DIR/issue-67252-unnamed-future.rs:21:11 - | -LL | spawn(async { - | ___________^ -LL | | let a = std::ptr::null_mut::<()>(); // `*mut ()` is not `Send` -LL | | AFuture.await; -LL | | drop(a); -LL | | }); - | |_____^ future created by async block is not `Send` - | - = help: within `{async block@$DIR/issue-67252-unnamed-future.rs:21:11: 25:6}`, the trait `Send` is not implemented for `*mut ()` -note: future is not `Send` as this value is used across an await - --> $DIR/issue-67252-unnamed-future.rs:23:17 - | -LL | let a = std::ptr::null_mut::<()>(); // `*mut ()` is not `Send` - | - has type `*mut ()` which is not `Send` -LL | AFuture.await; - | ^^^^^ await occurs here, with `a` maybe used later -LL | drop(a); -LL | }); - | - `a` is later dropped here -note: required by a bound in `spawn` - --> $DIR/issue-67252-unnamed-future.rs:9:13 - | -LL | fn spawn(_: T) {} - | ^^^^ required by this bound in `spawn` - -error: aborting due to previous error - diff --git a/tests/ui/async-await/issue-67252-unnamed-future.rs b/tests/ui/async-await/issue-67252-unnamed-future.rs index bb9ad77cef31d..1a7ff613341ec 100644 --- a/tests/ui/async-await/issue-67252-unnamed-future.rs +++ b/tests/ui/async-await/issue-67252-unnamed-future.rs @@ -1,6 +1,3 @@ -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir // edition:2018 use std::future::Future; use std::pin::Pin; @@ -19,9 +16,8 @@ impl Future for AFuture{ async fn foo() { spawn(async { //~ ERROR future cannot be sent between threads safely - let a = std::ptr::null_mut::<()>(); // `*mut ()` is not `Send` + let _a = std::ptr::null_mut::<()>(); // `*mut ()` is not `Send` AFuture.await; - drop(a); }); } diff --git a/tests/ui/async-await/issue-67252-unnamed-future.stderr b/tests/ui/async-await/issue-67252-unnamed-future.stderr new file mode 100644 index 0000000000000..6aef35de0cac5 --- /dev/null +++ b/tests/ui/async-await/issue-67252-unnamed-future.stderr @@ -0,0 +1,28 @@ +error: future cannot be sent between threads safely + --> $DIR/issue-67252-unnamed-future.rs:18:11 + | +LL | spawn(async { + | ___________^ +LL | | let _a = std::ptr::null_mut::<()>(); // `*mut ()` is not `Send` +LL | | AFuture.await; +LL | | }); + | |_____^ future created by async block is not `Send` + | + = help: within `{async block@$DIR/issue-67252-unnamed-future.rs:18:11: 21:6}`, the trait `Send` is not implemented for `*mut ()` +note: future is not `Send` as this value is used across an await + --> $DIR/issue-67252-unnamed-future.rs:20:17 + | +LL | let _a = std::ptr::null_mut::<()>(); // `*mut ()` is not `Send` + | -- has type `*mut ()` which is not `Send` +LL | AFuture.await; + | ^^^^^ await occurs here, with `_a` maybe used later +LL | }); + | - `_a` is later dropped here +note: required by a bound in `spawn` + --> $DIR/issue-67252-unnamed-future.rs:6:13 + | +LL | fn spawn(_: T) {} + | ^^^^ required by this bound in `spawn` + +error: aborting due to previous error + diff --git a/tests/ui/async-await/issue-68112.drop_tracking.stderr b/tests/ui/async-await/issue-68112.drop_tracking.stderr deleted file mode 100644 index bd648de30672d..0000000000000 --- a/tests/ui/async-await/issue-68112.drop_tracking.stderr +++ /dev/null @@ -1,82 +0,0 @@ -error: future cannot be sent between threads safely - --> $DIR/issue-68112.rs:37:18 - | -LL | require_send(send_fut); - | ^^^^^^^^ future created by async block is not `Send` - | - = help: the trait `Sync` is not implemented for `RefCell` - = note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead -note: future is not `Send` as it awaits another future which is not `Send` - --> $DIR/issue-68112.rs:34:17 - | -LL | let _ = non_send_fut.await; - | ^^^^^^^^^^^^ await occurs here on type `impl Future>>`, which is not `Send` -note: required by a bound in `require_send` - --> $DIR/issue-68112.rs:14:25 - | -LL | fn require_send(_: impl Send) {} - | ^^^^ required by this bound in `require_send` - -error: future cannot be sent between threads safely - --> $DIR/issue-68112.rs:46:18 - | -LL | require_send(send_fut); - | ^^^^^^^^ future created by async block is not `Send` - | - = help: the trait `Sync` is not implemented for `RefCell` - = note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead -note: future is not `Send` as it awaits another future which is not `Send` - --> $DIR/issue-68112.rs:43:17 - | -LL | let _ = make_non_send_future1().await; - | ^^^^^^^^^^^^^^^^^^^^^^^ await occurs here on type `impl Future>>`, which is not `Send` -note: required by a bound in `require_send` - --> $DIR/issue-68112.rs:14:25 - | -LL | fn require_send(_: impl Send) {} - | ^^^^ required by this bound in `require_send` - -error[E0277]: `RefCell` cannot be shared between threads safely - --> $DIR/issue-68112.rs:65:18 - | -LL | require_send(send_fut); - | ------------ ^^^^^^^^ `RefCell` cannot be shared between threads safely - | | - | required by a bound introduced by this call - | - = help: the trait `Sync` is not implemented for `RefCell` - = note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead - = note: required for `Arc>` to implement `Send` -note: required because it's used within this `async fn` body - --> $DIR/issue-68112.rs:50:31 - | -LL | async fn ready2(t: T) -> T { - | _______________________________^ -LL | | t -LL | | } - | |_^ -note: required because it appears within the type `impl Future>>` - --> $DIR/issue-68112.rs:53:31 - | -LL | fn make_non_send_future2() -> impl Future>> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: required because it captures the following types: `ResumeTy`, `impl Future>>`, `()`, `Ready` -note: required because it's used within this `async` block - --> $DIR/issue-68112.rs:60:20 - | -LL | let send_fut = async { - | ____________________^ -LL | | let non_send_fut = make_non_send_future2(); -LL | | let _ = non_send_fut.await; -LL | | ready(0).await; -LL | | }; - | |_____^ -note: required by a bound in `require_send` - --> $DIR/issue-68112.rs:14:25 - | -LL | fn require_send(_: impl Send) {} - | ^^^^ required by this bound in `require_send` - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/async-await/issue-68112.drop_tracking_mir.stderr b/tests/ui/async-await/issue-68112.drop_tracking_mir.stderr deleted file mode 100644 index 7a9242cbaf591..0000000000000 --- a/tests/ui/async-await/issue-68112.drop_tracking_mir.stderr +++ /dev/null @@ -1,80 +0,0 @@ -error: future cannot be sent between threads safely - --> $DIR/issue-68112.rs:37:5 - | -LL | require_send(send_fut); - | ^^^^^^^^^^^^ future created by async block is not `Send` - | - = help: the trait `Sync` is not implemented for `RefCell` - = note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead -note: future is not `Send` as it awaits another future which is not `Send` - --> $DIR/issue-68112.rs:34:17 - | -LL | let _ = non_send_fut.await; - | ^^^^^^^^^^^^ await occurs here on type `impl Future>>`, which is not `Send` -note: required by a bound in `require_send` - --> $DIR/issue-68112.rs:14:25 - | -LL | fn require_send(_: impl Send) {} - | ^^^^ required by this bound in `require_send` - -error: future cannot be sent between threads safely - --> $DIR/issue-68112.rs:46:5 - | -LL | require_send(send_fut); - | ^^^^^^^^^^^^ future created by async block is not `Send` - | - = help: the trait `Sync` is not implemented for `RefCell` - = note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead -note: future is not `Send` as it awaits another future which is not `Send` - --> $DIR/issue-68112.rs:43:17 - | -LL | let _ = make_non_send_future1().await; - | ^^^^^^^^^^^^^^^^^^^^^^^ await occurs here on type `impl Future>>`, which is not `Send` -note: required by a bound in `require_send` - --> $DIR/issue-68112.rs:14:25 - | -LL | fn require_send(_: impl Send) {} - | ^^^^ required by this bound in `require_send` - -error[E0277]: `RefCell` cannot be shared between threads safely - --> $DIR/issue-68112.rs:65:5 - | -LL | require_send(send_fut); - | ^^^^^^^^^^^^ `RefCell` cannot be shared between threads safely - | - = help: the trait `Sync` is not implemented for `RefCell` - = note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead - = note: required for `Arc>` to implement `Send` -note: required because it's used within this `async fn` body - --> $DIR/issue-68112.rs:50:31 - | -LL | async fn ready2(t: T) -> T { - | _______________________________^ -LL | | t -LL | | } - | |_^ -note: required because it appears within the type `impl Future>>` - --> $DIR/issue-68112.rs:53:31 - | -LL | fn make_non_send_future2() -> impl Future>> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: required because it captures the following types: `impl Future>>`, `Ready` -note: required because it's used within this `async` block - --> $DIR/issue-68112.rs:60:20 - | -LL | let send_fut = async { - | ____________________^ -LL | | let non_send_fut = make_non_send_future2(); -LL | | let _ = non_send_fut.await; -LL | | ready(0).await; -LL | | }; - | |_____^ -note: required by a bound in `require_send` - --> $DIR/issue-68112.rs:14:25 - | -LL | fn require_send(_: impl Send) {} - | ^^^^ required by this bound in `require_send` - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/async-await/issue-68112.rs b/tests/ui/async-await/issue-68112.rs index 19119ae0fc127..0005b90efc2ce 100644 --- a/tests/ui/async-await/issue-68112.rs +++ b/tests/ui/async-await/issue-68112.rs @@ -1,7 +1,4 @@ // edition:2018 -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir use std::{ cell::RefCell, @@ -14,7 +11,7 @@ use std::{ fn require_send(_: impl Send) {} struct Ready(Option); -impl Future for Ready { +impl Future for Ready { type Output = T; fn poll(mut self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll { Poll::Ready(self.0.take().unwrap()) diff --git a/tests/ui/async-await/issue-68112.no_drop_tracking.stderr b/tests/ui/async-await/issue-68112.stderr similarity index 90% rename from tests/ui/async-await/issue-68112.no_drop_tracking.stderr rename to tests/ui/async-await/issue-68112.stderr index 35b7341f63a4d..aec2541c9e6c7 100644 --- a/tests/ui/async-await/issue-68112.no_drop_tracking.stderr +++ b/tests/ui/async-await/issue-68112.stderr @@ -1,5 +1,5 @@ error: future cannot be sent between threads safely - --> $DIR/issue-68112.rs:37:18 + --> $DIR/issue-68112.rs:34:18 | LL | require_send(send_fut); | ^^^^^^^^ future created by async block is not `Send` @@ -7,18 +7,18 @@ LL | require_send(send_fut); = help: the trait `Sync` is not implemented for `RefCell` = note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead note: future is not `Send` as it awaits another future which is not `Send` - --> $DIR/issue-68112.rs:34:17 + --> $DIR/issue-68112.rs:31:17 | LL | let _ = non_send_fut.await; | ^^^^^^^^^^^^ await occurs here on type `impl Future>>`, which is not `Send` note: required by a bound in `require_send` - --> $DIR/issue-68112.rs:14:25 + --> $DIR/issue-68112.rs:11:25 | LL | fn require_send(_: impl Send) {} | ^^^^ required by this bound in `require_send` error: future cannot be sent between threads safely - --> $DIR/issue-68112.rs:46:18 + --> $DIR/issue-68112.rs:43:18 | LL | require_send(send_fut); | ^^^^^^^^ future created by async block is not `Send` @@ -26,18 +26,18 @@ LL | require_send(send_fut); = help: the trait `Sync` is not implemented for `RefCell` = note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead note: future is not `Send` as it awaits another future which is not `Send` - --> $DIR/issue-68112.rs:43:17 + --> $DIR/issue-68112.rs:40:17 | LL | let _ = make_non_send_future1().await; | ^^^^^^^^^^^^^^^^^^^^^^^ await occurs here on type `impl Future>>`, which is not `Send` note: required by a bound in `require_send` - --> $DIR/issue-68112.rs:14:25 + --> $DIR/issue-68112.rs:11:25 | LL | fn require_send(_: impl Send) {} | ^^^^ required by this bound in `require_send` error[E0277]: `RefCell` cannot be shared between threads safely - --> $DIR/issue-68112.rs:65:18 + --> $DIR/issue-68112.rs:62:18 | LL | require_send(send_fut); | ------------ ^^^^^^^^ `RefCell` cannot be shared between threads safely @@ -48,7 +48,7 @@ LL | require_send(send_fut); = note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead = note: required for `Arc>` to implement `Send` note: required because it's used within this `async fn` body - --> $DIR/issue-68112.rs:50:31 + --> $DIR/issue-68112.rs:47:31 | LL | async fn ready2(t: T) -> T { | _______________________________^ @@ -56,13 +56,13 @@ LL | | t LL | | } | |_^ note: required because it appears within the type `impl Future>>` - --> $DIR/issue-68112.rs:53:31 + --> $DIR/issue-68112.rs:50:31 | LL | fn make_non_send_future2() -> impl Future>> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: required because it captures the following types: `ResumeTy`, `impl Future>>`, `()`, `i32`, `Ready` note: required because it's used within this `async` block - --> $DIR/issue-68112.rs:60:20 + --> $DIR/issue-68112.rs:57:20 | LL | let send_fut = async { | ____________________^ @@ -72,7 +72,7 @@ LL | | ready(0).await; LL | | }; | |_____^ note: required by a bound in `require_send` - --> $DIR/issue-68112.rs:14:25 + --> $DIR/issue-68112.rs:11:25 | LL | fn require_send(_: impl Send) {} | ^^^^ required by this bound in `require_send` diff --git a/tests/ui/async-await/issue-70818.drop_tracking.stderr b/tests/ui/async-await/issue-70818.drop_tracking.stderr deleted file mode 100644 index ab0698c3ec213..0000000000000 --- a/tests/ui/async-await/issue-70818.drop_tracking.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error: future cannot be sent between threads safely - --> $DIR/issue-70818.rs:7:38 - | -LL | fn foo(ty: T, ty1: U) -> impl Future + Send { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future created by async block is not `Send` - | -note: captured value is not `Send` - --> $DIR/issue-70818.rs:9:18 - | -LL | async { (ty, ty1) } - | ^^^ has type `U` which is not `Send` -help: consider restricting type parameter `U` - | -LL | fn foo(ty: T, ty1: U) -> impl Future + Send { - | +++++++++++++++++++ - -error: aborting due to previous error - diff --git a/tests/ui/async-await/issue-70818.no_drop_tracking.stderr b/tests/ui/async-await/issue-70818.no_drop_tracking.stderr deleted file mode 100644 index ab0698c3ec213..0000000000000 --- a/tests/ui/async-await/issue-70818.no_drop_tracking.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error: future cannot be sent between threads safely - --> $DIR/issue-70818.rs:7:38 - | -LL | fn foo(ty: T, ty1: U) -> impl Future + Send { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future created by async block is not `Send` - | -note: captured value is not `Send` - --> $DIR/issue-70818.rs:9:18 - | -LL | async { (ty, ty1) } - | ^^^ has type `U` which is not `Send` -help: consider restricting type parameter `U` - | -LL | fn foo(ty: T, ty1: U) -> impl Future + Send { - | +++++++++++++++++++ - -error: aborting due to previous error - diff --git a/tests/ui/async-await/issue-70818.rs b/tests/ui/async-await/issue-70818.rs index 2941de0f57714..019c56eb2fa3e 100644 --- a/tests/ui/async-await/issue-70818.rs +++ b/tests/ui/async-await/issue-70818.rs @@ -1,6 +1,3 @@ -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir // edition:2018 use std::future::Future; diff --git a/tests/ui/async-await/issue-70818.drop_tracking_mir.stderr b/tests/ui/async-await/issue-70818.stderr similarity index 90% rename from tests/ui/async-await/issue-70818.drop_tracking_mir.stderr rename to tests/ui/async-await/issue-70818.stderr index ab0698c3ec213..20109d4d1166a 100644 --- a/tests/ui/async-await/issue-70818.drop_tracking_mir.stderr +++ b/tests/ui/async-await/issue-70818.stderr @@ -1,11 +1,11 @@ error: future cannot be sent between threads safely - --> $DIR/issue-70818.rs:7:38 + --> $DIR/issue-70818.rs:4:38 | LL | fn foo(ty: T, ty1: U) -> impl Future + Send { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future created by async block is not `Send` | note: captured value is not `Send` - --> $DIR/issue-70818.rs:9:18 + --> $DIR/issue-70818.rs:6:18 | LL | async { (ty, ty1) } | ^^^ has type `U` which is not `Send` diff --git a/tests/ui/async-await/issue-70935-complex-spans.drop_tracking.stderr b/tests/ui/async-await/issue-70935-complex-spans.drop_tracking.stderr deleted file mode 100644 index f80bb4242aa70..0000000000000 --- a/tests/ui/async-await/issue-70935-complex-spans.drop_tracking.stderr +++ /dev/null @@ -1,41 +0,0 @@ -error[E0277]: `*mut ()` cannot be shared between threads safely - --> $DIR/issue-70935-complex-spans.rs:18:23 - | -LL | fn foo(x: NotSync) -> impl Future + Send { - | ^^^^^^^^^^^^^^^^^^ `*mut ()` cannot be shared between threads safely - | - = help: within `NotSync`, the trait `Sync` is not implemented for `*mut ()` -note: required because it appears within the type `PhantomData<*mut ()>` - --> $SRC_DIR/core/src/marker.rs:LL:COL -note: required because it appears within the type `NotSync` - --> $DIR/issue-70935-complex-spans.rs:12:8 - | -LL | struct NotSync(PhantomData<*mut ()>); - | ^^^^^^^ - = note: required for `&NotSync` to implement `Send` -note: required because it's used within this closure - --> $DIR/issue-70935-complex-spans.rs:22:13 - | -LL | baz(|| async { - | ^^ -note: required because it's used within this `async fn` body - --> $DIR/issue-70935-complex-spans.rs:15:67 - | -LL | async fn baz(_c: impl FnMut() -> T) where T: Future { - | ___________________________________________________________________^ -LL | | } - | |_^ - = note: required because it captures the following types: `ResumeTy`, `impl Future`, `()` -note: required because it's used within this `async` block - --> $DIR/issue-70935-complex-spans.rs:21:5 - | -LL | / async move { -LL | | baz(|| async { -LL | | foo(x.clone()); -LL | | }).await; -LL | | } - | |_____^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/async-await/issue-70935-complex-spans.drop_tracking_mir.stderr b/tests/ui/async-await/issue-70935-complex-spans.drop_tracking_mir.stderr deleted file mode 100644 index eb9d93e229fb5..0000000000000 --- a/tests/ui/async-await/issue-70935-complex-spans.drop_tracking_mir.stderr +++ /dev/null @@ -1,41 +0,0 @@ -error[E0277]: `*mut ()` cannot be shared between threads safely - --> $DIR/issue-70935-complex-spans.rs:18:23 - | -LL | fn foo(x: NotSync) -> impl Future + Send { - | ^^^^^^^^^^^^^^^^^^ `*mut ()` cannot be shared between threads safely - | - = help: within `NotSync`, the trait `Sync` is not implemented for `*mut ()` -note: required because it appears within the type `PhantomData<*mut ()>` - --> $SRC_DIR/core/src/marker.rs:LL:COL -note: required because it appears within the type `NotSync` - --> $DIR/issue-70935-complex-spans.rs:12:8 - | -LL | struct NotSync(PhantomData<*mut ()>); - | ^^^^^^^ - = note: required for `&NotSync` to implement `Send` -note: required because it's used within this closure - --> $DIR/issue-70935-complex-spans.rs:22:13 - | -LL | baz(|| async { - | ^^ -note: required because it's used within this `async fn` body - --> $DIR/issue-70935-complex-spans.rs:15:67 - | -LL | async fn baz(_c: impl FnMut() -> T) where T: Future { - | ___________________________________________________________________^ -LL | | } - | |_^ - = note: required because it captures the following types: `impl Future` -note: required because it's used within this `async` block - --> $DIR/issue-70935-complex-spans.rs:21:5 - | -LL | / async move { -LL | | baz(|| async { -LL | | foo(x.clone()); -LL | | }).await; -LL | | } - | |_____^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/async-await/issue-70935-complex-spans.rs b/tests/ui/async-await/issue-70935-complex-spans.rs index 9ebde1d397733..33aa89c5a5db5 100644 --- a/tests/ui/async-await/issue-70935-complex-spans.rs +++ b/tests/ui/async-await/issue-70935-complex-spans.rs @@ -1,7 +1,4 @@ // edition:2018 -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir // #70935: Check if we do not emit snippet // with newlines which lead complex diagnostics. @@ -16,8 +13,7 @@ async fn baz(_c: impl FnMut() -> T) where T: Future { } fn foo(x: NotSync) -> impl Future + Send { - //[no_drop_tracking]~^ ERROR future cannot be sent between threads safely - //[drop_tracking,drop_tracking_mir]~^^ ERROR `*mut ()` cannot be shared between threads + //~^ ERROR future cannot be sent between threads safely async move { baz(|| async { foo(x.clone()); diff --git a/tests/ui/async-await/issue-70935-complex-spans.no_drop_tracking.stderr b/tests/ui/async-await/issue-70935-complex-spans.stderr similarity index 84% rename from tests/ui/async-await/issue-70935-complex-spans.no_drop_tracking.stderr rename to tests/ui/async-await/issue-70935-complex-spans.stderr index b33aa407f4adf..5d8ef77616a8e 100644 --- a/tests/ui/async-await/issue-70935-complex-spans.no_drop_tracking.stderr +++ b/tests/ui/async-await/issue-70935-complex-spans.stderr @@ -1,12 +1,12 @@ error: future cannot be sent between threads safely - --> $DIR/issue-70935-complex-spans.rs:18:23 + --> $DIR/issue-70935-complex-spans.rs:15:23 | LL | fn foo(x: NotSync) -> impl Future + Send { | ^^^^^^^^^^^^^^^^^^ future created by async block is not `Send` | = help: within `NotSync`, the trait `Sync` is not implemented for `*mut ()` note: future is not `Send` as this value is used across an await - --> $DIR/issue-70935-complex-spans.rs:24:12 + --> $DIR/issue-70935-complex-spans.rs:20:12 | LL | baz(|| async { | _____________- @@ -15,7 +15,7 @@ LL | | }).await; | | - ^^^^^- the value is later dropped here | | | | | |_________| await occurs here, with the value maybe used later - | has type `{closure@$DIR/issue-70935-complex-spans.rs:22:13: 22:15}` which is not `Send` + | has type `{closure@$DIR/issue-70935-complex-spans.rs:18:13: 18:15}` which is not `Send` error: aborting due to previous error diff --git a/tests/ui/async-await/issue-73137.rs b/tests/ui/async-await/issue-73137.rs index dcbe7765a9e1c..c43ce2cadba04 100644 --- a/tests/ui/async-await/issue-73137.rs +++ b/tests/ui/async-await/issue-73137.rs @@ -2,9 +2,6 @@ // run-pass // edition:2018 -// revisions: normal drop-tracking -// [normal]compile-flags: -Zdrop-tracking=no -// [drop-tracking]compile-flags: -Zdrop-tracking #![allow(dead_code)] use std::future::Future; diff --git a/tests/ui/async-await/issue-73741-type-err-drop-tracking.drop_tracking.stderr b/tests/ui/async-await/issue-73741-type-err-drop-tracking.drop_tracking.stderr deleted file mode 100644 index 6d19c3beb2fe1..0000000000000 --- a/tests/ui/async-await/issue-73741-type-err-drop-tracking.drop_tracking.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0070]: invalid left-hand side of assignment - --> $DIR/issue-73741-type-err-drop-tracking.rs:11:7 - | -LL | 1 = 2; - | - ^ - | | - | cannot assign to this expression - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0070`. diff --git a/tests/ui/async-await/issue-73741-type-err-drop-tracking.drop_tracking_mir.stderr b/tests/ui/async-await/issue-73741-type-err-drop-tracking.drop_tracking_mir.stderr deleted file mode 100644 index 6d19c3beb2fe1..0000000000000 --- a/tests/ui/async-await/issue-73741-type-err-drop-tracking.drop_tracking_mir.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0070]: invalid left-hand side of assignment - --> $DIR/issue-73741-type-err-drop-tracking.rs:11:7 - | -LL | 1 = 2; - | - ^ - | | - | cannot assign to this expression - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0070`. diff --git a/tests/ui/async-await/issue-73741-type-err-drop-tracking.no_drop_tracking.stderr b/tests/ui/async-await/issue-73741-type-err-drop-tracking.no_drop_tracking.stderr deleted file mode 100644 index 6d19c3beb2fe1..0000000000000 --- a/tests/ui/async-await/issue-73741-type-err-drop-tracking.no_drop_tracking.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0070]: invalid left-hand side of assignment - --> $DIR/issue-73741-type-err-drop-tracking.rs:11:7 - | -LL | 1 = 2; - | - ^ - | | - | cannot assign to this expression - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0070`. diff --git a/tests/ui/async-await/issue-73741-type-err-drop-tracking.rs b/tests/ui/async-await/issue-73741-type-err-drop-tracking.rs deleted file mode 100644 index 1fa8d69143a22..0000000000000 --- a/tests/ui/async-await/issue-73741-type-err-drop-tracking.rs +++ /dev/null @@ -1,17 +0,0 @@ -// edition:2018 -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir -// -// Regression test for issue #73741 -// Ensures that we don't emit spurious errors when -// a type error ocurrs in an `async fn` - -async fn weird() { - 1 = 2; //~ ERROR invalid left-hand side - - let mut loop_count = 0; - async {}.await -} - -fn main() {} diff --git a/tests/ui/async-await/issue-86507.drop_tracking_mir.stderr b/tests/ui/async-await/issue-86507.drop_tracking_mir.stderr deleted file mode 100644 index 8adc94d9f49ed..0000000000000 --- a/tests/ui/async-await/issue-86507.drop_tracking_mir.stderr +++ /dev/null @@ -1,23 +0,0 @@ -error: future cannot be sent between threads safely - --> $DIR/issue-86507.rs:20:13 - | -LL | / Box::pin( -LL | | async move { -LL | | let x = x; -LL | | } -LL | | ) - | |_____________^ future created by async block is not `Send` - | -note: captured value is not `Send` because `&` references cannot be sent unless their referent is `Sync` - --> $DIR/issue-86507.rs:22:29 - | -LL | let x = x; - | ^ has type `&T` which is not `Send`, because `T` is not `Sync` - = note: required for the cast from `Pin>` to `Pin + Send + 'async_trait)>>` -help: consider further restricting this bound - | -LL | fn bar<'me, 'async_trait, T: Send + std::marker::Sync>(x: &'me T) - | +++++++++++++++++++ - -error: aborting due to previous error - diff --git a/tests/ui/async-await/issue-86507.no_drop_tracking.stderr b/tests/ui/async-await/issue-86507.no_drop_tracking.stderr deleted file mode 100644 index 8adc94d9f49ed..0000000000000 --- a/tests/ui/async-await/issue-86507.no_drop_tracking.stderr +++ /dev/null @@ -1,23 +0,0 @@ -error: future cannot be sent between threads safely - --> $DIR/issue-86507.rs:20:13 - | -LL | / Box::pin( -LL | | async move { -LL | | let x = x; -LL | | } -LL | | ) - | |_____________^ future created by async block is not `Send` - | -note: captured value is not `Send` because `&` references cannot be sent unless their referent is `Sync` - --> $DIR/issue-86507.rs:22:29 - | -LL | let x = x; - | ^ has type `&T` which is not `Send`, because `T` is not `Sync` - = note: required for the cast from `Pin>` to `Pin + Send + 'async_trait)>>` -help: consider further restricting this bound - | -LL | fn bar<'me, 'async_trait, T: Send + std::marker::Sync>(x: &'me T) - | +++++++++++++++++++ - -error: aborting due to previous error - diff --git a/tests/ui/async-await/issue-86507.rs b/tests/ui/async-await/issue-86507.rs index 63c298dbe3dcb..317f0317664b6 100644 --- a/tests/ui/async-await/issue-86507.rs +++ b/tests/ui/async-await/issue-86507.rs @@ -1,6 +1,3 @@ -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir // edition:2018 use ::core::pin::Pin; diff --git a/tests/ui/async-await/issue-86507.drop_tracking.stderr b/tests/ui/async-await/issue-86507.stderr similarity index 86% rename from tests/ui/async-await/issue-86507.drop_tracking.stderr rename to tests/ui/async-await/issue-86507.stderr index 8adc94d9f49ed..d5a3f72cf251f 100644 --- a/tests/ui/async-await/issue-86507.drop_tracking.stderr +++ b/tests/ui/async-await/issue-86507.stderr @@ -1,5 +1,5 @@ error: future cannot be sent between threads safely - --> $DIR/issue-86507.rs:20:13 + --> $DIR/issue-86507.rs:17:13 | LL | / Box::pin( LL | | async move { @@ -9,11 +9,11 @@ LL | | ) | |_____________^ future created by async block is not `Send` | note: captured value is not `Send` because `&` references cannot be sent unless their referent is `Sync` - --> $DIR/issue-86507.rs:22:29 + --> $DIR/issue-86507.rs:19:29 | LL | let x = x; | ^ has type `&T` which is not `Send`, because `T` is not `Sync` - = note: required for the cast from `Pin>` to `Pin + Send + 'async_trait)>>` + = note: required for the cast from `Pin>` to `Pin + Send + 'async_trait)>>` help: consider further restricting this bound | LL | fn bar<'me, 'async_trait, T: Send + std::marker::Sync>(x: &'me T) diff --git a/tests/ui/async-await/issue-93648.rs b/tests/ui/async-await/issue-93648.rs index ec2249ca592b5..4ce3ac1e87460 100644 --- a/tests/ui/async-await/issue-93648.rs +++ b/tests/ui/async-await/issue-93648.rs @@ -1,8 +1,6 @@ -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir // edition:2021 // build-pass +// compile-flags: -Zdrop-tracking fn main() { let _ = async { diff --git a/tests/ui/async-await/issues/auxiliary/issue_67893.rs b/tests/ui/async-await/issues/auxiliary/issue_67893.rs index d5394469806da..387966a5064fa 100644 --- a/tests/ui/async-await/issues/auxiliary/issue_67893.rs +++ b/tests/ui/async-await/issues/auxiliary/issue_67893.rs @@ -1,6 +1,3 @@ -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir // edition:2018 use std::sync::{Arc, Mutex}; diff --git a/tests/ui/async-await/issues/issue-65436-raw-ptr-not-send.no_drop_tracking.stderr b/tests/ui/async-await/issues/issue-65436-raw-ptr-not-send.no_drop_tracking.stderr deleted file mode 100644 index c734de73f651c..0000000000000 --- a/tests/ui/async-await/issues/issue-65436-raw-ptr-not-send.no_drop_tracking.stderr +++ /dev/null @@ -1,32 +0,0 @@ -error: future cannot be sent between threads safely - --> $DIR/issue-65436-raw-ptr-not-send.rs:17:17 - | -LL | assert_send(async { - | _________________^ -LL | | -LL | | bar(Foo(std::ptr::null())).await; -LL | | }) - | |_____^ future created by async block is not `Send` - | - = help: within `{async block@$DIR/issue-65436-raw-ptr-not-send.rs:17:17: 20:6}`, the trait `Send` is not implemented for `*const u8` -note: future is not `Send` as this value is used across an await - --> $DIR/issue-65436-raw-ptr-not-send.rs:19:36 - | -LL | bar(Foo(std::ptr::null())).await; - | ---------------- ^^^^^- `std::ptr::null()` is later dropped here - | | | - | | await occurs here, with `std::ptr::null()` maybe used later - | has type `*const u8` which is not `Send` -help: consider moving this into a `let` binding to create a shorter lived borrow - --> $DIR/issue-65436-raw-ptr-not-send.rs:19:13 - | -LL | bar(Foo(std::ptr::null())).await; - | ^^^^^^^^^^^^^^^^^^^^^ -note: required by a bound in `assert_send` - --> $DIR/issue-65436-raw-ptr-not-send.rs:14:19 - | -LL | fn assert_send(_: T) {} - | ^^^^ required by this bound in `assert_send` - -error: aborting due to previous error - diff --git a/tests/ui/async-await/issues/issue-65436-raw-ptr-not-send.rs b/tests/ui/async-await/issues/issue-65436-raw-ptr-not-send.rs index d7ef929517c74..a6a45bea897e3 100644 --- a/tests/ui/async-await/issues/issue-65436-raw-ptr-not-send.rs +++ b/tests/ui/async-await/issues/issue-65436-raw-ptr-not-send.rs @@ -1,9 +1,6 @@ // edition:2018 -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir -// [drop_tracking] check-pass -// [drop_tracking_mir] check-pass +// check-pass +// compile-flags: -Zdrop-tracking=yes struct Foo(*const u8); @@ -15,7 +12,6 @@ fn assert_send(_: T) {} fn main() { assert_send(async { - //[no_drop_tracking]~^ ERROR future cannot be sent between threads safely bar(Foo(std::ptr::null())).await; }) } diff --git a/tests/ui/async-await/issues/issue-67611-static-mut-refs.rs b/tests/ui/async-await/issues/issue-67611-static-mut-refs.rs index 80d824d3b2ee6..caed762691e4d 100644 --- a/tests/ui/async-await/issues/issue-67611-static-mut-refs.rs +++ b/tests/ui/async-await/issues/issue-67611-static-mut-refs.rs @@ -1,10 +1,6 @@ // build-pass // edition:2018 -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir - #![feature(if_let_guard)] static mut A: [i32; 5] = [1, 2, 3, 4, 5]; diff --git a/tests/ui/async-await/issues/issue-67893.stderr b/tests/ui/async-await/issues/issue-67893.stderr index c941b9eeb29ac..e1bea29e9230b 100644 --- a/tests/ui/async-await/issues/issue-67893.stderr +++ b/tests/ui/async-await/issues/issue-67893.stderr @@ -6,7 +6,7 @@ LL | g(issue_67893::run()) | = help: within `impl Future`, the trait `Send` is not implemented for `MutexGuard<'_, ()>` note: future is not `Send` as this value is used across an await - --> $DIR/auxiliary/issue_67893.rs:12:27 + --> $DIR/auxiliary/issue_67893.rs:9:27 | LL | f(*x.lock().unwrap()).await; | ----------------- ^^^^^- `x.lock().unwrap()` is later dropped here diff --git a/tests/ui/async-await/mutually-recursive-async-impl-trait-type.drop_tracking.stderr b/tests/ui/async-await/mutually-recursive-async-impl-trait-type.drop_tracking.stderr deleted file mode 100644 index 8a7317bb95a70..0000000000000 --- a/tests/ui/async-await/mutually-recursive-async-impl-trait-type.drop_tracking.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0733]: recursion in an `async fn` requires boxing - --> $DIR/mutually-recursive-async-impl-trait-type.rs:9:18 - | -LL | async fn rec_1() { - | ^ recursive `async fn` - | - = note: a recursive `async fn` must be rewritten to return a boxed `dyn Future` - = note: consider using the `async_recursion` crate: https://crates.io/crates/async_recursion - -error[E0733]: recursion in an `async fn` requires boxing - --> $DIR/mutually-recursive-async-impl-trait-type.rs:13:18 - | -LL | async fn rec_2() { - | ^ recursive `async fn` - | - = note: a recursive `async fn` must be rewritten to return a boxed `dyn Future` - = note: consider using the `async_recursion` crate: https://crates.io/crates/async_recursion - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0733`. diff --git a/tests/ui/async-await/mutually-recursive-async-impl-trait-type.no_drop_tracking.stderr b/tests/ui/async-await/mutually-recursive-async-impl-trait-type.no_drop_tracking.stderr deleted file mode 100644 index 8a7317bb95a70..0000000000000 --- a/tests/ui/async-await/mutually-recursive-async-impl-trait-type.no_drop_tracking.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0733]: recursion in an `async fn` requires boxing - --> $DIR/mutually-recursive-async-impl-trait-type.rs:9:18 - | -LL | async fn rec_1() { - | ^ recursive `async fn` - | - = note: a recursive `async fn` must be rewritten to return a boxed `dyn Future` - = note: consider using the `async_recursion` crate: https://crates.io/crates/async_recursion - -error[E0733]: recursion in an `async fn` requires boxing - --> $DIR/mutually-recursive-async-impl-trait-type.rs:13:18 - | -LL | async fn rec_2() { - | ^ recursive `async fn` - | - = note: a recursive `async fn` must be rewritten to return a boxed `dyn Future` - = note: consider using the `async_recursion` crate: https://crates.io/crates/async_recursion - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0733`. diff --git a/tests/ui/async-await/mutually-recursive-async-impl-trait-type.rs b/tests/ui/async-await/mutually-recursive-async-impl-trait-type.rs index a241f30e73e6e..bb2a61f03ce1f 100644 --- a/tests/ui/async-await/mutually-recursive-async-impl-trait-type.rs +++ b/tests/ui/async-await/mutually-recursive-async-impl-trait-type.rs @@ -1,7 +1,3 @@ -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir - // edition:2018 // Test that impl trait does not allow creating recursive types that are // otherwise forbidden when using `async` and `await`. diff --git a/tests/ui/async-await/mutually-recursive-async-impl-trait-type.drop_tracking_mir.stderr b/tests/ui/async-await/mutually-recursive-async-impl-trait-type.stderr similarity index 92% rename from tests/ui/async-await/mutually-recursive-async-impl-trait-type.drop_tracking_mir.stderr rename to tests/ui/async-await/mutually-recursive-async-impl-trait-type.stderr index 8a7317bb95a70..f789ad2a05c7d 100644 --- a/tests/ui/async-await/mutually-recursive-async-impl-trait-type.drop_tracking_mir.stderr +++ b/tests/ui/async-await/mutually-recursive-async-impl-trait-type.stderr @@ -1,5 +1,5 @@ error[E0733]: recursion in an `async fn` requires boxing - --> $DIR/mutually-recursive-async-impl-trait-type.rs:9:18 + --> $DIR/mutually-recursive-async-impl-trait-type.rs:5:18 | LL | async fn rec_1() { | ^ recursive `async fn` @@ -8,7 +8,7 @@ LL | async fn rec_1() { = note: consider using the `async_recursion` crate: https://crates.io/crates/async_recursion error[E0733]: recursion in an `async fn` requires boxing - --> $DIR/mutually-recursive-async-impl-trait-type.rs:13:18 + --> $DIR/mutually-recursive-async-impl-trait-type.rs:9:18 | LL | async fn rec_2() { | ^ recursive `async fn` diff --git a/tests/ui/async-await/non-trivial-drop.rs b/tests/ui/async-await/non-trivial-drop.rs index 258da0756de31..214e345783b3d 100644 --- a/tests/ui/async-await/non-trivial-drop.rs +++ b/tests/ui/async-await/non-trivial-drop.rs @@ -1,8 +1,6 @@ -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir // build-pass // edition:2018 +// compile-flags: -Zdrop-tracking=y #![feature(generators)] diff --git a/tests/ui/async-await/partial-drop-partial-reinit.drop_tracking.stderr b/tests/ui/async-await/partial-drop-partial-reinit.drop_tracking.stderr deleted file mode 100644 index 17b4ef7bdc671..0000000000000 --- a/tests/ui/async-await/partial-drop-partial-reinit.drop_tracking.stderr +++ /dev/null @@ -1,35 +0,0 @@ -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` - | - = help: within `impl Future`, 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` -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: 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/tests/ui/async-await/partial-drop-partial-reinit.rs b/tests/ui/async-await/partial-drop-partial-reinit.rs index 7d097e72fb49d..75acb442e7a33 100644 --- a/tests/ui/async-await/partial-drop-partial-reinit.rs +++ b/tests/ui/async-await/partial-drop-partial-reinit.rs @@ -1,7 +1,4 @@ // 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)] diff --git a/tests/ui/async-await/partial-drop-partial-reinit.no_drop_tracking.stderr b/tests/ui/async-await/partial-drop-partial-reinit.stderr similarity index 88% rename from tests/ui/async-await/partial-drop-partial-reinit.no_drop_tracking.stderr rename to tests/ui/async-await/partial-drop-partial-reinit.stderr index 34d8a159f1064..05f5358340a98 100644 --- a/tests/ui/async-await/partial-drop-partial-reinit.no_drop_tracking.stderr +++ b/tests/ui/async-await/partial-drop-partial-reinit.stderr @@ -1,5 +1,5 @@ error[E0277]: `NotSend` cannot be sent between threads safely - --> $DIR/partial-drop-partial-reinit.rs:9:16 + --> $DIR/partial-drop-partial-reinit.rs:6: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`, `()` note: required because it's used within this `async fn` body - --> $DIR/partial-drop-partial-reinit.rs:31:16 + --> $DIR/partial-drop-partial-reinit.rs:28: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:17:18 + --> $DIR/partial-drop-partial-reinit.rs:14:18 | LL | fn gimme_send(t: T) { | ^^^^ required by this bound in `gimme_send` diff --git a/tests/ui/async-await/recursive-async-impl-trait-type.drop_tracking.stderr b/tests/ui/async-await/recursive-async-impl-trait-type.drop_tracking.stderr deleted file mode 100644 index 7e63a8da55255..0000000000000 --- a/tests/ui/async-await/recursive-async-impl-trait-type.drop_tracking.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0733]: recursion in an `async fn` requires boxing - --> $DIR/recursive-async-impl-trait-type.rs:8:40 - | -LL | async fn recursive_async_function() -> () { - | ^^ recursive `async fn` - | - = note: a recursive `async fn` must be rewritten to return a boxed `dyn Future` - = note: consider using the `async_recursion` crate: https://crates.io/crates/async_recursion - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0733`. diff --git a/tests/ui/async-await/recursive-async-impl-trait-type.no_drop_tracking.stderr b/tests/ui/async-await/recursive-async-impl-trait-type.no_drop_tracking.stderr deleted file mode 100644 index 7e63a8da55255..0000000000000 --- a/tests/ui/async-await/recursive-async-impl-trait-type.no_drop_tracking.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0733]: recursion in an `async fn` requires boxing - --> $DIR/recursive-async-impl-trait-type.rs:8:40 - | -LL | async fn recursive_async_function() -> () { - | ^^ recursive `async fn` - | - = note: a recursive `async fn` must be rewritten to return a boxed `dyn Future` - = note: consider using the `async_recursion` crate: https://crates.io/crates/async_recursion - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0733`. diff --git a/tests/ui/async-await/recursive-async-impl-trait-type.rs b/tests/ui/async-await/recursive-async-impl-trait-type.rs index 60b34d3a17415..edc4cb8ac5df3 100644 --- a/tests/ui/async-await/recursive-async-impl-trait-type.rs +++ b/tests/ui/async-await/recursive-async-impl-trait-type.rs @@ -1,6 +1,3 @@ -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir // edition:2018 // Test that impl trait does not allow creating recursive types that are // otherwise forbidden when using `async` and `await`. diff --git a/tests/ui/async-await/recursive-async-impl-trait-type.drop_tracking_mir.stderr b/tests/ui/async-await/recursive-async-impl-trait-type.stderr similarity index 90% rename from tests/ui/async-await/recursive-async-impl-trait-type.drop_tracking_mir.stderr rename to tests/ui/async-await/recursive-async-impl-trait-type.stderr index 7e63a8da55255..63f64f4455749 100644 --- a/tests/ui/async-await/recursive-async-impl-trait-type.drop_tracking_mir.stderr +++ b/tests/ui/async-await/recursive-async-impl-trait-type.stderr @@ -1,5 +1,5 @@ error[E0733]: recursion in an `async fn` requires boxing - --> $DIR/recursive-async-impl-trait-type.rs:8:40 + --> $DIR/recursive-async-impl-trait-type.rs:5:40 | LL | async fn recursive_async_function() -> () { | ^^ recursive `async fn` diff --git a/tests/ui/async-await/unresolved_type_param.drop_tracking_mir.stderr b/tests/ui/async-await/unresolved_type_param.drop_tracking_mir.stderr deleted file mode 100644 index 95c799468314f..0000000000000 --- a/tests/ui/async-await/unresolved_type_param.drop_tracking_mir.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0282]: type annotations needed - --> $DIR/unresolved_type_param.rs:12:5 - | -LL | bar().await; - | ^^^ cannot infer type of the type parameter `T` declared on the function `bar` - | -help: consider specifying the generic argument - | -LL | bar::().await; - | +++++ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0282`. diff --git a/tests/ui/async-await/unresolved_type_param.no_drop_tracking.stderr b/tests/ui/async-await/unresolved_type_param.no_drop_tracking.stderr deleted file mode 100644 index 6642e90acd861..0000000000000 --- a/tests/ui/async-await/unresolved_type_param.no_drop_tracking.stderr +++ /dev/null @@ -1,63 +0,0 @@ -error[E0698]: type inside `async fn` body must be known in this context - --> $DIR/unresolved_type_param.rs:12:5 - | -LL | bar().await; - | ^^^ cannot infer type for type parameter `T` declared on the function `bar` - | -note: the type is part of the `async fn` body because of this `await` - --> $DIR/unresolved_type_param.rs:12:11 - | -LL | bar().await; - | ^^^^^ - -error[E0698]: type inside `async fn` body must be known in this context - --> $DIR/unresolved_type_param.rs:12:5 - | -LL | bar().await; - | ^^^ cannot infer type for type parameter `T` declared on the function `bar` - | -note: the type is part of the `async fn` body because of this `await` - --> $DIR/unresolved_type_param.rs:12:11 - | -LL | bar().await; - | ^^^^^ - -error[E0698]: type inside `async fn` body must be known in this context - --> $DIR/unresolved_type_param.rs:12:5 - | -LL | bar().await; - | ^^^ cannot infer type for type parameter `T` declared on the function `bar` - | -note: the type is part of the `async fn` body because of this `await` - --> $DIR/unresolved_type_param.rs:12:11 - | -LL | bar().await; - | ^^^^^ - -error[E0698]: type inside `async fn` body must be known in this context - --> $DIR/unresolved_type_param.rs:12:5 - | -LL | bar().await; - | ^^^ cannot infer type for type parameter `T` declared on the function `bar` - | -note: the type is part of the `async fn` body because of this `await` - --> $DIR/unresolved_type_param.rs:12:11 - | -LL | bar().await; - | ^^^^^ - -error[E0698]: type inside `async fn` body must be known in this context - --> $DIR/unresolved_type_param.rs:12:5 - | -LL | bar().await; - | ^^^ cannot infer type for type parameter `T` declared on the function `bar` - | -note: the type is part of the `async fn` body because of this `await` - --> $DIR/unresolved_type_param.rs:12:11 - | -LL | bar().await; - | ^^^^^ - -error: aborting due to 5 previous errors - -For more information about this error, try `rustc --explain E0698`. diff --git a/tests/ui/async-await/unresolved_type_param.rs b/tests/ui/async-await/unresolved_type_param.rs index ca0a92b943473..6d6d806149104 100644 --- a/tests/ui/async-await/unresolved_type_param.rs +++ b/tests/ui/async-await/unresolved_type_param.rs @@ -1,36 +1,24 @@ -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir // Provoke an unresolved type error (T). // Error message should pinpoint the type parameter T as needing to be bound // (rather than give a general error message) // edition:2018 +// compile-flags: -Zdrop-tracking async fn bar() -> () {} async fn foo() { bar().await; - //[drop_tracking_mir]~^ ERROR type annotations needed - //[drop_tracking_mir]~| NOTE cannot infer type of the type parameter `T` - //[no_drop_tracking,drop_tracking]~^^^ ERROR type inside `async fn` body must be known in this context - //[no_drop_tracking,drop_tracking]~| ERROR type inside `async fn` body must be known in this context - //[no_drop_tracking,drop_tracking]~| ERROR type inside `async fn` body must be known in this context - //[no_drop_tracking,drop_tracking]~| NOTE cannot infer type for type parameter `T` - //[no_drop_tracking,drop_tracking]~| NOTE cannot infer type for type parameter `T` - //[no_drop_tracking,drop_tracking]~| NOTE cannot infer type for type parameter `T` - //[no_drop_tracking,drop_tracking]~| NOTE the type is part of the `async fn` body because of this `await` - //[no_drop_tracking,drop_tracking]~| NOTE the type is part of the `async fn` body because of this `await` - //[no_drop_tracking,drop_tracking]~| NOTE the type is part of the `async fn` body because of this `await` - //[no_drop_tracking,drop_tracking]~| NOTE in this expansion of desugaring of `await` - //[no_drop_tracking,drop_tracking]~| NOTE in this expansion of desugaring of `await` - //[no_drop_tracking,drop_tracking]~| NOTE in this expansion of desugaring of `await` - //[no_drop_tracking]~^^^^^^^^^^^^^^^ ERROR type inside `async fn` body must be known in this context - //[no_drop_tracking]~| ERROR type inside `async fn` body must be known in this context - //[no_drop_tracking]~| NOTE cannot infer type for type parameter `T` - //[no_drop_tracking]~| NOTE cannot infer type for type parameter `T` - //[no_drop_tracking]~| NOTE the type is part of the `async fn` body because of this `await` - //[no_drop_tracking]~| NOTE the type is part of the `async fn` body because of this `await` - //[no_drop_tracking]~| NOTE in this expansion of desugaring of `await` - //[no_drop_tracking]~| NOTE in this expansion of desugaring of `await` + //~^ ERROR type inside `async fn` body must be known in this context + //~| ERROR type inside `async fn` body must be known in this context + //~| ERROR type inside `async fn` body must be known in this context + //~| NOTE cannot infer type for type parameter `T` + //~| NOTE cannot infer type for type parameter `T` + //~| NOTE cannot infer type for type parameter `T` + //~| NOTE the type is part of the `async fn` body because of this `await` + //~| NOTE the type is part of the `async fn` body because of this `await` + //~| NOTE the type is part of the `async fn` body because of this `await` + //~| NOTE in this expansion of desugaring of `await` + //~| NOTE in this expansion of desugaring of `await` + //~| NOTE in this expansion of desugaring of `await` } fn main() {} diff --git a/tests/ui/async-await/unresolved_type_param.drop_tracking.stderr b/tests/ui/async-await/unresolved_type_param.stderr similarity index 80% rename from tests/ui/async-await/unresolved_type_param.drop_tracking.stderr rename to tests/ui/async-await/unresolved_type_param.stderr index 6b4a3a36395f8..ea78c2818c7fe 100644 --- a/tests/ui/async-await/unresolved_type_param.drop_tracking.stderr +++ b/tests/ui/async-await/unresolved_type_param.stderr @@ -1,35 +1,35 @@ error[E0698]: type inside `async fn` body must be known in this context - --> $DIR/unresolved_type_param.rs:12:5 + --> $DIR/unresolved_type_param.rs:10:5 | LL | bar().await; | ^^^ cannot infer type for type parameter `T` declared on the function `bar` | note: the type is part of the `async fn` body because of this `await` - --> $DIR/unresolved_type_param.rs:12:11 + --> $DIR/unresolved_type_param.rs:10:11 | LL | bar().await; | ^^^^^ error[E0698]: type inside `async fn` body must be known in this context - --> $DIR/unresolved_type_param.rs:12:5 + --> $DIR/unresolved_type_param.rs:10:5 | LL | bar().await; | ^^^ cannot infer type for type parameter `T` declared on the function `bar` | note: the type is part of the `async fn` body because of this `await` - --> $DIR/unresolved_type_param.rs:12:11 + --> $DIR/unresolved_type_param.rs:10:11 | LL | bar().await; | ^^^^^ error[E0698]: type inside `async fn` body must be known in this context - --> $DIR/unresolved_type_param.rs:12:5 + --> $DIR/unresolved_type_param.rs:10:5 | LL | bar().await; | ^^^ cannot infer type for type parameter `T` declared on the function `bar` | note: the type is part of the `async fn` body because of this `await` - --> $DIR/unresolved_type_param.rs:12:11 + --> $DIR/unresolved_type_param.rs:10:11 | LL | bar().await; | ^^^^^ diff --git a/tests/ui/async-await/unsized-across-await.no_drop_tracking.stderr b/tests/ui/async-await/unsized-across-await.no_drop_tracking.stderr deleted file mode 100644 index c606df8e0313a..0000000000000 --- a/tests/ui/async-await/unsized-across-await.no_drop_tracking.stderr +++ /dev/null @@ -1,21 +0,0 @@ -warning: the feature `unsized_locals` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/unsized-across-await.rs:5:12 - | -LL | #![feature(unsized_locals)] - | ^^^^^^^^^^^^^^ - | - = note: see issue #48055 for more information - = note: `#[warn(incomplete_features)]` on by default - -error[E0277]: the size for values of type `dyn std::fmt::Display` cannot be known at compilation time - --> $DIR/unsized-across-await.rs:11:9 - | -LL | let _x = *x; - | ^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `dyn std::fmt::Display` - = note: all values live across `await` must have a statically known size - -error: aborting due to previous error; 1 warning emitted - -For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/async-await/unsized-across-await.rs b/tests/ui/async-await/unsized-across-await.rs index 9934e9db6d234..32cb4f88eaef6 100644 --- a/tests/ui/async-await/unsized-across-await.rs +++ b/tests/ui/async-await/unsized-across-await.rs @@ -1,6 +1,4 @@ // edition: 2021 -// revisions: no_drop_tracking drop_tracking_mir -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir #![feature(unsized_locals)] //~^ WARN the feature `unsized_locals` is incomplete diff --git a/tests/ui/async-await/unsized-across-await.drop_tracking_mir.stderr b/tests/ui/async-await/unsized-across-await.stderr similarity index 91% rename from tests/ui/async-await/unsized-across-await.drop_tracking_mir.stderr rename to tests/ui/async-await/unsized-across-await.stderr index c606df8e0313a..649b12ce5a5bb 100644 --- a/tests/ui/async-await/unsized-across-await.drop_tracking_mir.stderr +++ b/tests/ui/async-await/unsized-across-await.stderr @@ -1,5 +1,5 @@ warning: the feature `unsized_locals` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/unsized-across-await.rs:5:12 + --> $DIR/unsized-across-await.rs:3:12 | LL | #![feature(unsized_locals)] | ^^^^^^^^^^^^^^ @@ -8,7 +8,7 @@ LL | #![feature(unsized_locals)] = note: `#[warn(incomplete_features)]` on by default error[E0277]: the size for values of type `dyn std::fmt::Display` cannot be known at compilation time - --> $DIR/unsized-across-await.rs:11:9 + --> $DIR/unsized-across-await.rs:9:9 | LL | let _x = *x; | ^^ doesn't have a size known at compile-time diff --git a/tests/ui/generator/addassign-yield.rs b/tests/ui/generator/addassign-yield.rs index 7211367afeee6..66f22bf31fc40 100644 --- a/tests/ui/generator/addassign-yield.rs +++ b/tests/ui/generator/addassign-yield.rs @@ -1,6 +1,3 @@ -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir // run-pass // Regression test for broken MIR error (#61442) // Due to the two possible evaluation orders for diff --git a/tests/ui/generator/auto-trait-regions.drop_tracking.stderr b/tests/ui/generator/auto-trait-regions.drop_tracking.stderr deleted file mode 100644 index b2a5b92ed0f97..0000000000000 --- a/tests/ui/generator/auto-trait-regions.drop_tracking.stderr +++ /dev/null @@ -1,55 +0,0 @@ -error[E0716]: temporary value dropped while borrowed - --> $DIR/auto-trait-regions.rs:48:24 - | -LL | let a = A(&mut true, &mut true, No); - | ^^^^ - temporary value is freed at the end of this statement - | | - | creates a temporary value which is freed while still in use -... -LL | assert_foo(a); - | - borrow later used here - | -help: consider using a `let` binding to create a longer lived value - | -LL ~ let binding = true; -LL ~ let a = A(&mut binding, &mut true, No); - | - -error[E0716]: temporary value dropped while borrowed - --> $DIR/auto-trait-regions.rs:48:35 - | -LL | let a = A(&mut true, &mut true, No); - | ^^^^ - temporary value is freed at the end of this statement - | | - | creates a temporary value which is freed while still in use -... -LL | assert_foo(a); - | - borrow later used here - | -help: consider using a `let` binding to create a longer lived value - | -LL ~ let binding = true; -LL ~ let a = A(&mut true, &mut binding, No); - | - -error: implementation of `Foo` is not general enough - --> $DIR/auto-trait-regions.rs:34:5 - | -LL | assert_foo(gen); - | ^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough - | - = note: `&'0 OnlyFooIfStaticRef` must implement `Foo`, for any lifetime `'0`... - = note: ...but `Foo` is actually implemented for the type `&'static OnlyFooIfStaticRef` - -error: implementation of `Foo` is not general enough - --> $DIR/auto-trait-regions.rs:54:5 - | -LL | assert_foo(gen); - | ^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough - | - = note: `Foo` would have to be implemented for the type `A<'0, '1>`, for any two lifetimes `'0` and `'1`... - = note: ...but `Foo` is actually implemented for the type `A<'_, '2>`, for some specific lifetime `'2` - -error: aborting due to 4 previous errors - -For more information about this error, try `rustc --explain E0716`. diff --git a/tests/ui/generator/auto-trait-regions.no_drop_tracking.stderr b/tests/ui/generator/auto-trait-regions.no_drop_tracking.stderr deleted file mode 100644 index b2a5b92ed0f97..0000000000000 --- a/tests/ui/generator/auto-trait-regions.no_drop_tracking.stderr +++ /dev/null @@ -1,55 +0,0 @@ -error[E0716]: temporary value dropped while borrowed - --> $DIR/auto-trait-regions.rs:48:24 - | -LL | let a = A(&mut true, &mut true, No); - | ^^^^ - temporary value is freed at the end of this statement - | | - | creates a temporary value which is freed while still in use -... -LL | assert_foo(a); - | - borrow later used here - | -help: consider using a `let` binding to create a longer lived value - | -LL ~ let binding = true; -LL ~ let a = A(&mut binding, &mut true, No); - | - -error[E0716]: temporary value dropped while borrowed - --> $DIR/auto-trait-regions.rs:48:35 - | -LL | let a = A(&mut true, &mut true, No); - | ^^^^ - temporary value is freed at the end of this statement - | | - | creates a temporary value which is freed while still in use -... -LL | assert_foo(a); - | - borrow later used here - | -help: consider using a `let` binding to create a longer lived value - | -LL ~ let binding = true; -LL ~ let a = A(&mut true, &mut binding, No); - | - -error: implementation of `Foo` is not general enough - --> $DIR/auto-trait-regions.rs:34:5 - | -LL | assert_foo(gen); - | ^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough - | - = note: `&'0 OnlyFooIfStaticRef` must implement `Foo`, for any lifetime `'0`... - = note: ...but `Foo` is actually implemented for the type `&'static OnlyFooIfStaticRef` - -error: implementation of `Foo` is not general enough - --> $DIR/auto-trait-regions.rs:54:5 - | -LL | assert_foo(gen); - | ^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough - | - = note: `Foo` would have to be implemented for the type `A<'0, '1>`, for any two lifetimes `'0` and `'1`... - = note: ...but `Foo` is actually implemented for the type `A<'_, '2>`, for some specific lifetime `'2` - -error: aborting due to 4 previous errors - -For more information about this error, try `rustc --explain E0716`. diff --git a/tests/ui/generator/auto-trait-regions.rs b/tests/ui/generator/auto-trait-regions.rs index 350f3cc34ce52..aa4218e13a46b 100644 --- a/tests/ui/generator/auto-trait-regions.rs +++ b/tests/ui/generator/auto-trait-regions.rs @@ -1,6 +1,3 @@ -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir #![feature(generators)] #![feature(auto_traits)] #![feature(negative_impls)] diff --git a/tests/ui/generator/auto-trait-regions.drop_tracking_mir.stderr b/tests/ui/generator/auto-trait-regions.stderr similarity index 92% rename from tests/ui/generator/auto-trait-regions.drop_tracking_mir.stderr rename to tests/ui/generator/auto-trait-regions.stderr index b2a5b92ed0f97..a9a0bde2ba019 100644 --- a/tests/ui/generator/auto-trait-regions.drop_tracking_mir.stderr +++ b/tests/ui/generator/auto-trait-regions.stderr @@ -1,5 +1,5 @@ error[E0716]: temporary value dropped while borrowed - --> $DIR/auto-trait-regions.rs:48:24 + --> $DIR/auto-trait-regions.rs:45:24 | LL | let a = A(&mut true, &mut true, No); | ^^^^ - temporary value is freed at the end of this statement @@ -16,7 +16,7 @@ LL ~ let a = A(&mut binding, &mut true, No); | error[E0716]: temporary value dropped while borrowed - --> $DIR/auto-trait-regions.rs:48:35 + --> $DIR/auto-trait-regions.rs:45:35 | LL | let a = A(&mut true, &mut true, No); | ^^^^ - temporary value is freed at the end of this statement @@ -33,7 +33,7 @@ LL ~ let a = A(&mut true, &mut binding, No); | error: implementation of `Foo` is not general enough - --> $DIR/auto-trait-regions.rs:34:5 + --> $DIR/auto-trait-regions.rs:31:5 | LL | assert_foo(gen); | ^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough @@ -42,7 +42,7 @@ LL | assert_foo(gen); = note: ...but `Foo` is actually implemented for the type `&'static OnlyFooIfStaticRef` error: implementation of `Foo` is not general enough - --> $DIR/auto-trait-regions.rs:54:5 + --> $DIR/auto-trait-regions.rs:51:5 | LL | assert_foo(gen); | ^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough diff --git a/tests/ui/generator/borrowing.drop_tracking_mir.stderr b/tests/ui/generator/borrowing.drop_tracking_mir.stderr deleted file mode 100644 index 8fbad276db441..0000000000000 --- a/tests/ui/generator/borrowing.drop_tracking_mir.stderr +++ /dev/null @@ -1,39 +0,0 @@ -error[E0597]: `a` does not live long enough - --> $DIR/borrowing.rs:13:33 - | -LL | Pin::new(&mut || yield &a).resume(()) - | ----------^ - | | | - | | borrowed value does not live long enough - | value captured here by generator - | a temporary with access to the borrow is created here ... -LL | -LL | }; - | -- ... and the borrow might be used here, when that temporary is dropped and runs the destructor for generator - | | - | `a` dropped here while still borrowed - | - = note: the temporary is part of an expression at the end of a block; - consider forcing this temporary to be dropped sooner, before the block's local variables are dropped -help: for example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block - | -LL | let x = Pin::new(&mut || yield &a).resume(()); x - | +++++++ +++ - -error[E0597]: `a` does not live long enough - --> $DIR/borrowing.rs:20:20 - | -LL | let _b = { - | -- borrow later stored here -LL | let a = 3; -LL | || { - | -- value captured here by generator -LL | yield &a - | ^ borrowed value does not live long enough -... -LL | }; - | - `a` dropped here while still borrowed - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0597`. diff --git a/tests/ui/generator/borrowing.no_drop_tracking.stderr b/tests/ui/generator/borrowing.no_drop_tracking.stderr deleted file mode 100644 index 96e3c327f8b31..0000000000000 --- a/tests/ui/generator/borrowing.no_drop_tracking.stderr +++ /dev/null @@ -1,31 +0,0 @@ -error[E0597]: `a` does not live long enough - --> $DIR/borrowing.rs:13:33 - | -LL | let _b = { - | -- borrow later stored here -LL | let a = 3; -LL | Pin::new(&mut || yield &a).resume(()) - | -- ^ borrowed value does not live long enough - | | - | value captured here by generator -LL | -LL | }; - | - `a` dropped here while still borrowed - -error[E0597]: `a` does not live long enough - --> $DIR/borrowing.rs:20:20 - | -LL | let _b = { - | -- borrow later stored here -LL | let a = 3; -LL | || { - | -- value captured here by generator -LL | yield &a - | ^ borrowed value does not live long enough -... -LL | }; - | - `a` dropped here while still borrowed - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0597`. diff --git a/tests/ui/generator/borrowing.rs b/tests/ui/generator/borrowing.rs index 29f39437f8f55..d36592583cdc5 100644 --- a/tests/ui/generator/borrowing.rs +++ b/tests/ui/generator/borrowing.rs @@ -1,7 +1,3 @@ -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir - #![feature(generators, generator_trait)] use std::ops::Generator; diff --git a/tests/ui/generator/borrowing.drop_tracking.stderr b/tests/ui/generator/borrowing.stderr similarity index 93% rename from tests/ui/generator/borrowing.drop_tracking.stderr rename to tests/ui/generator/borrowing.stderr index 96e3c327f8b31..38e1ace8c4efb 100644 --- a/tests/ui/generator/borrowing.drop_tracking.stderr +++ b/tests/ui/generator/borrowing.stderr @@ -1,5 +1,5 @@ error[E0597]: `a` does not live long enough - --> $DIR/borrowing.rs:13:33 + --> $DIR/borrowing.rs:9:33 | LL | let _b = { | -- borrow later stored here @@ -13,7 +13,7 @@ LL | }; | - `a` dropped here while still borrowed error[E0597]: `a` does not live long enough - --> $DIR/borrowing.rs:20:20 + --> $DIR/borrowing.rs:16:20 | LL | let _b = { | -- borrow later stored here diff --git a/tests/ui/generator/drop-tracking-parent-expression.drop_tracking_mir.stderr b/tests/ui/generator/drop-tracking-parent-expression.drop_tracking_mir.stderr deleted file mode 100644 index 25553e6bb6036..0000000000000 --- a/tests/ui/generator/drop-tracking-parent-expression.drop_tracking_mir.stderr +++ /dev/null @@ -1,122 +0,0 @@ -error: generator cannot be sent between threads safely - --> $DIR/drop-tracking-parent-expression.rs:27:13 - | -LL | assert_send(g); - | ^^^^^^^^^^^ generator is not `Send` -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation - | - = help: within `{generator@$DIR/drop-tracking-parent-expression.rs:21:21: 21:28}`, the trait `Send` is not implemented for `derived_drop::Client` -note: generator is not `Send` as this value is used across a yield - --> $DIR/drop-tracking-parent-expression.rs:25:22 - | -LL | let g = move || match drop($name::Client { ..$name::Client::default() }) { - | ------------------------ has type `derived_drop::Client` which is not `Send` -... -LL | _ => yield, - | ^^^^^ yield occurs here, with `$name::Client::default()` maybe used later -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation -note: required by a bound in `assert_send` - --> $DIR/drop-tracking-parent-expression.rs:49:19 - | -LL | fn assert_send(_thing: T) {} - | ^^^^ required by this bound in `assert_send` - = note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: generator cannot be sent between threads safely - --> $DIR/drop-tracking-parent-expression.rs:27:13 - | -LL | assert_send(g); - | ^^^^^^^^^^^ generator is not `Send` -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation - | - = help: within `{generator@$DIR/drop-tracking-parent-expression.rs:21:21: 21:28}`, the trait `Send` is not implemented for `significant_drop::Client` -note: generator is not `Send` as this value is used across a yield - --> $DIR/drop-tracking-parent-expression.rs:25:22 - | -LL | let g = move || match drop($name::Client { ..$name::Client::default() }) { - | ------------------------ has type `significant_drop::Client` which is not `Send` -... -LL | _ => yield, - | ^^^^^ yield occurs here, with `$name::Client::default()` maybe used later -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation -note: required by a bound in `assert_send` - --> $DIR/drop-tracking-parent-expression.rs:49:19 - | -LL | fn assert_send(_thing: T) {} - | ^^^^ required by this bound in `assert_send` - = note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: generator cannot be sent between threads safely - --> $DIR/drop-tracking-parent-expression.rs:27:13 - | -LL | assert_send(g); - | ^^^^^^^^^^^ generator is not `Send` -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation - | - = help: within `{generator@$DIR/drop-tracking-parent-expression.rs:21:21: 21:28}`, the trait `Send` is not implemented for `insignificant_dtor::Client` -note: generator is not `Send` as this value is used across a yield - --> $DIR/drop-tracking-parent-expression.rs:25:22 - | -LL | let g = move || match drop($name::Client { ..$name::Client::default() }) { - | ------------------------ has type `insignificant_dtor::Client` which is not `Send` -... -LL | _ => yield, - | ^^^^^ yield occurs here, with `$name::Client::default()` maybe used later -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation -note: required by a bound in `assert_send` - --> $DIR/drop-tracking-parent-expression.rs:49:19 - | -LL | fn assert_send(_thing: T) {} - | ^^^^ required by this bound in `assert_send` - = note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: aborting due to 3 previous errors - diff --git a/tests/ui/generator/drop-tracking-parent-expression.no_drop_tracking.stderr b/tests/ui/generator/drop-tracking-parent-expression.no_drop_tracking.stderr deleted file mode 100644 index 2d141b6b49fcb..0000000000000 --- a/tests/ui/generator/drop-tracking-parent-expression.no_drop_tracking.stderr +++ /dev/null @@ -1,334 +0,0 @@ -error: generator cannot be sent between threads safely - --> $DIR/drop-tracking-parent-expression.rs:27:25 - | -LL | assert_send(g); - | ^ generator is not `Send` -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation - | - = help: within `{generator@$DIR/drop-tracking-parent-expression.rs:21:21: 21:28}`, the trait `Send` is not implemented for `copy::Client` -note: generator is not `Send` as this value is used across a yield - --> $DIR/drop-tracking-parent-expression.rs:25:22 - | -LL | let g = move || match drop($name::Client { ..$name::Client::default() }) { - | ------------------------ has type `copy::Client` which is not `Send` -... -LL | _ => yield, - | ^^^^^ yield occurs here, with `$name::Client::default()` maybe used later -LL | }; - | - `$name::Client::default()` is later dropped here -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation -note: required by a bound in `assert_send` - --> $DIR/drop-tracking-parent-expression.rs:49:19 - | -LL | fn assert_send(_thing: T) {} - | ^^^^ required by this bound in `assert_send` - = note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: generator cannot be sent between threads safely - --> $DIR/drop-tracking-parent-expression.rs:40:25 - | -LL | assert_send(g); - | ^ generator is not `Send` -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation - | - = help: within `{generator@$DIR/drop-tracking-parent-expression.rs:37:21: 37:28}`, the trait `Send` is not implemented for `copy::Client` -note: generator is not `Send` as this value is used across a yield - --> $DIR/drop-tracking-parent-expression.rs:38:22 - | -LL | let g = move || match drop($name::Client::default()) { - | ------------------------ has type `copy::Client` which is not `Send` -LL | _ => yield, - | ^^^^^ yield occurs here, with `$name::Client::default()` maybe used later -LL | }; - | - `$name::Client::default()` is later dropped here -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation -note: required by a bound in `assert_send` - --> $DIR/drop-tracking-parent-expression.rs:49:19 - | -LL | fn assert_send(_thing: T) {} - | ^^^^ required by this bound in `assert_send` - = note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: generator cannot be sent between threads safely - --> $DIR/drop-tracking-parent-expression.rs:27:25 - | -LL | assert_send(g); - | ^ generator is not `Send` -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation - | - = help: within `{generator@$DIR/drop-tracking-parent-expression.rs:21:21: 21:28}`, the trait `Send` is not implemented for `derived_drop::Client` -note: generator is not `Send` as this value is used across a yield - --> $DIR/drop-tracking-parent-expression.rs:25:22 - | -LL | let g = move || match drop($name::Client { ..$name::Client::default() }) { - | ------------------------ has type `derived_drop::Client` which is not `Send` -... -LL | _ => yield, - | ^^^^^ yield occurs here, with `$name::Client::default()` maybe used later -LL | }; - | - `$name::Client::default()` is later dropped here -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation -note: required by a bound in `assert_send` - --> $DIR/drop-tracking-parent-expression.rs:49:19 - | -LL | fn assert_send(_thing: T) {} - | ^^^^ required by this bound in `assert_send` - = note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: generator cannot be sent between threads safely - --> $DIR/drop-tracking-parent-expression.rs:40:25 - | -LL | assert_send(g); - | ^ generator is not `Send` -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation - | - = help: within `{generator@$DIR/drop-tracking-parent-expression.rs:37:21: 37:28}`, the trait `Send` is not implemented for `derived_drop::Client` -note: generator is not `Send` as this value is used across a yield - --> $DIR/drop-tracking-parent-expression.rs:38:22 - | -LL | let g = move || match drop($name::Client::default()) { - | ------------------------ has type `derived_drop::Client` which is not `Send` -LL | _ => yield, - | ^^^^^ yield occurs here, with `$name::Client::default()` maybe used later -LL | }; - | - `$name::Client::default()` is later dropped here -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation -note: required by a bound in `assert_send` - --> $DIR/drop-tracking-parent-expression.rs:49:19 - | -LL | fn assert_send(_thing: T) {} - | ^^^^ required by this bound in `assert_send` - = note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: generator cannot be sent between threads safely - --> $DIR/drop-tracking-parent-expression.rs:27:25 - | -LL | assert_send(g); - | ^ generator is not `Send` -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation - | - = help: within `{generator@$DIR/drop-tracking-parent-expression.rs:21:21: 21:28}`, the trait `Send` is not implemented for `significant_drop::Client` -note: generator is not `Send` as this value is used across a yield - --> $DIR/drop-tracking-parent-expression.rs:25:22 - | -LL | let g = move || match drop($name::Client { ..$name::Client::default() }) { - | ------------------------ has type `significant_drop::Client` which is not `Send` -... -LL | _ => yield, - | ^^^^^ yield occurs here, with `$name::Client::default()` maybe used later -LL | }; - | - `$name::Client::default()` is later dropped here -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation -note: required by a bound in `assert_send` - --> $DIR/drop-tracking-parent-expression.rs:49:19 - | -LL | fn assert_send(_thing: T) {} - | ^^^^ required by this bound in `assert_send` - = note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: generator cannot be sent between threads safely - --> $DIR/drop-tracking-parent-expression.rs:40:25 - | -LL | assert_send(g); - | ^ generator is not `Send` -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation - | - = help: within `{generator@$DIR/drop-tracking-parent-expression.rs:37:21: 37:28}`, the trait `Send` is not implemented for `significant_drop::Client` -note: generator is not `Send` as this value is used across a yield - --> $DIR/drop-tracking-parent-expression.rs:38:22 - | -LL | let g = move || match drop($name::Client::default()) { - | ------------------------ has type `significant_drop::Client` which is not `Send` -LL | _ => yield, - | ^^^^^ yield occurs here, with `$name::Client::default()` maybe used later -LL | }; - | - `$name::Client::default()` is later dropped here -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation -note: required by a bound in `assert_send` - --> $DIR/drop-tracking-parent-expression.rs:49:19 - | -LL | fn assert_send(_thing: T) {} - | ^^^^ required by this bound in `assert_send` - = note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: generator cannot be sent between threads safely - --> $DIR/drop-tracking-parent-expression.rs:27:25 - | -LL | assert_send(g); - | ^ generator is not `Send` -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation - | - = help: within `{generator@$DIR/drop-tracking-parent-expression.rs:21:21: 21:28}`, the trait `Send` is not implemented for `insignificant_dtor::Client` -note: generator is not `Send` as this value is used across a yield - --> $DIR/drop-tracking-parent-expression.rs:25:22 - | -LL | let g = move || match drop($name::Client { ..$name::Client::default() }) { - | ------------------------ has type `insignificant_dtor::Client` which is not `Send` -... -LL | _ => yield, - | ^^^^^ yield occurs here, with `$name::Client::default()` maybe used later -LL | }; - | - `$name::Client::default()` is later dropped here -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation -note: required by a bound in `assert_send` - --> $DIR/drop-tracking-parent-expression.rs:49:19 - | -LL | fn assert_send(_thing: T) {} - | ^^^^ required by this bound in `assert_send` - = note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: generator cannot be sent between threads safely - --> $DIR/drop-tracking-parent-expression.rs:40:25 - | -LL | assert_send(g); - | ^ generator is not `Send` -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation - | - = help: within `{generator@$DIR/drop-tracking-parent-expression.rs:37:21: 37:28}`, the trait `Send` is not implemented for `insignificant_dtor::Client` -note: generator is not `Send` as this value is used across a yield - --> $DIR/drop-tracking-parent-expression.rs:38:22 - | -LL | let g = move || match drop($name::Client::default()) { - | ------------------------ has type `insignificant_dtor::Client` which is not `Send` -LL | _ => yield, - | ^^^^^ yield occurs here, with `$name::Client::default()` maybe used later -LL | }; - | - `$name::Client::default()` is later dropped here -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation -note: required by a bound in `assert_send` - --> $DIR/drop-tracking-parent-expression.rs:49:19 - | -LL | fn assert_send(_thing: T) {} - | ^^^^ required by this bound in `assert_send` - = note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: aborting due to 8 previous errors - diff --git a/tests/ui/generator/drop-tracking-parent-expression.rs b/tests/ui/generator/drop-tracking-parent-expression.rs index ed9ac6d11adb1..d40f1b8f64d4a 100644 --- a/tests/ui/generator/drop-tracking-parent-expression.rs +++ b/tests/ui/generator/drop-tracking-parent-expression.rs @@ -1,7 +1,4 @@ -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir - +// compile-flags: -Zdrop-tracking #![feature(generators, negative_impls, rustc_attrs)] macro_rules! type_combinations { @@ -21,14 +18,13 @@ macro_rules! type_combinations { let g = move || match drop($name::Client { ..$name::Client::default() }) { //~^ `significant_drop::Client` which is not `Send` //~| `insignificant_dtor::Client` which is not `Send` - //[no_drop_tracking,drop_tracking]~| `derived_drop::Client` which is not `Send` + //~| `derived_drop::Client` which is not `Send` _ => yield, }; assert_send(g); //~^ ERROR cannot be sent between threads //~| ERROR cannot be sent between threads //~| ERROR cannot be sent between threads - //[no_drop_tracking]~| ERROR cannot be sent between threads } // Simple owned value. This works because the Client is considered moved into `drop`, @@ -38,10 +34,6 @@ macro_rules! type_combinations { _ => yield, }; assert_send(g); - //[no_drop_tracking]~^ ERROR cannot be sent between threads - //[no_drop_tracking]~| ERROR cannot be sent between threads - //[no_drop_tracking]~| ERROR cannot be sent between threads - //[no_drop_tracking]~| ERROR cannot be sent between threads } )* } } diff --git a/tests/ui/generator/drop-tracking-parent-expression.drop_tracking.stderr b/tests/ui/generator/drop-tracking-parent-expression.stderr similarity index 88% rename from tests/ui/generator/drop-tracking-parent-expression.drop_tracking.stderr rename to tests/ui/generator/drop-tracking-parent-expression.stderr index 190e60d5bfc31..6119f689731ce 100644 --- a/tests/ui/generator/drop-tracking-parent-expression.drop_tracking.stderr +++ b/tests/ui/generator/drop-tracking-parent-expression.stderr @@ -1,5 +1,5 @@ error: generator cannot be sent between threads safely - --> $DIR/drop-tracking-parent-expression.rs:27:25 + --> $DIR/drop-tracking-parent-expression.rs:24:25 | LL | assert_send(g); | ^ generator is not `Send` @@ -13,9 +13,9 @@ LL | | }; LL | | ); | |_____- in this macro invocation | - = help: within `{generator@$DIR/drop-tracking-parent-expression.rs:21:21: 21:28}`, the trait `Send` is not implemented for `derived_drop::Client` + = help: within `{generator@$DIR/drop-tracking-parent-expression.rs:18:21: 18:28}`, the trait `Send` is not implemented for `derived_drop::Client` note: generator is not `Send` as this value is used across a yield - --> $DIR/drop-tracking-parent-expression.rs:25:22 + --> $DIR/drop-tracking-parent-expression.rs:22:22 | LL | let g = move || match drop($name::Client { ..$name::Client::default() }) { | ------------------------ has type `derived_drop::Client` which is not `Send` @@ -34,14 +34,14 @@ LL | | }; LL | | ); | |_____- in this macro invocation note: required by a bound in `assert_send` - --> $DIR/drop-tracking-parent-expression.rs:49:19 + --> $DIR/drop-tracking-parent-expression.rs:41:19 | LL | fn assert_send(_thing: T) {} | ^^^^ required by this bound in `assert_send` = note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info) error: generator cannot be sent between threads safely - --> $DIR/drop-tracking-parent-expression.rs:27:25 + --> $DIR/drop-tracking-parent-expression.rs:24:25 | LL | assert_send(g); | ^ generator is not `Send` @@ -55,9 +55,9 @@ LL | | }; LL | | ); | |_____- in this macro invocation | - = help: within `{generator@$DIR/drop-tracking-parent-expression.rs:21:21: 21:28}`, the trait `Send` is not implemented for `significant_drop::Client` + = help: within `{generator@$DIR/drop-tracking-parent-expression.rs:18:21: 18:28}`, the trait `Send` is not implemented for `significant_drop::Client` note: generator is not `Send` as this value is used across a yield - --> $DIR/drop-tracking-parent-expression.rs:25:22 + --> $DIR/drop-tracking-parent-expression.rs:22:22 | LL | let g = move || match drop($name::Client { ..$name::Client::default() }) { | ------------------------ has type `significant_drop::Client` which is not `Send` @@ -76,14 +76,14 @@ LL | | }; LL | | ); | |_____- in this macro invocation note: required by a bound in `assert_send` - --> $DIR/drop-tracking-parent-expression.rs:49:19 + --> $DIR/drop-tracking-parent-expression.rs:41:19 | LL | fn assert_send(_thing: T) {} | ^^^^ required by this bound in `assert_send` = note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info) error: generator cannot be sent between threads safely - --> $DIR/drop-tracking-parent-expression.rs:27:25 + --> $DIR/drop-tracking-parent-expression.rs:24:25 | LL | assert_send(g); | ^ generator is not `Send` @@ -97,9 +97,9 @@ LL | | }; LL | | ); | |_____- in this macro invocation | - = help: within `{generator@$DIR/drop-tracking-parent-expression.rs:21:21: 21:28}`, the trait `Send` is not implemented for `insignificant_dtor::Client` + = help: within `{generator@$DIR/drop-tracking-parent-expression.rs:18:21: 18:28}`, the trait `Send` is not implemented for `insignificant_dtor::Client` note: generator is not `Send` as this value is used across a yield - --> $DIR/drop-tracking-parent-expression.rs:25:22 + --> $DIR/drop-tracking-parent-expression.rs:22:22 | LL | let g = move || match drop($name::Client { ..$name::Client::default() }) { | ------------------------ has type `insignificant_dtor::Client` which is not `Send` @@ -118,7 +118,7 @@ LL | | }; LL | | ); | |_____- in this macro invocation note: required by a bound in `assert_send` - --> $DIR/drop-tracking-parent-expression.rs:49:19 + --> $DIR/drop-tracking-parent-expression.rs:41:19 | LL | fn assert_send(_thing: T) {} | ^^^^ required by this bound in `assert_send` diff --git a/tests/ui/generator/drop-tracking-yielding-in-match-guards.rs b/tests/ui/generator/drop-tracking-yielding-in-match-guards.rs index cbc291701cbc9..646365e435901 100644 --- a/tests/ui/generator/drop-tracking-yielding-in-match-guards.rs +++ b/tests/ui/generator/drop-tracking-yielding-in-match-guards.rs @@ -1,8 +1,6 @@ // build-pass // edition:2018 -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir +// compile-flags: -Zdrop-tracking #![feature(generators)] diff --git a/tests/ui/generator/issue-105084.rs b/tests/ui/generator/issue-105084.rs index ff9357b76a08b..9fdeb4fd2fc06 100644 --- a/tests/ui/generator/issue-105084.rs +++ b/tests/ui/generator/issue-105084.rs @@ -1,10 +1,4 @@ -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir -// [no_drop_tracking] known-bug: #105084 -// [no_drop_tracking] check-pass -// [drop_tracking] known-bug: #105084 -// [drop_tracking] check-pass +// compile-flags: -Zdrop-tracking-mir #![feature(generators)] #![feature(generator_clone)] @@ -37,13 +31,13 @@ fn main() { // As it is not taken into account for trait computation, // the generator is `Copy`. let mut h = copy(g); - //[drop_tracking_mir]~^ ERROR the trait bound `Box<(i32, ())>: Copy` is not satisfied in + //~^ ERROR the trait bound `Box<(i32, ())>: Copy` is not satisfied in // We now have 2 boxes with the same backing allocation: // one inside `g` and one inside `h`. // Proceed and drop `t` in `g`. Pin::new(&mut g).resume(()); - //[drop_tracking_mir]~^ ERROR borrow of moved value: `g` + //~^ ERROR borrow of moved value: `g` // Proceed and drop `t` in `h` -> double free! Pin::new(&mut h).resume(()); diff --git a/tests/ui/generator/issue-105084.drop_tracking_mir.stderr b/tests/ui/generator/issue-105084.stderr similarity index 81% rename from tests/ui/generator/issue-105084.drop_tracking_mir.stderr rename to tests/ui/generator/issue-105084.stderr index c0ee3237ad1fd..3f1f11918f509 100644 --- a/tests/ui/generator/issue-105084.drop_tracking_mir.stderr +++ b/tests/ui/generator/issue-105084.stderr @@ -1,8 +1,8 @@ error[E0382]: borrow of moved value: `g` - --> $DIR/issue-105084.rs:45:14 + --> $DIR/issue-105084.rs:39:14 | LL | let mut g = || { - | ----- move occurs because `g` has type `{generator@$DIR/issue-105084.rs:22:17: 22:19}`, which does not implement the `Copy` trait + | ----- move occurs because `g` has type `{generator@$DIR/issue-105084.rs:16:17: 16:19}`, which does not implement the `Copy` trait ... LL | let mut h = copy(g); | - value moved here @@ -11,7 +11,7 @@ LL | Pin::new(&mut g).resume(()); | ^^^^^^ value borrowed here after move | note: consider changing this parameter type in function `copy` to borrow instead if owning the value isn't necessary - --> $DIR/issue-105084.rs:17:21 + --> $DIR/issue-105084.rs:11:21 | LL | fn copy(x: T) -> T { | ---- ^ this parameter takes ownership of the value @@ -22,17 +22,17 @@ help: consider cloning the value if the performance cost is acceptable LL | let mut h = copy(g.clone()); | ++++++++ -error[E0277]: the trait bound `Box<(i32, ())>: Copy` is not satisfied in `{generator@$DIR/issue-105084.rs:22:17: 22:19}` - --> $DIR/issue-105084.rs:39:17 +error[E0277]: the trait bound `Box<(i32, ())>: Copy` is not satisfied in `{generator@$DIR/issue-105084.rs:16:17: 16:19}` + --> $DIR/issue-105084.rs:33:17 | LL | let mut g = || { - | -- within this `{generator@$DIR/issue-105084.rs:22:17: 22:19}` + | -- within this `{generator@$DIR/issue-105084.rs:16:17: 16:19}` ... LL | let mut h = copy(g); - | ^^^^ within `{generator@$DIR/issue-105084.rs:22:17: 22:19}`, the trait `Copy` is not implemented for `Box<(i32, ())>` + | ^^^^ within `{generator@$DIR/issue-105084.rs:16:17: 16:19}`, the trait `Copy` is not implemented for `Box<(i32, ())>` | note: generator does not implement `Copy` as this value is used across a yield - --> $DIR/issue-105084.rs:29:22 + --> $DIR/issue-105084.rs:23:22 | LL | Box::new((5, yield)); | -------------^^^^^-- @@ -40,7 +40,7 @@ LL | Box::new((5, yield)); | | yield occurs here, with `Box::new((5, yield))` maybe used later | has type `Box<(i32, ())>` which does not implement `Copy` note: required by a bound in `copy` - --> $DIR/issue-105084.rs:17:12 + --> $DIR/issue-105084.rs:11:12 | LL | fn copy(x: T) -> T { | ^^^^ required by this bound in `copy` diff --git a/tests/ui/generator/issue-57017.no_drop_tracking.stderr b/tests/ui/generator/issue-57017.no_drop_tracking.stderr deleted file mode 100644 index cd5cf12cc498c..0000000000000 --- a/tests/ui/generator/issue-57017.no_drop_tracking.stderr +++ /dev/null @@ -1,248 +0,0 @@ -error: generator cannot be sent between threads safely - --> $DIR/issue-57017.rs:32:25 - | -LL | assert_send(g); - | ^ generator is not `Send` -... -LL | / type_combinations!( -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | derived_drop => { #[derive(Default)] pub struct Client { pub nickname: String } }; -LL | | significant_drop => { -... | -LL | | } -LL | | ); - | |_____- in this macro invocation - | - = help: the trait `Sync` is not implemented for `copy::unsync::Client` -note: generator is not `Send` as this value is used across a yield - --> $DIR/issue-57017.rs:30:28 - | -LL | let g = move || match drop(&$name::unsync::Client::default()) { - | --------------------------------- has type `©::unsync::Client` which is not `Send` -LL | _status => yield, - | ^^^^^ yield occurs here, with `&$name::unsync::Client::default()` maybe used later -LL | }; - | - `&$name::unsync::Client::default()` is later dropped here -... -LL | / type_combinations!( -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | derived_drop => { #[derive(Default)] pub struct Client { pub nickname: String } }; -LL | | significant_drop => { -... | -LL | | } -LL | | ); - | |_____- in this macro invocation -note: required by a bound in `assert_send` - --> $DIR/issue-57017.rs:52:19 - | -LL | fn assert_send(_thing: T) {} - | ^^^^ required by this bound in `assert_send` - = note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: generator cannot be sent between threads safely - --> $DIR/issue-57017.rs:44:25 - | -LL | assert_send(g); - | ^ generator is not `Send` -... -LL | / type_combinations!( -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | derived_drop => { #[derive(Default)] pub struct Client { pub nickname: String } }; -LL | | significant_drop => { -... | -LL | | } -LL | | ); - | |_____- in this macro invocation - | - = help: within `{generator@$DIR/issue-57017.rs:41:21: 41:28}`, the trait `Send` is not implemented for `copy::unsend::Client` -note: generator is not `Send` as this value is used across a yield - --> $DIR/issue-57017.rs:42:28 - | -LL | let g = move || match drop($name::unsend::Client::default()) { - | -------------------------------- has type `copy::unsend::Client` which is not `Send` -LL | _status => yield, - | ^^^^^ yield occurs here, with `$name::unsend::Client::default()` maybe used later -LL | }; - | - `$name::unsend::Client::default()` is later dropped here -... -LL | / type_combinations!( -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | derived_drop => { #[derive(Default)] pub struct Client { pub nickname: String } }; -LL | | significant_drop => { -... | -LL | | } -LL | | ); - | |_____- in this macro invocation -note: required by a bound in `assert_send` - --> $DIR/issue-57017.rs:52:19 - | -LL | fn assert_send(_thing: T) {} - | ^^^^ required by this bound in `assert_send` - = note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: generator cannot be sent between threads safely - --> $DIR/issue-57017.rs:32:25 - | -LL | assert_send(g); - | ^ generator is not `Send` -... -LL | / type_combinations!( -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | derived_drop => { #[derive(Default)] pub struct Client { pub nickname: String } }; -LL | | significant_drop => { -... | -LL | | } -LL | | ); - | |_____- in this macro invocation - | - = help: the trait `Sync` is not implemented for `derived_drop::unsync::Client` -note: generator is not `Send` as this value is used across a yield - --> $DIR/issue-57017.rs:30:28 - | -LL | let g = move || match drop(&$name::unsync::Client::default()) { - | --------------------------------- has type `&derived_drop::unsync::Client` which is not `Send` -LL | _status => yield, - | ^^^^^ yield occurs here, with `&$name::unsync::Client::default()` maybe used later -LL | }; - | - `&$name::unsync::Client::default()` is later dropped here -... -LL | / type_combinations!( -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | derived_drop => { #[derive(Default)] pub struct Client { pub nickname: String } }; -LL | | significant_drop => { -... | -LL | | } -LL | | ); - | |_____- in this macro invocation -note: required by a bound in `assert_send` - --> $DIR/issue-57017.rs:52:19 - | -LL | fn assert_send(_thing: T) {} - | ^^^^ required by this bound in `assert_send` - = note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: generator cannot be sent between threads safely - --> $DIR/issue-57017.rs:44:25 - | -LL | assert_send(g); - | ^ generator is not `Send` -... -LL | / type_combinations!( -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | derived_drop => { #[derive(Default)] pub struct Client { pub nickname: String } }; -LL | | significant_drop => { -... | -LL | | } -LL | | ); - | |_____- in this macro invocation - | - = help: within `{generator@$DIR/issue-57017.rs:41:21: 41:28}`, the trait `Send` is not implemented for `derived_drop::unsend::Client` -note: generator is not `Send` as this value is used across a yield - --> $DIR/issue-57017.rs:42:28 - | -LL | let g = move || match drop($name::unsend::Client::default()) { - | -------------------------------- has type `derived_drop::unsend::Client` which is not `Send` -LL | _status => yield, - | ^^^^^ yield occurs here, with `$name::unsend::Client::default()` maybe used later -LL | }; - | - `$name::unsend::Client::default()` is later dropped here -... -LL | / type_combinations!( -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | derived_drop => { #[derive(Default)] pub struct Client { pub nickname: String } }; -LL | | significant_drop => { -... | -LL | | } -LL | | ); - | |_____- in this macro invocation -note: required by a bound in `assert_send` - --> $DIR/issue-57017.rs:52:19 - | -LL | fn assert_send(_thing: T) {} - | ^^^^ required by this bound in `assert_send` - = note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: generator cannot be sent between threads safely - --> $DIR/issue-57017.rs:32:25 - | -LL | assert_send(g); - | ^ generator is not `Send` -... -LL | / type_combinations!( -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | derived_drop => { #[derive(Default)] pub struct Client { pub nickname: String } }; -LL | | significant_drop => { -... | -LL | | } -LL | | ); - | |_____- in this macro invocation - | - = help: the trait `Sync` is not implemented for `significant_drop::unsync::Client` -note: generator is not `Send` as this value is used across a yield - --> $DIR/issue-57017.rs:30:28 - | -LL | let g = move || match drop(&$name::unsync::Client::default()) { - | --------------------------------- has type `&significant_drop::unsync::Client` which is not `Send` -LL | _status => yield, - | ^^^^^ yield occurs here, with `&$name::unsync::Client::default()` maybe used later -LL | }; - | - `&$name::unsync::Client::default()` is later dropped here -... -LL | / type_combinations!( -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | derived_drop => { #[derive(Default)] pub struct Client { pub nickname: String } }; -LL | | significant_drop => { -... | -LL | | } -LL | | ); - | |_____- in this macro invocation -note: required by a bound in `assert_send` - --> $DIR/issue-57017.rs:52:19 - | -LL | fn assert_send(_thing: T) {} - | ^^^^ required by this bound in `assert_send` - = note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: generator cannot be sent between threads safely - --> $DIR/issue-57017.rs:44:25 - | -LL | assert_send(g); - | ^ generator is not `Send` -... -LL | / type_combinations!( -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | derived_drop => { #[derive(Default)] pub struct Client { pub nickname: String } }; -LL | | significant_drop => { -... | -LL | | } -LL | | ); - | |_____- in this macro invocation - | - = help: within `{generator@$DIR/issue-57017.rs:41:21: 41:28}`, the trait `Send` is not implemented for `significant_drop::unsend::Client` -note: generator is not `Send` as this value is used across a yield - --> $DIR/issue-57017.rs:42:28 - | -LL | let g = move || match drop($name::unsend::Client::default()) { - | -------------------------------- has type `significant_drop::unsend::Client` which is not `Send` -LL | _status => yield, - | ^^^^^ yield occurs here, with `$name::unsend::Client::default()` maybe used later -LL | }; - | - `$name::unsend::Client::default()` is later dropped here -... -LL | / type_combinations!( -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | derived_drop => { #[derive(Default)] pub struct Client { pub nickname: String } }; -LL | | significant_drop => { -... | -LL | | } -LL | | ); - | |_____- in this macro invocation -note: required by a bound in `assert_send` - --> $DIR/issue-57017.rs:52:19 - | -LL | fn assert_send(_thing: T) {} - | ^^^^ required by this bound in `assert_send` - = note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: aborting due to 6 previous errors - diff --git a/tests/ui/generator/issue-57017.rs b/tests/ui/generator/issue-57017.rs index 381897c77a5c3..6cb742b7ffe01 100644 --- a/tests/ui/generator/issue-57017.rs +++ b/tests/ui/generator/issue-57017.rs @@ -1,9 +1,5 @@ -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir -// [drop_tracking] build-pass -// [drop_tracking_mir] build-pass - +// build-pass +// compile-flags: -Zdrop-tracking #![feature(generators, negative_impls)] #![allow(dropping_references, dropping_copy_types)] @@ -30,9 +26,6 @@ macro_rules! type_combinations { _status => yield, }; assert_send(g); - //[no_drop_tracking]~^ ERROR generator cannot be sent between threads safely - //[no_drop_tracking]~| ERROR generator cannot be sent between threads safely - //[no_drop_tracking]~| ERROR generator cannot be sent between threads safely } // This tests that `Client` is properly considered to be dropped after moving it into the @@ -42,9 +35,6 @@ macro_rules! type_combinations { _status => yield, }; assert_send(g); - //[no_drop_tracking]~^ ERROR generator cannot be sent between threads safely - //[no_drop_tracking]~| ERROR generator cannot be sent between threads safely - //[no_drop_tracking]~| ERROR generator cannot be sent between threads safely } )* } } diff --git a/tests/ui/generator/issue-57478.no_drop_tracking.stderr b/tests/ui/generator/issue-57478.no_drop_tracking.stderr deleted file mode 100644 index df931f5e04e7b..0000000000000 --- a/tests/ui/generator/issue-57478.no_drop_tracking.stderr +++ /dev/null @@ -1,31 +0,0 @@ -error: generator cannot be sent between threads safely - --> $DIR/issue-57478.rs:13:17 - | -LL | assert_send(|| { - | _________________^ -LL | | -LL | | let guard = Foo; -LL | | drop(guard); -LL | | yield; -LL | | }) - | |_____^ generator is not `Send` - | - = help: within `{generator@$DIR/issue-57478.rs:13:17: 13:19}`, the trait `Send` is not implemented for `Foo` -note: generator is not `Send` as this value is used across a yield - --> $DIR/issue-57478.rs:17:9 - | -LL | let guard = Foo; - | ----- has type `Foo` which is not `Send` -LL | drop(guard); -LL | yield; - | ^^^^^ yield occurs here, with `guard` maybe used later -LL | }) - | - `guard` is later dropped here -note: required by a bound in `assert_send` - --> $DIR/issue-57478.rs:21:19 - | -LL | fn assert_send(_: T) {} - | ^^^^ required by this bound in `assert_send` - -error: aborting due to previous error - diff --git a/tests/ui/generator/issue-57478.rs b/tests/ui/generator/issue-57478.rs index 3c23b5992710e..91407ea1844f5 100644 --- a/tests/ui/generator/issue-57478.rs +++ b/tests/ui/generator/issue-57478.rs @@ -1,8 +1,5 @@ -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir -// [drop_tracking] check-pass -// [drop_tracking_mir] check-pass +// check-pass +// compile-flags: -Zdrop-tracking #![feature(negative_impls, generators)] @@ -11,7 +8,6 @@ impl !Send for Foo {} fn main() { assert_send(|| { - //[no_drop_tracking]~^ ERROR generator cannot be sent between threads safely let guard = Foo; drop(guard); yield; diff --git a/tests/ui/generator/issue-68112.drop_tracking.stderr b/tests/ui/generator/issue-68112.drop_tracking.stderr deleted file mode 100644 index 282eac1b686ef..0000000000000 --- a/tests/ui/generator/issue-68112.drop_tracking.stderr +++ /dev/null @@ -1,66 +0,0 @@ -error: generator cannot be sent between threads safely - --> $DIR/issue-68112.rs:43:18 - | -LL | require_send(send_gen); - | ^^^^^^^^ generator is not `Send` - | - = help: the trait `Sync` is not implemented for `RefCell` - = note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead -note: generator is not `Send` as this value is used across a yield - --> $DIR/issue-68112.rs:39:9 - | -LL | let _non_send_gen = make_non_send_generator(); - | ------------- has type `impl Generator>>` which is not `Send` -LL | -LL | yield; - | ^^^^^ yield occurs here, with `_non_send_gen` maybe used later -... -LL | }; - | - `_non_send_gen` is later dropped here -note: required by a bound in `require_send` - --> $DIR/issue-68112.rs:25:25 - | -LL | fn require_send(_: impl Send) {} - | ^^^^ required by this bound in `require_send` - -error[E0277]: `RefCell` cannot be shared between threads safely - --> $DIR/issue-68112.rs:67:18 - | -LL | require_send(send_gen); - | ------------ ^^^^^^^^ `RefCell` cannot be shared between threads safely - | | - | required by a bound introduced by this call - | - = help: the trait `Sync` is not implemented for `RefCell` - = note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead - = note: required for `Arc>` to implement `Send` -note: required because it's used within this generator - --> $DIR/issue-68112.rs:52:5 - | -LL | || { - | ^^ -note: required because it appears within the type `impl Generator>>` - --> $DIR/issue-68112.rs:49:30 - | -LL | pub fn make_gen2(t: T) -> impl Generator { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: required because it appears within the type `impl Generator>>` - --> $DIR/issue-68112.rs:57:34 - | -LL | fn make_non_send_generator2() -> impl Generator>> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: required because it captures the following types: `impl Generator>>`, `()` -note: required because it's used within this generator - --> $DIR/issue-68112.rs:63:20 - | -LL | let send_gen = || { - | ^^ -note: required by a bound in `require_send` - --> $DIR/issue-68112.rs:25:25 - | -LL | fn require_send(_: impl Send) {} - | ^^^^ required by this bound in `require_send` - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/generator/issue-68112.drop_tracking_mir.stderr b/tests/ui/generator/issue-68112.drop_tracking_mir.stderr deleted file mode 100644 index a83522b714d53..0000000000000 --- a/tests/ui/generator/issue-68112.drop_tracking_mir.stderr +++ /dev/null @@ -1,61 +0,0 @@ -error: generator cannot be sent between threads safely - --> $DIR/issue-68112.rs:43:5 - | -LL | require_send(send_gen); - | ^^^^^^^^^^^^ generator is not `Send` - | - = help: the trait `Sync` is not implemented for `RefCell` - = note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead -note: generator is not `Send` as this value is used across a yield - --> $DIR/issue-68112.rs:39:9 - | -LL | let _non_send_gen = make_non_send_generator(); - | ------------- has type `impl Generator>>` which is not `Send` -LL | -LL | yield; - | ^^^^^ yield occurs here, with `_non_send_gen` maybe used later -note: required by a bound in `require_send` - --> $DIR/issue-68112.rs:25:25 - | -LL | fn require_send(_: impl Send) {} - | ^^^^ required by this bound in `require_send` - -error[E0277]: `RefCell` cannot be shared between threads safely - --> $DIR/issue-68112.rs:67:5 - | -LL | require_send(send_gen); - | ^^^^^^^^^^^^ `RefCell` cannot be shared between threads safely - | - = help: the trait `Sync` is not implemented for `RefCell` - = note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead - = note: required for `Arc>` to implement `Send` -note: required because it's used within this generator - --> $DIR/issue-68112.rs:52:5 - | -LL | || { - | ^^ -note: required because it appears within the type `impl Generator>>` - --> $DIR/issue-68112.rs:49:30 - | -LL | pub fn make_gen2(t: T) -> impl Generator { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: required because it appears within the type `impl Generator>>` - --> $DIR/issue-68112.rs:57:34 - | -LL | fn make_non_send_generator2() -> impl Generator>> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: required because it captures the following types: `impl Generator>>` -note: required because it's used within this generator - --> $DIR/issue-68112.rs:63:20 - | -LL | let send_gen = || { - | ^^ -note: required by a bound in `require_send` - --> $DIR/issue-68112.rs:25:25 - | -LL | fn require_send(_: impl Send) {} - | ^^^^ required by this bound in `require_send` - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/generator/issue-68112.rs b/tests/ui/generator/issue-68112.rs index 48b53b7693d41..9def544e3d25c 100644 --- a/tests/ui/generator/issue-68112.rs +++ b/tests/ui/generator/issue-68112.rs @@ -1,6 +1,3 @@ -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir #![feature(generators, generator_trait)] use std::{ @@ -11,7 +8,7 @@ use std::{ }; pub struct Ready(Option); -impl Generator<()> for Ready { +impl Generator<()> for Ready { type Return = T; type Yield = (); fn resume(mut self: Pin<&mut Self>, _args: ()) -> GeneratorState<(), T> { @@ -39,7 +36,7 @@ fn test1() { yield; //~^ NOTE yield occurs here //~| NOTE value is used across a yield - }; //[no_drop_tracking,drop_tracking]~ NOTE later dropped here + }; //~ NOTE later dropped here require_send(send_gen); //~^ ERROR generator cannot be sent between threads //~| NOTE not `Send` @@ -68,7 +65,7 @@ fn test2() { //~^ ERROR `RefCell` cannot be shared between threads safely //~| NOTE `RefCell` cannot be shared between threads safely //~| NOTE required for - //[no_drop_tracking,drop_tracking]~| NOTE required by a bound introduced by this call + //~| NOTE required by a bound introduced by this call //~| NOTE captures the following types //~| NOTE use `std::sync::RwLock` instead } diff --git a/tests/ui/generator/issue-68112.no_drop_tracking.stderr b/tests/ui/generator/issue-68112.stderr similarity index 89% rename from tests/ui/generator/issue-68112.no_drop_tracking.stderr rename to tests/ui/generator/issue-68112.stderr index 282eac1b686ef..b42bc93d01f66 100644 --- a/tests/ui/generator/issue-68112.no_drop_tracking.stderr +++ b/tests/ui/generator/issue-68112.stderr @@ -1,5 +1,5 @@ error: generator cannot be sent between threads safely - --> $DIR/issue-68112.rs:43:18 + --> $DIR/issue-68112.rs:40:18 | LL | require_send(send_gen); | ^^^^^^^^ generator is not `Send` @@ -7,7 +7,7 @@ LL | require_send(send_gen); = help: the trait `Sync` is not implemented for `RefCell` = note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead note: generator is not `Send` as this value is used across a yield - --> $DIR/issue-68112.rs:39:9 + --> $DIR/issue-68112.rs:36:9 | LL | let _non_send_gen = make_non_send_generator(); | ------------- has type `impl Generator>>` which is not `Send` @@ -18,13 +18,13 @@ LL | yield; LL | }; | - `_non_send_gen` is later dropped here note: required by a bound in `require_send` - --> $DIR/issue-68112.rs:25:25 + --> $DIR/issue-68112.rs:22:25 | LL | fn require_send(_: impl Send) {} | ^^^^ required by this bound in `require_send` error[E0277]: `RefCell` cannot be shared between threads safely - --> $DIR/issue-68112.rs:67:18 + --> $DIR/issue-68112.rs:64:18 | LL | require_send(send_gen); | ------------ ^^^^^^^^ `RefCell` cannot be shared between threads safely @@ -35,28 +35,28 @@ LL | require_send(send_gen); = note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead = note: required for `Arc>` to implement `Send` note: required because it's used within this generator - --> $DIR/issue-68112.rs:52:5 + --> $DIR/issue-68112.rs:49:5 | LL | || { | ^^ note: required because it appears within the type `impl Generator>>` - --> $DIR/issue-68112.rs:49:30 + --> $DIR/issue-68112.rs:46:30 | LL | pub fn make_gen2(t: T) -> impl Generator { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ note: required because it appears within the type `impl Generator>>` - --> $DIR/issue-68112.rs:57:34 + --> $DIR/issue-68112.rs:54:34 | LL | fn make_non_send_generator2() -> impl Generator>> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: required because it captures the following types: `impl Generator>>`, `()` note: required because it's used within this generator - --> $DIR/issue-68112.rs:63:20 + --> $DIR/issue-68112.rs:60:20 | LL | let send_gen = || { | ^^ note: required by a bound in `require_send` - --> $DIR/issue-68112.rs:25:25 + --> $DIR/issue-68112.rs:22:25 | LL | fn require_send(_: impl Send) {} | ^^^^ required by this bound in `require_send` diff --git a/tests/ui/generator/issue-93161.rs b/tests/ui/generator/issue-93161.rs index 8d3f7c62f3936..92305609c835c 100644 --- a/tests/ui/generator/issue-93161.rs +++ b/tests/ui/generator/issue-93161.rs @@ -1,8 +1,6 @@ -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir // edition:2021 // run-pass +// compile-flags: -Zdrop-tracking #![feature(never_type)] diff --git a/tests/ui/generator/not-send-sync.drop_tracking.stderr b/tests/ui/generator/not-send-sync.drop_tracking.stderr deleted file mode 100644 index 53f62dc4ea291..0000000000000 --- a/tests/ui/generator/not-send-sync.drop_tracking.stderr +++ /dev/null @@ -1,60 +0,0 @@ -error: generator cannot be shared between threads safely - --> $DIR/not-send-sync.rs:17:17 - | -LL | assert_sync(|| { - | _________________^ -LL | | -LL | | let a = NotSync; -LL | | yield; -LL | | drop(a); -LL | | }); - | |_____^ generator is not `Sync` - | - = help: within `{generator@$DIR/not-send-sync.rs:17:17: 17:19}`, the trait `Sync` is not implemented for `NotSync` -note: generator is not `Sync` as this value is used across a yield - --> $DIR/not-send-sync.rs:20:9 - | -LL | let a = NotSync; - | - has type `NotSync` which is not `Sync` -LL | yield; - | ^^^^^ yield occurs here, with `a` maybe used later -LL | drop(a); -LL | }); - | - `a` is later dropped here -note: required by a bound in `assert_sync` - --> $DIR/not-send-sync.rs:14:23 - | -LL | fn assert_sync(_: T) {} - | ^^^^ required by this bound in `assert_sync` - -error: generator cannot be sent between threads safely - --> $DIR/not-send-sync.rs:24:17 - | -LL | assert_send(|| { - | _________________^ -LL | | -LL | | let a = NotSend; -LL | | yield; -LL | | drop(a); -LL | | }); - | |_____^ generator is not `Send` - | - = help: within `{generator@$DIR/not-send-sync.rs:24:17: 24:19}`, the trait `Send` is not implemented for `NotSend` -note: generator is not `Send` as this value is used across a yield - --> $DIR/not-send-sync.rs:27:9 - | -LL | let a = NotSend; - | - has type `NotSend` which is not `Send` -LL | yield; - | ^^^^^ yield occurs here, with `a` maybe used later -LL | drop(a); -LL | }); - | - `a` is later dropped here -note: required by a bound in `assert_send` - --> $DIR/not-send-sync.rs:15:23 - | -LL | fn assert_send(_: T) {} - | ^^^^ required by this bound in `assert_send` - -error: aborting due to 2 previous errors - diff --git a/tests/ui/generator/not-send-sync.drop_tracking_mir.stderr b/tests/ui/generator/not-send-sync.drop_tracking_mir.stderr deleted file mode 100644 index 2438e7846b1e2..0000000000000 --- a/tests/ui/generator/not-send-sync.drop_tracking_mir.stderr +++ /dev/null @@ -1,42 +0,0 @@ -error: generator cannot be shared between threads safely - --> $DIR/not-send-sync.rs:17:5 - | -LL | assert_sync(|| { - | ^^^^^^^^^^^ generator is not `Sync` - | - = help: within `{generator@$DIR/not-send-sync.rs:17:17: 17:19}`, the trait `Sync` is not implemented for `NotSync` -note: generator is not `Sync` as this value is used across a yield - --> $DIR/not-send-sync.rs:20:9 - | -LL | let a = NotSync; - | - has type `NotSync` which is not `Sync` -LL | yield; - | ^^^^^ yield occurs here, with `a` maybe used later -note: required by a bound in `assert_sync` - --> $DIR/not-send-sync.rs:14:23 - | -LL | fn assert_sync(_: T) {} - | ^^^^ required by this bound in `assert_sync` - -error: generator cannot be sent between threads safely - --> $DIR/not-send-sync.rs:24:5 - | -LL | assert_send(|| { - | ^^^^^^^^^^^ generator is not `Send` - | - = help: within `{generator@$DIR/not-send-sync.rs:24:17: 24:19}`, the trait `Send` is not implemented for `NotSend` -note: generator is not `Send` as this value is used across a yield - --> $DIR/not-send-sync.rs:27:9 - | -LL | let a = NotSend; - | - has type `NotSend` which is not `Send` -LL | yield; - | ^^^^^ yield occurs here, with `a` maybe used later -note: required by a bound in `assert_send` - --> $DIR/not-send-sync.rs:15:23 - | -LL | fn assert_send(_: T) {} - | ^^^^ required by this bound in `assert_send` - -error: aborting due to 2 previous errors - diff --git a/tests/ui/generator/not-send-sync.no_drop_tracking.stderr b/tests/ui/generator/not-send-sync.no_drop_tracking.stderr deleted file mode 100644 index 53f62dc4ea291..0000000000000 --- a/tests/ui/generator/not-send-sync.no_drop_tracking.stderr +++ /dev/null @@ -1,60 +0,0 @@ -error: generator cannot be shared between threads safely - --> $DIR/not-send-sync.rs:17:17 - | -LL | assert_sync(|| { - | _________________^ -LL | | -LL | | let a = NotSync; -LL | | yield; -LL | | drop(a); -LL | | }); - | |_____^ generator is not `Sync` - | - = help: within `{generator@$DIR/not-send-sync.rs:17:17: 17:19}`, the trait `Sync` is not implemented for `NotSync` -note: generator is not `Sync` as this value is used across a yield - --> $DIR/not-send-sync.rs:20:9 - | -LL | let a = NotSync; - | - has type `NotSync` which is not `Sync` -LL | yield; - | ^^^^^ yield occurs here, with `a` maybe used later -LL | drop(a); -LL | }); - | - `a` is later dropped here -note: required by a bound in `assert_sync` - --> $DIR/not-send-sync.rs:14:23 - | -LL | fn assert_sync(_: T) {} - | ^^^^ required by this bound in `assert_sync` - -error: generator cannot be sent between threads safely - --> $DIR/not-send-sync.rs:24:17 - | -LL | assert_send(|| { - | _________________^ -LL | | -LL | | let a = NotSend; -LL | | yield; -LL | | drop(a); -LL | | }); - | |_____^ generator is not `Send` - | - = help: within `{generator@$DIR/not-send-sync.rs:24:17: 24:19}`, the trait `Send` is not implemented for `NotSend` -note: generator is not `Send` as this value is used across a yield - --> $DIR/not-send-sync.rs:27:9 - | -LL | let a = NotSend; - | - has type `NotSend` which is not `Send` -LL | yield; - | ^^^^^ yield occurs here, with `a` maybe used later -LL | drop(a); -LL | }); - | - `a` is later dropped here -note: required by a bound in `assert_send` - --> $DIR/not-send-sync.rs:15:23 - | -LL | fn assert_send(_: T) {} - | ^^^^ required by this bound in `assert_send` - -error: aborting due to 2 previous errors - diff --git a/tests/ui/generator/not-send-sync.rs b/tests/ui/generator/not-send-sync.rs index 8794db452b465..8ca5565fb2ab5 100644 --- a/tests/ui/generator/not-send-sync.rs +++ b/tests/ui/generator/not-send-sync.rs @@ -1,14 +1,6 @@ -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir #![feature(generators)] -#![feature(negative_impls)] -struct NotSend; -struct NotSync; - -impl !Send for NotSend {} -impl !Sync for NotSync {} +use std::cell::Cell; fn main() { fn assert_sync(_: T) {} @@ -16,15 +8,14 @@ fn main() { assert_sync(|| { //~^ ERROR: generator cannot be shared between threads safely - let a = NotSync; + let a = Cell::new(2); yield; - drop(a); }); + let a = Cell::new(2); assert_send(|| { - //~^ ERROR: generator cannot be sent between threads safely - let a = NotSend; + //~^ ERROR: E0277 + drop(&a); yield; - drop(a); }); } diff --git a/tests/ui/generator/not-send-sync.stderr b/tests/ui/generator/not-send-sync.stderr new file mode 100644 index 0000000000000..6e0269026b569 --- /dev/null +++ b/tests/ui/generator/not-send-sync.stderr @@ -0,0 +1,58 @@ +error[E0277]: `Cell` cannot be shared between threads safely + --> $DIR/not-send-sync.rs:16:17 + | +LL | assert_send(|| { + | _____-----------_^ + | | | + | | required by a bound introduced by this call +LL | | +LL | | drop(&a); +LL | | yield; +LL | | }); + | |_____^ `Cell` cannot be shared between threads safely + | + = help: the trait `Sync` is not implemented for `Cell` + = note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` or `std::sync::atomic::AtomicI32` instead + = note: required for `&Cell` to implement `Send` +note: required because it's used within this generator + --> $DIR/not-send-sync.rs:16:17 + | +LL | assert_send(|| { + | ^^ +note: required by a bound in `assert_send` + --> $DIR/not-send-sync.rs:7:23 + | +LL | fn assert_send(_: T) {} + | ^^^^ required by this bound in `assert_send` + +error: generator cannot be shared between threads safely + --> $DIR/not-send-sync.rs:9:17 + | +LL | assert_sync(|| { + | _________________^ +LL | | +LL | | let a = Cell::new(2); +LL | | yield; +LL | | }); + | |_____^ generator is not `Sync` + | + = help: within `{generator@$DIR/not-send-sync.rs:9:17: 9:19}`, the trait `Sync` is not implemented for `Cell` + = note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` or `std::sync::atomic::AtomicI32` instead +note: generator is not `Sync` as this value is used across a yield + --> $DIR/not-send-sync.rs:12:9 + | +LL | let a = Cell::new(2); + | - has type `Cell` which is not `Sync` +LL | yield; + | ^^^^^ yield occurs here, with `a` maybe used later +LL | }); + | - `a` is later dropped here +note: required by a bound in `assert_sync` + --> $DIR/not-send-sync.rs:6:23 + | +LL | fn assert_sync(_: T) {} + | ^^^^ required by this bound in `assert_sync` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/generator/parent-expression.drop_tracking_mir.stderr b/tests/ui/generator/parent-expression.drop_tracking_mir.stderr deleted file mode 100644 index 11bfb9902b0d6..0000000000000 --- a/tests/ui/generator/parent-expression.drop_tracking_mir.stderr +++ /dev/null @@ -1,122 +0,0 @@ -error: generator cannot be sent between threads safely - --> $DIR/parent-expression.rs:27:13 - | -LL | assert_send(g); - | ^^^^^^^^^^^ generator is not `Send` -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation - | - = help: within `{generator@$DIR/parent-expression.rs:21:21: 21:28}`, the trait `Send` is not implemented for `derived_drop::Client` -note: generator is not `Send` as this value is used across a yield - --> $DIR/parent-expression.rs:25:22 - | -LL | let g = move || match drop($name::Client { ..$name::Client::default() }) { - | ------------------------ has type `derived_drop::Client` which is not `Send` -... -LL | _ => yield, - | ^^^^^ yield occurs here, with `$name::Client::default()` maybe used later -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation -note: required by a bound in `assert_send` - --> $DIR/parent-expression.rs:49:19 - | -LL | fn assert_send(_thing: T) {} - | ^^^^ required by this bound in `assert_send` - = note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: generator cannot be sent between threads safely - --> $DIR/parent-expression.rs:27:13 - | -LL | assert_send(g); - | ^^^^^^^^^^^ generator is not `Send` -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation - | - = help: within `{generator@$DIR/parent-expression.rs:21:21: 21:28}`, the trait `Send` is not implemented for `significant_drop::Client` -note: generator is not `Send` as this value is used across a yield - --> $DIR/parent-expression.rs:25:22 - | -LL | let g = move || match drop($name::Client { ..$name::Client::default() }) { - | ------------------------ has type `significant_drop::Client` which is not `Send` -... -LL | _ => yield, - | ^^^^^ yield occurs here, with `$name::Client::default()` maybe used later -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation -note: required by a bound in `assert_send` - --> $DIR/parent-expression.rs:49:19 - | -LL | fn assert_send(_thing: T) {} - | ^^^^ required by this bound in `assert_send` - = note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: generator cannot be sent between threads safely - --> $DIR/parent-expression.rs:27:13 - | -LL | assert_send(g); - | ^^^^^^^^^^^ generator is not `Send` -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation - | - = help: within `{generator@$DIR/parent-expression.rs:21:21: 21:28}`, the trait `Send` is not implemented for `insignificant_dtor::Client` -note: generator is not `Send` as this value is used across a yield - --> $DIR/parent-expression.rs:25:22 - | -LL | let g = move || match drop($name::Client { ..$name::Client::default() }) { - | ------------------------ has type `insignificant_dtor::Client` which is not `Send` -... -LL | _ => yield, - | ^^^^^ yield occurs here, with `$name::Client::default()` maybe used later -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation -note: required by a bound in `assert_send` - --> $DIR/parent-expression.rs:49:19 - | -LL | fn assert_send(_thing: T) {} - | ^^^^ required by this bound in `assert_send` - = note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: aborting due to 3 previous errors - diff --git a/tests/ui/generator/parent-expression.no_drop_tracking.stderr b/tests/ui/generator/parent-expression.no_drop_tracking.stderr deleted file mode 100644 index 5750d2d0afd96..0000000000000 --- a/tests/ui/generator/parent-expression.no_drop_tracking.stderr +++ /dev/null @@ -1,334 +0,0 @@ -error: generator cannot be sent between threads safely - --> $DIR/parent-expression.rs:27:25 - | -LL | assert_send(g); - | ^ generator is not `Send` -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation - | - = help: within `{generator@$DIR/parent-expression.rs:21:21: 21:28}`, the trait `Send` is not implemented for `copy::Client` -note: generator is not `Send` as this value is used across a yield - --> $DIR/parent-expression.rs:25:22 - | -LL | let g = move || match drop($name::Client { ..$name::Client::default() }) { - | ------------------------ has type `copy::Client` which is not `Send` -... -LL | _ => yield, - | ^^^^^ yield occurs here, with `$name::Client::default()` maybe used later -LL | }; - | - `$name::Client::default()` is later dropped here -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation -note: required by a bound in `assert_send` - --> $DIR/parent-expression.rs:49:19 - | -LL | fn assert_send(_thing: T) {} - | ^^^^ required by this bound in `assert_send` - = note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: generator cannot be sent between threads safely - --> $DIR/parent-expression.rs:40:25 - | -LL | assert_send(g); - | ^ generator is not `Send` -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation - | - = help: within `{generator@$DIR/parent-expression.rs:37:21: 37:28}`, the trait `Send` is not implemented for `copy::Client` -note: generator is not `Send` as this value is used across a yield - --> $DIR/parent-expression.rs:38:22 - | -LL | let g = move || match drop($name::Client::default()) { - | ------------------------ has type `copy::Client` which is not `Send` -LL | _ => yield, - | ^^^^^ yield occurs here, with `$name::Client::default()` maybe used later -LL | }; - | - `$name::Client::default()` is later dropped here -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation -note: required by a bound in `assert_send` - --> $DIR/parent-expression.rs:49:19 - | -LL | fn assert_send(_thing: T) {} - | ^^^^ required by this bound in `assert_send` - = note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: generator cannot be sent between threads safely - --> $DIR/parent-expression.rs:27:25 - | -LL | assert_send(g); - | ^ generator is not `Send` -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation - | - = help: within `{generator@$DIR/parent-expression.rs:21:21: 21:28}`, the trait `Send` is not implemented for `derived_drop::Client` -note: generator is not `Send` as this value is used across a yield - --> $DIR/parent-expression.rs:25:22 - | -LL | let g = move || match drop($name::Client { ..$name::Client::default() }) { - | ------------------------ has type `derived_drop::Client` which is not `Send` -... -LL | _ => yield, - | ^^^^^ yield occurs here, with `$name::Client::default()` maybe used later -LL | }; - | - `$name::Client::default()` is later dropped here -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation -note: required by a bound in `assert_send` - --> $DIR/parent-expression.rs:49:19 - | -LL | fn assert_send(_thing: T) {} - | ^^^^ required by this bound in `assert_send` - = note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: generator cannot be sent between threads safely - --> $DIR/parent-expression.rs:40:25 - | -LL | assert_send(g); - | ^ generator is not `Send` -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation - | - = help: within `{generator@$DIR/parent-expression.rs:37:21: 37:28}`, the trait `Send` is not implemented for `derived_drop::Client` -note: generator is not `Send` as this value is used across a yield - --> $DIR/parent-expression.rs:38:22 - | -LL | let g = move || match drop($name::Client::default()) { - | ------------------------ has type `derived_drop::Client` which is not `Send` -LL | _ => yield, - | ^^^^^ yield occurs here, with `$name::Client::default()` maybe used later -LL | }; - | - `$name::Client::default()` is later dropped here -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation -note: required by a bound in `assert_send` - --> $DIR/parent-expression.rs:49:19 - | -LL | fn assert_send(_thing: T) {} - | ^^^^ required by this bound in `assert_send` - = note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: generator cannot be sent between threads safely - --> $DIR/parent-expression.rs:27:25 - | -LL | assert_send(g); - | ^ generator is not `Send` -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation - | - = help: within `{generator@$DIR/parent-expression.rs:21:21: 21:28}`, the trait `Send` is not implemented for `significant_drop::Client` -note: generator is not `Send` as this value is used across a yield - --> $DIR/parent-expression.rs:25:22 - | -LL | let g = move || match drop($name::Client { ..$name::Client::default() }) { - | ------------------------ has type `significant_drop::Client` which is not `Send` -... -LL | _ => yield, - | ^^^^^ yield occurs here, with `$name::Client::default()` maybe used later -LL | }; - | - `$name::Client::default()` is later dropped here -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation -note: required by a bound in `assert_send` - --> $DIR/parent-expression.rs:49:19 - | -LL | fn assert_send(_thing: T) {} - | ^^^^ required by this bound in `assert_send` - = note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: generator cannot be sent between threads safely - --> $DIR/parent-expression.rs:40:25 - | -LL | assert_send(g); - | ^ generator is not `Send` -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation - | - = help: within `{generator@$DIR/parent-expression.rs:37:21: 37:28}`, the trait `Send` is not implemented for `significant_drop::Client` -note: generator is not `Send` as this value is used across a yield - --> $DIR/parent-expression.rs:38:22 - | -LL | let g = move || match drop($name::Client::default()) { - | ------------------------ has type `significant_drop::Client` which is not `Send` -LL | _ => yield, - | ^^^^^ yield occurs here, with `$name::Client::default()` maybe used later -LL | }; - | - `$name::Client::default()` is later dropped here -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation -note: required by a bound in `assert_send` - --> $DIR/parent-expression.rs:49:19 - | -LL | fn assert_send(_thing: T) {} - | ^^^^ required by this bound in `assert_send` - = note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: generator cannot be sent between threads safely - --> $DIR/parent-expression.rs:27:25 - | -LL | assert_send(g); - | ^ generator is not `Send` -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation - | - = help: within `{generator@$DIR/parent-expression.rs:21:21: 21:28}`, the trait `Send` is not implemented for `insignificant_dtor::Client` -note: generator is not `Send` as this value is used across a yield - --> $DIR/parent-expression.rs:25:22 - | -LL | let g = move || match drop($name::Client { ..$name::Client::default() }) { - | ------------------------ has type `insignificant_dtor::Client` which is not `Send` -... -LL | _ => yield, - | ^^^^^ yield occurs here, with `$name::Client::default()` maybe used later -LL | }; - | - `$name::Client::default()` is later dropped here -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation -note: required by a bound in `assert_send` - --> $DIR/parent-expression.rs:49:19 - | -LL | fn assert_send(_thing: T) {} - | ^^^^ required by this bound in `assert_send` - = note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: generator cannot be sent between threads safely - --> $DIR/parent-expression.rs:40:25 - | -LL | assert_send(g); - | ^ generator is not `Send` -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation - | - = help: within `{generator@$DIR/parent-expression.rs:37:21: 37:28}`, the trait `Send` is not implemented for `insignificant_dtor::Client` -note: generator is not `Send` as this value is used across a yield - --> $DIR/parent-expression.rs:38:22 - | -LL | let g = move || match drop($name::Client::default()) { - | ------------------------ has type `insignificant_dtor::Client` which is not `Send` -LL | _ => yield, - | ^^^^^ yield occurs here, with `$name::Client::default()` maybe used later -LL | }; - | - `$name::Client::default()` is later dropped here -... -LL | / type_combinations!( -LL | | // OK -LL | | copy => { #[derive(Copy, Clone, Default)] pub struct Client; }; -LL | | // NOT OK: MIR borrowck thinks that this is used after the yield, even though -... | -LL | | }; -LL | | ); - | |_____- in this macro invocation -note: required by a bound in `assert_send` - --> $DIR/parent-expression.rs:49:19 - | -LL | fn assert_send(_thing: T) {} - | ^^^^ required by this bound in `assert_send` - = note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: aborting due to 8 previous errors - diff --git a/tests/ui/generator/parent-expression.rs b/tests/ui/generator/parent-expression.rs index 239034e3d4e8a..47a179c14ad42 100644 --- a/tests/ui/generator/parent-expression.rs +++ b/tests/ui/generator/parent-expression.rs @@ -1,6 +1,4 @@ -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir +// compile-flags: -Zdrop-tracking #![feature(generators, negative_impls, rustc_attrs)] @@ -28,7 +26,6 @@ macro_rules! type_combinations { //~^ ERROR cannot be sent between threads //~| ERROR cannot be sent between threads //~| ERROR cannot be sent between threads - //[no_drop_tracking]~^^^^ ERROR cannot be sent between threads } // Simple owned value. This works because the Client is considered moved into `drop`, @@ -38,10 +35,6 @@ macro_rules! type_combinations { _ => yield, }; assert_send(g); - //[no_drop_tracking]~^ ERROR cannot be sent between threads - //[no_drop_tracking]~| ERROR cannot be sent between threads - //[no_drop_tracking]~| ERROR cannot be sent between threads - //[no_drop_tracking]~| ERROR cannot be sent between threads } )* } } diff --git a/tests/ui/generator/parent-expression.drop_tracking.stderr b/tests/ui/generator/parent-expression.stderr similarity index 87% rename from tests/ui/generator/parent-expression.drop_tracking.stderr rename to tests/ui/generator/parent-expression.stderr index f55c8d58fd02e..5fb54abeb2d7b 100644 --- a/tests/ui/generator/parent-expression.drop_tracking.stderr +++ b/tests/ui/generator/parent-expression.stderr @@ -1,5 +1,5 @@ error: generator cannot be sent between threads safely - --> $DIR/parent-expression.rs:27:25 + --> $DIR/parent-expression.rs:25:25 | LL | assert_send(g); | ^ generator is not `Send` @@ -13,9 +13,9 @@ LL | | }; LL | | ); | |_____- in this macro invocation | - = help: within `{generator@$DIR/parent-expression.rs:21:21: 21:28}`, the trait `Send` is not implemented for `derived_drop::Client` + = help: within `{generator@$DIR/parent-expression.rs:19:21: 19:28}`, the trait `Send` is not implemented for `derived_drop::Client` note: generator is not `Send` as this value is used across a yield - --> $DIR/parent-expression.rs:25:22 + --> $DIR/parent-expression.rs:23:22 | LL | let g = move || match drop($name::Client { ..$name::Client::default() }) { | ------------------------ has type `derived_drop::Client` which is not `Send` @@ -34,14 +34,14 @@ LL | | }; LL | | ); | |_____- in this macro invocation note: required by a bound in `assert_send` - --> $DIR/parent-expression.rs:49:19 + --> $DIR/parent-expression.rs:42:19 | LL | fn assert_send(_thing: T) {} | ^^^^ required by this bound in `assert_send` = note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info) error: generator cannot be sent between threads safely - --> $DIR/parent-expression.rs:27:25 + --> $DIR/parent-expression.rs:25:25 | LL | assert_send(g); | ^ generator is not `Send` @@ -55,9 +55,9 @@ LL | | }; LL | | ); | |_____- in this macro invocation | - = help: within `{generator@$DIR/parent-expression.rs:21:21: 21:28}`, the trait `Send` is not implemented for `significant_drop::Client` + = help: within `{generator@$DIR/parent-expression.rs:19:21: 19:28}`, the trait `Send` is not implemented for `significant_drop::Client` note: generator is not `Send` as this value is used across a yield - --> $DIR/parent-expression.rs:25:22 + --> $DIR/parent-expression.rs:23:22 | LL | let g = move || match drop($name::Client { ..$name::Client::default() }) { | ------------------------ has type `significant_drop::Client` which is not `Send` @@ -76,14 +76,14 @@ LL | | }; LL | | ); | |_____- in this macro invocation note: required by a bound in `assert_send` - --> $DIR/parent-expression.rs:49:19 + --> $DIR/parent-expression.rs:42:19 | LL | fn assert_send(_thing: T) {} | ^^^^ required by this bound in `assert_send` = note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info) error: generator cannot be sent between threads safely - --> $DIR/parent-expression.rs:27:25 + --> $DIR/parent-expression.rs:25:25 | LL | assert_send(g); | ^ generator is not `Send` @@ -97,9 +97,9 @@ LL | | }; LL | | ); | |_____- in this macro invocation | - = help: within `{generator@$DIR/parent-expression.rs:21:21: 21:28}`, the trait `Send` is not implemented for `insignificant_dtor::Client` + = help: within `{generator@$DIR/parent-expression.rs:19:21: 19:28}`, the trait `Send` is not implemented for `insignificant_dtor::Client` note: generator is not `Send` as this value is used across a yield - --> $DIR/parent-expression.rs:25:22 + --> $DIR/parent-expression.rs:23:22 | LL | let g = move || match drop($name::Client { ..$name::Client::default() }) { | ------------------------ has type `insignificant_dtor::Client` which is not `Send` @@ -118,7 +118,7 @@ LL | | }; LL | | ); | |_____- in this macro invocation note: required by a bound in `assert_send` - --> $DIR/parent-expression.rs:49:19 + --> $DIR/parent-expression.rs:42:19 | LL | fn assert_send(_thing: T) {} | ^^^^ required by this bound in `assert_send` diff --git a/tests/ui/generator/partial-drop.no_drop_tracking.stderr b/tests/ui/generator/partial-drop.no_drop_tracking.stderr deleted file mode 100644 index 34b7101825fe6..0000000000000 --- a/tests/ui/generator/partial-drop.no_drop_tracking.stderr +++ /dev/null @@ -1,61 +0,0 @@ -error: generator cannot be sent between threads safely - --> $DIR/partial-drop.rs:17:17 - | -LL | assert_send(|| { - | _________________^ -LL | | -LL | | let guard = Bar { foo: Foo, x: 42 }; -LL | | drop(guard.foo); -LL | | yield; -LL | | }); - | |_____^ generator is not `Send` - | - = help: within `{generator@$DIR/partial-drop.rs:17:17: 17:19}`, the trait `Send` is not implemented for `Foo` -note: generator is not `Send` as this value is used across a yield - --> $DIR/partial-drop.rs:21:9 - | -LL | let guard = Bar { foo: Foo, x: 42 }; - | ----- has type `Bar` which is not `Send` -LL | drop(guard.foo); -LL | yield; - | ^^^^^ yield occurs here, with `guard` maybe used later -LL | }); - | - `guard` is later dropped here -note: required by a bound in `assert_send` - --> $DIR/partial-drop.rs:33:19 - | -LL | fn assert_send(_: T) {} - | ^^^^ required by this bound in `assert_send` - -error: generator cannot be sent between threads safely - --> $DIR/partial-drop.rs:24:17 - | -LL | assert_send(|| { - | _________________^ -LL | | -LL | | let guard = Bar { foo: Foo, x: 42 }; -LL | | let Bar { foo, x } = guard; -LL | | drop(foo); -LL | | yield; -LL | | }); - | |_____^ generator is not `Send` - | - = help: within `{generator@$DIR/partial-drop.rs:24:17: 24:19}`, the trait `Send` is not implemented for `Foo` -note: generator is not `Send` as this value is used across a yield - --> $DIR/partial-drop.rs:29:9 - | -LL | let Bar { foo, x } = guard; - | --- has type `Foo` which is not `Send` -LL | drop(foo); -LL | yield; - | ^^^^^ yield occurs here, with `foo` maybe used later -LL | }); - | - `foo` is later dropped here -note: required by a bound in `assert_send` - --> $DIR/partial-drop.rs:33:19 - | -LL | fn assert_send(_: T) {} - | ^^^^ required by this bound in `assert_send` - -error: aborting due to 2 previous errors - diff --git a/tests/ui/generator/partial-drop.rs b/tests/ui/generator/partial-drop.rs index 1d3ae075d43af..c872fb7f3e630 100644 --- a/tests/ui/generator/partial-drop.rs +++ b/tests/ui/generator/partial-drop.rs @@ -1,7 +1,4 @@ -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir -// [drop_tracking_mir] check-pass +// compile-flags: -Zdrop-tracking #![feature(negative_impls, generators)] @@ -15,14 +12,26 @@ struct Bar { fn main() { assert_send(|| { - //[no_drop_tracking,drop_tracking]~^ ERROR generator cannot be sent between threads safely + //~^ ERROR generator cannot be sent between threads safely + // FIXME: it would be nice to make this work. let guard = Bar { foo: Foo, x: 42 }; drop(guard.foo); yield; }); assert_send(|| { - //[no_drop_tracking,drop_tracking]~^ ERROR generator cannot be sent between threads safely + //~^ ERROR generator cannot be sent between threads safely + // FIXME: it would be nice to make this work. + let guard = Bar { foo: Foo, x: 42 }; + drop(guard); + guard.foo = Foo; + guard.x = 23; + yield; + }); + + assert_send(|| { + //~^ ERROR generator cannot be sent between threads safely + // FIXME: it would be nice to make this work. let guard = Bar { foo: Foo, x: 42 }; let Bar { foo, x } = guard; drop(foo); diff --git a/tests/ui/generator/partial-drop.drop_tracking.stderr b/tests/ui/generator/partial-drop.stderr similarity index 52% rename from tests/ui/generator/partial-drop.drop_tracking.stderr rename to tests/ui/generator/partial-drop.stderr index b3de78533618c..f374b549df33c 100644 --- a/tests/ui/generator/partial-drop.drop_tracking.stderr +++ b/tests/ui/generator/partial-drop.stderr @@ -1,18 +1,19 @@ error: generator cannot be sent between threads safely - --> $DIR/partial-drop.rs:17:17 + --> $DIR/partial-drop.rs:14:17 | LL | assert_send(|| { | _________________^ LL | | +LL | | // FIXME: it would be nice to make this work. LL | | let guard = Bar { foo: Foo, x: 42 }; LL | | drop(guard.foo); LL | | yield; LL | | }); | |_____^ generator is not `Send` | - = help: within `{generator@$DIR/partial-drop.rs:17:17: 17:19}`, the trait `Send` is not implemented for `Foo` + = help: within `{generator@$DIR/partial-drop.rs:14:17: 14:19}`, the trait `Send` is not implemented for `Foo` note: generator is not `Send` as this value is used across a yield - --> $DIR/partial-drop.rs:21:9 + --> $DIR/partial-drop.rs:19:9 | LL | let guard = Bar { foo: Foo, x: 42 }; | ----- has type `Bar` which is not `Send` @@ -22,25 +23,25 @@ LL | yield; LL | }); | - `guard` is later dropped here note: required by a bound in `assert_send` - --> $DIR/partial-drop.rs:33:19 + --> $DIR/partial-drop.rs:42:19 | LL | fn assert_send(_: T) {} | ^^^^ required by this bound in `assert_send` error: generator cannot be sent between threads safely - --> $DIR/partial-drop.rs:24:17 + --> $DIR/partial-drop.rs:22:17 | LL | assert_send(|| { | _________________^ LL | | +LL | | // FIXME: it would be nice to make this work. LL | | let guard = Bar { foo: Foo, x: 42 }; -LL | | let Bar { foo, x } = guard; -LL | | drop(foo); +... | LL | | yield; LL | | }); | |_____^ generator is not `Send` | - = help: within `{generator@$DIR/partial-drop.rs:24:17: 24:19}`, the trait `Send` is not implemented for `Foo` + = help: within `{generator@$DIR/partial-drop.rs:22:17: 22:19}`, the trait `Send` is not implemented for `Foo` note: generator is not `Send` as this value is used across a yield --> $DIR/partial-drop.rs:29:9 | @@ -52,10 +53,40 @@ LL | yield; LL | }); | - `guard` is later dropped here note: required by a bound in `assert_send` - --> $DIR/partial-drop.rs:33:19 + --> $DIR/partial-drop.rs:42:19 | LL | fn assert_send(_: T) {} | ^^^^ required by this bound in `assert_send` -error: aborting due to 2 previous errors +error: generator cannot be sent between threads safely + --> $DIR/partial-drop.rs:32:17 + | +LL | assert_send(|| { + | _________________^ +LL | | +LL | | // FIXME: it would be nice to make this work. +LL | | let guard = Bar { foo: Foo, x: 42 }; +... | +LL | | yield; +LL | | }); + | |_____^ generator is not `Send` + | + = help: within `{generator@$DIR/partial-drop.rs:32:17: 32:19}`, the trait `Send` is not implemented for `Foo` +note: generator is not `Send` as this value is used across a yield + --> $DIR/partial-drop.rs:38:9 + | +LL | let guard = Bar { foo: Foo, x: 42 }; + | ----- has type `Bar` which is not `Send` +... +LL | yield; + | ^^^^^ yield occurs here, with `guard` maybe used later +LL | }); + | - `guard` is later dropped here +note: required by a bound in `assert_send` + --> $DIR/partial-drop.rs:42:19 + | +LL | fn assert_send(_: T) {} + | ^^^^ required by this bound in `assert_send` + +error: aborting due to 3 previous errors diff --git a/tests/ui/generator/print/generator-print-verbose-1.drop_tracking.stderr b/tests/ui/generator/print/generator-print-verbose-1.drop_tracking.stderr deleted file mode 100644 index 429b202f60383..0000000000000 --- a/tests/ui/generator/print/generator-print-verbose-1.drop_tracking.stderr +++ /dev/null @@ -1,64 +0,0 @@ -error: generator cannot be sent between threads safely - --> $DIR/generator-print-verbose-1.rs:40:18 - | -LL | require_send(send_gen); - | ^^^^^^^^ generator is not `Send` - | - = help: the trait `Sync` is not implemented for `RefCell` - = note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead -note: generator is not `Send` as this value is used across a yield - --> $DIR/generator-print-verbose-1.rs:38:9 - | -LL | let _non_send_gen = make_non_send_generator(); - | ------------- has type `Opaque(DefId(0:34 ~ generator_print_verbose_1[7d1d]::make_non_send_generator::{opaque#0}), [])` which is not `Send` -LL | yield; - | ^^^^^ yield occurs here, with `_non_send_gen` maybe used later -LL | }; - | - `_non_send_gen` is later dropped here -note: required by a bound in `require_send` - --> $DIR/generator-print-verbose-1.rs:29:25 - | -LL | fn require_send(_: impl Send) {} - | ^^^^ required by this bound in `require_send` - -error[E0277]: `RefCell` cannot be shared between threads safely - --> $DIR/generator-print-verbose-1.rs:59:18 - | -LL | require_send(send_gen); - | ------------ ^^^^^^^^ `RefCell` cannot be shared between threads safely - | | - | required by a bound introduced by this call - | - = help: the trait `Sync` is not implemented for `RefCell` - = note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead - = note: required for `Arc>` to implement `Send` -note: required because it's used within this generator - --> $DIR/generator-print-verbose-1.rs:45:5 - | -LL | || { - | ^^ -note: required because it appears within the type `Opaque(DefId(0:35 ~ generator_print_verbose_1[7d1d]::make_gen2::{opaque#0}), [Arc>])` - --> $DIR/generator-print-verbose-1.rs:44:30 - | -LL | pub fn make_gen2(t: T) -> impl Generator { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: required because it appears within the type `Opaque(DefId(0:36 ~ generator_print_verbose_1[7d1d]::make_non_send_generator2::{opaque#0}), [])` - --> $DIR/generator-print-verbose-1.rs:50:34 - | -LL | fn make_non_send_generator2() -> impl Generator>> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: required because it captures the following types: `Opaque(DefId(0:36 ~ generator_print_verbose_1[7d1d]::make_non_send_generator2::{opaque#0}), [])`, `()` -note: required because it's used within this generator - --> $DIR/generator-print-verbose-1.rs:55:20 - | -LL | let send_gen = || { - | ^^ -note: required by a bound in `require_send` - --> $DIR/generator-print-verbose-1.rs:29:25 - | -LL | fn require_send(_: impl Send) {} - | ^^^^ required by this bound in `require_send` - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/generator/print/generator-print-verbose-1.drop_tracking_mir.stderr b/tests/ui/generator/print/generator-print-verbose-1.drop_tracking_mir.stderr deleted file mode 100644 index 01a30fd2f4e99..0000000000000 --- a/tests/ui/generator/print/generator-print-verbose-1.drop_tracking_mir.stderr +++ /dev/null @@ -1,60 +0,0 @@ -error: generator cannot be sent between threads safely - --> $DIR/generator-print-verbose-1.rs:40:5 - | -LL | require_send(send_gen); - | ^^^^^^^^^^^^ generator is not `Send` - | - = help: the trait `Sync` is not implemented for `RefCell` - = note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead -note: generator is not `Send` as this value is used across a yield - --> $DIR/generator-print-verbose-1.rs:38:9 - | -LL | let _non_send_gen = make_non_send_generator(); - | ------------- has type `Opaque(DefId(0:34 ~ generator_print_verbose_1[7d1d]::make_non_send_generator::{opaque#0}), [])` which is not `Send` -LL | yield; - | ^^^^^ yield occurs here, with `_non_send_gen` maybe used later -note: required by a bound in `require_send` - --> $DIR/generator-print-verbose-1.rs:29:25 - | -LL | fn require_send(_: impl Send) {} - | ^^^^ required by this bound in `require_send` - -error[E0277]: `RefCell` cannot be shared between threads safely - --> $DIR/generator-print-verbose-1.rs:59:5 - | -LL | require_send(send_gen); - | ^^^^^^^^^^^^ `RefCell` cannot be shared between threads safely - | - = help: the trait `Sync` is not implemented for `RefCell` - = note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead - = note: required for `Arc>` to implement `Send` -note: required because it's used within this generator - --> $DIR/generator-print-verbose-1.rs:45:5 - | -LL | || { - | ^^ -note: required because it appears within the type `Opaque(DefId(0:35 ~ generator_print_verbose_1[7d1d]::make_gen2::{opaque#0}), [Arc>])` - --> $DIR/generator-print-verbose-1.rs:44:30 - | -LL | pub fn make_gen2(t: T) -> impl Generator { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: required because it appears within the type `Opaque(DefId(0:36 ~ generator_print_verbose_1[7d1d]::make_non_send_generator2::{opaque#0}), [])` - --> $DIR/generator-print-verbose-1.rs:50:34 - | -LL | fn make_non_send_generator2() -> impl Generator>> { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: required because it captures the following types: `Opaque(DefId(0:36 ~ generator_print_verbose_1[7d1d]::make_non_send_generator2::{opaque#0}), [])` -note: required because it's used within this generator - --> $DIR/generator-print-verbose-1.rs:55:20 - | -LL | let send_gen = || { - | ^^ -note: required by a bound in `require_send` - --> $DIR/generator-print-verbose-1.rs:29:25 - | -LL | fn require_send(_: impl Send) {} - | ^^^^ required by this bound in `require_send` - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/generator/print/generator-print-verbose-1.rs b/tests/ui/generator/print/generator-print-verbose-1.rs index c7052c7d1b04d..89124ad7289ac 100644 --- a/tests/ui/generator/print/generator-print-verbose-1.rs +++ b/tests/ui/generator/print/generator-print-verbose-1.rs @@ -1,6 +1,3 @@ -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir // compile-flags: -Zverbose // Same as: tests/ui/generator/issue-68112.stderr @@ -15,7 +12,7 @@ use std::{ }; pub struct Ready(Option); -impl Generator<()> for Ready { +impl Generator<()> for Ready { type Return = T; type Yield = (); fn resume(mut self: Pin<&mut Self>, _args: ()) -> GeneratorState<(), T> { diff --git a/tests/ui/generator/print/generator-print-verbose-1.no_drop_tracking.stderr b/tests/ui/generator/print/generator-print-verbose-1.stderr similarity index 86% rename from tests/ui/generator/print/generator-print-verbose-1.no_drop_tracking.stderr rename to tests/ui/generator/print/generator-print-verbose-1.stderr index 429b202f60383..1e409534c758f 100644 --- a/tests/ui/generator/print/generator-print-verbose-1.no_drop_tracking.stderr +++ b/tests/ui/generator/print/generator-print-verbose-1.stderr @@ -1,5 +1,5 @@ error: generator cannot be sent between threads safely - --> $DIR/generator-print-verbose-1.rs:40:18 + --> $DIR/generator-print-verbose-1.rs:37:18 | LL | require_send(send_gen); | ^^^^^^^^ generator is not `Send` @@ -7,7 +7,7 @@ LL | require_send(send_gen); = help: the trait `Sync` is not implemented for `RefCell` = note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead note: generator is not `Send` as this value is used across a yield - --> $DIR/generator-print-verbose-1.rs:38:9 + --> $DIR/generator-print-verbose-1.rs:35:9 | LL | let _non_send_gen = make_non_send_generator(); | ------------- has type `Opaque(DefId(0:34 ~ generator_print_verbose_1[7d1d]::make_non_send_generator::{opaque#0}), [])` which is not `Send` @@ -16,13 +16,13 @@ LL | yield; LL | }; | - `_non_send_gen` is later dropped here note: required by a bound in `require_send` - --> $DIR/generator-print-verbose-1.rs:29:25 + --> $DIR/generator-print-verbose-1.rs:26:25 | LL | fn require_send(_: impl Send) {} | ^^^^ required by this bound in `require_send` error[E0277]: `RefCell` cannot be shared between threads safely - --> $DIR/generator-print-verbose-1.rs:59:18 + --> $DIR/generator-print-verbose-1.rs:56:18 | LL | require_send(send_gen); | ------------ ^^^^^^^^ `RefCell` cannot be shared between threads safely @@ -33,28 +33,28 @@ LL | require_send(send_gen); = note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead = note: required for `Arc>` to implement `Send` note: required because it's used within this generator - --> $DIR/generator-print-verbose-1.rs:45:5 + --> $DIR/generator-print-verbose-1.rs:42:5 | LL | || { | ^^ note: required because it appears within the type `Opaque(DefId(0:35 ~ generator_print_verbose_1[7d1d]::make_gen2::{opaque#0}), [Arc>])` - --> $DIR/generator-print-verbose-1.rs:44:30 + --> $DIR/generator-print-verbose-1.rs:41:30 | LL | pub fn make_gen2(t: T) -> impl Generator { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ note: required because it appears within the type `Opaque(DefId(0:36 ~ generator_print_verbose_1[7d1d]::make_non_send_generator2::{opaque#0}), [])` - --> $DIR/generator-print-verbose-1.rs:50:34 + --> $DIR/generator-print-verbose-1.rs:47:34 | LL | fn make_non_send_generator2() -> impl Generator>> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: required because it captures the following types: `Opaque(DefId(0:36 ~ generator_print_verbose_1[7d1d]::make_non_send_generator2::{opaque#0}), [])`, `()` note: required because it's used within this generator - --> $DIR/generator-print-verbose-1.rs:55:20 + --> $DIR/generator-print-verbose-1.rs:52:20 | LL | let send_gen = || { | ^^ note: required by a bound in `require_send` - --> $DIR/generator-print-verbose-1.rs:29:25 + --> $DIR/generator-print-verbose-1.rs:26:25 | LL | fn require_send(_: impl Send) {} | ^^^^ required by this bound in `require_send` diff --git a/tests/ui/generator/print/generator-print-verbose-2.drop_tracking.stderr b/tests/ui/generator/print/generator-print-verbose-2.drop_tracking.stderr deleted file mode 100644 index 53b4cadacd059..0000000000000 --- a/tests/ui/generator/print/generator-print-verbose-2.drop_tracking.stderr +++ /dev/null @@ -1,60 +0,0 @@ -error: generator cannot be shared between threads safely - --> $DIR/generator-print-verbose-2.rs:20:17 - | -LL | assert_sync(|| { - | _________________^ -LL | | -LL | | let a = NotSync; -LL | | yield; -LL | | drop(a); -LL | | }); - | |_____^ generator is not `Sync` - | - = help: within `{main::{closure#0} upvar_tys=() {NotSync, ()}}`, the trait `Sync` is not implemented for `NotSync` -note: generator is not `Sync` as this value is used across a yield - --> $DIR/generator-print-verbose-2.rs:23:9 - | -LL | let a = NotSync; - | - has type `NotSync` which is not `Sync` -LL | yield; - | ^^^^^ yield occurs here, with `a` maybe used later -LL | drop(a); -LL | }); - | - `a` is later dropped here -note: required by a bound in `assert_sync` - --> $DIR/generator-print-verbose-2.rs:17:23 - | -LL | fn assert_sync(_: T) {} - | ^^^^ required by this bound in `assert_sync` - -error: generator cannot be sent between threads safely - --> $DIR/generator-print-verbose-2.rs:27:17 - | -LL | assert_send(|| { - | _________________^ -LL | | -LL | | let a = NotSend; -LL | | yield; -LL | | drop(a); -LL | | }); - | |_____^ generator is not `Send` - | - = help: within `{main::{closure#1} upvar_tys=() {NotSend, ()}}`, the trait `Send` is not implemented for `NotSend` -note: generator is not `Send` as this value is used across a yield - --> $DIR/generator-print-verbose-2.rs:30:9 - | -LL | let a = NotSend; - | - has type `NotSend` which is not `Send` -LL | yield; - | ^^^^^ yield occurs here, with `a` maybe used later -LL | drop(a); -LL | }); - | - `a` is later dropped here -note: required by a bound in `assert_send` - --> $DIR/generator-print-verbose-2.rs:18:23 - | -LL | fn assert_send(_: T) {} - | ^^^^ required by this bound in `assert_send` - -error: aborting due to 2 previous errors - diff --git a/tests/ui/generator/print/generator-print-verbose-2.drop_tracking_mir.stderr b/tests/ui/generator/print/generator-print-verbose-2.drop_tracking_mir.stderr deleted file mode 100644 index 937881340c618..0000000000000 --- a/tests/ui/generator/print/generator-print-verbose-2.drop_tracking_mir.stderr +++ /dev/null @@ -1,42 +0,0 @@ -error: generator cannot be shared between threads safely - --> $DIR/generator-print-verbose-2.rs:20:5 - | -LL | assert_sync(|| { - | ^^^^^^^^^^^ generator is not `Sync` - | - = help: within `{main::{closure#0} upvar_tys=() {main::{closure#0}}}`, the trait `Sync` is not implemented for `NotSync` -note: generator is not `Sync` as this value is used across a yield - --> $DIR/generator-print-verbose-2.rs:23:9 - | -LL | let a = NotSync; - | - has type `NotSync` which is not `Sync` -LL | yield; - | ^^^^^ yield occurs here, with `a` maybe used later -note: required by a bound in `assert_sync` - --> $DIR/generator-print-verbose-2.rs:17:23 - | -LL | fn assert_sync(_: T) {} - | ^^^^ required by this bound in `assert_sync` - -error: generator cannot be sent between threads safely - --> $DIR/generator-print-verbose-2.rs:27:5 - | -LL | assert_send(|| { - | ^^^^^^^^^^^ generator is not `Send` - | - = help: within `{main::{closure#1} upvar_tys=() {main::{closure#1}}}`, the trait `Send` is not implemented for `NotSend` -note: generator is not `Send` as this value is used across a yield - --> $DIR/generator-print-verbose-2.rs:30:9 - | -LL | let a = NotSend; - | - has type `NotSend` which is not `Send` -LL | yield; - | ^^^^^ yield occurs here, with `a` maybe used later -note: required by a bound in `assert_send` - --> $DIR/generator-print-verbose-2.rs:18:23 - | -LL | fn assert_send(_: T) {} - | ^^^^ required by this bound in `assert_send` - -error: aborting due to 2 previous errors - diff --git a/tests/ui/generator/print/generator-print-verbose-2.no_drop_tracking.stderr b/tests/ui/generator/print/generator-print-verbose-2.no_drop_tracking.stderr deleted file mode 100644 index 53b4cadacd059..0000000000000 --- a/tests/ui/generator/print/generator-print-verbose-2.no_drop_tracking.stderr +++ /dev/null @@ -1,60 +0,0 @@ -error: generator cannot be shared between threads safely - --> $DIR/generator-print-verbose-2.rs:20:17 - | -LL | assert_sync(|| { - | _________________^ -LL | | -LL | | let a = NotSync; -LL | | yield; -LL | | drop(a); -LL | | }); - | |_____^ generator is not `Sync` - | - = help: within `{main::{closure#0} upvar_tys=() {NotSync, ()}}`, the trait `Sync` is not implemented for `NotSync` -note: generator is not `Sync` as this value is used across a yield - --> $DIR/generator-print-verbose-2.rs:23:9 - | -LL | let a = NotSync; - | - has type `NotSync` which is not `Sync` -LL | yield; - | ^^^^^ yield occurs here, with `a` maybe used later -LL | drop(a); -LL | }); - | - `a` is later dropped here -note: required by a bound in `assert_sync` - --> $DIR/generator-print-verbose-2.rs:17:23 - | -LL | fn assert_sync(_: T) {} - | ^^^^ required by this bound in `assert_sync` - -error: generator cannot be sent between threads safely - --> $DIR/generator-print-verbose-2.rs:27:17 - | -LL | assert_send(|| { - | _________________^ -LL | | -LL | | let a = NotSend; -LL | | yield; -LL | | drop(a); -LL | | }); - | |_____^ generator is not `Send` - | - = help: within `{main::{closure#1} upvar_tys=() {NotSend, ()}}`, the trait `Send` is not implemented for `NotSend` -note: generator is not `Send` as this value is used across a yield - --> $DIR/generator-print-verbose-2.rs:30:9 - | -LL | let a = NotSend; - | - has type `NotSend` which is not `Send` -LL | yield; - | ^^^^^ yield occurs here, with `a` maybe used later -LL | drop(a); -LL | }); - | - `a` is later dropped here -note: required by a bound in `assert_send` - --> $DIR/generator-print-verbose-2.rs:18:23 - | -LL | fn assert_send(_: T) {} - | ^^^^ required by this bound in `assert_send` - -error: aborting due to 2 previous errors - diff --git a/tests/ui/generator/print/generator-print-verbose-2.rs b/tests/ui/generator/print/generator-print-verbose-2.rs index ab29db6e09c96..d914719cb36bb 100644 --- a/tests/ui/generator/print/generator-print-verbose-2.rs +++ b/tests/ui/generator/print/generator-print-verbose-2.rs @@ -1,17 +1,9 @@ -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir // compile-flags: -Zverbose // Same as test/ui/generator/not-send-sync.rs #![feature(generators)] -#![feature(negative_impls)] -struct NotSend; -struct NotSync; - -impl !Send for NotSend {} -impl !Sync for NotSync {} +use std::cell::Cell; fn main() { fn assert_sync(_: T) {} @@ -19,15 +11,14 @@ fn main() { assert_sync(|| { //~^ ERROR: generator cannot be shared between threads safely - let a = NotSync; + let a = Cell::new(2); yield; - drop(a); }); + let a = Cell::new(2); assert_send(|| { - //~^ ERROR: generator cannot be sent between threads safely - let a = NotSend; + //~^ ERROR: E0277 + drop(&a); yield; - drop(a); }); } diff --git a/tests/ui/generator/print/generator-print-verbose-2.stderr b/tests/ui/generator/print/generator-print-verbose-2.stderr new file mode 100644 index 0000000000000..4e88e73f1d6df --- /dev/null +++ b/tests/ui/generator/print/generator-print-verbose-2.stderr @@ -0,0 +1,58 @@ +error[E0277]: `Cell` cannot be shared between threads safely + --> $DIR/generator-print-verbose-2.rs:19:17 + | +LL | assert_send(|| { + | _____-----------_^ + | | | + | | required by a bound introduced by this call +LL | | +LL | | drop(&a); +LL | | yield; +LL | | }); + | |_____^ `Cell` cannot be shared between threads safely + | + = help: the trait `Sync` is not implemented for `Cell` + = note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` or `std::sync::atomic::AtomicI32` instead + = note: required for `&'?4 Cell` to implement `Send` +note: required because it's used within this generator + --> $DIR/generator-print-verbose-2.rs:19:17 + | +LL | assert_send(|| { + | ^^ +note: required by a bound in `assert_send` + --> $DIR/generator-print-verbose-2.rs:10:23 + | +LL | fn assert_send(_: T) {} + | ^^^^ required by this bound in `assert_send` + +error: generator cannot be shared between threads safely + --> $DIR/generator-print-verbose-2.rs:12:17 + | +LL | assert_sync(|| { + | _________________^ +LL | | +LL | | let a = Cell::new(2); +LL | | yield; +LL | | }); + | |_____^ generator is not `Sync` + | + = help: within `{main::{closure#0} upvar_tys=() {Cell, ()}}`, the trait `Sync` is not implemented for `Cell` + = note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` or `std::sync::atomic::AtomicI32` instead +note: generator is not `Sync` as this value is used across a yield + --> $DIR/generator-print-verbose-2.rs:15:9 + | +LL | let a = Cell::new(2); + | - has type `Cell` which is not `Sync` +LL | yield; + | ^^^^^ yield occurs here, with `a` maybe used later +LL | }); + | - `a` is later dropped here +note: required by a bound in `assert_sync` + --> $DIR/generator-print-verbose-2.rs:9:23 + | +LL | fn assert_sync(_: T) {} + | ^^^^ required by this bound in `assert_sync` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/generator/retain-resume-ref.drop_tracking_mir.stderr b/tests/ui/generator/retain-resume-ref.drop_tracking_mir.stderr deleted file mode 100644 index 736ed1fb60803..0000000000000 --- a/tests/ui/generator/retain-resume-ref.drop_tracking_mir.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0499]: cannot borrow `thing` as mutable more than once at a time - --> $DIR/retain-resume-ref.rs:27:25 - | -LL | gen.as_mut().resume(&mut thing); - | ---------- first mutable borrow occurs here -LL | gen.as_mut().resume(&mut thing); - | ^^^^^^^^^^ second mutable borrow occurs here -LL | -LL | } - | - first borrow might be used here, when `gen` is dropped and runs the destructor for generator - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0499`. diff --git a/tests/ui/generator/retain-resume-ref.no_drop_tracking.stderr b/tests/ui/generator/retain-resume-ref.no_drop_tracking.stderr deleted file mode 100644 index 7122a951e8070..0000000000000 --- a/tests/ui/generator/retain-resume-ref.no_drop_tracking.stderr +++ /dev/null @@ -1,13 +0,0 @@ -error[E0499]: cannot borrow `thing` as mutable more than once at a time - --> $DIR/retain-resume-ref.rs:27:25 - | -LL | gen.as_mut().resume(&mut thing); - | ---------- first mutable borrow occurs here -LL | gen.as_mut().resume(&mut thing); - | ------ ^^^^^^^^^^ second mutable borrow occurs here - | | - | first borrow later used by call - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0499`. diff --git a/tests/ui/generator/retain-resume-ref.rs b/tests/ui/generator/retain-resume-ref.rs index 0050d98d03ba6..0606ea71cdf37 100644 --- a/tests/ui/generator/retain-resume-ref.rs +++ b/tests/ui/generator/retain-resume-ref.rs @@ -1,7 +1,3 @@ -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir - //! This test ensures that a mutable reference cannot be passed as a resume argument twice. #![feature(generators, generator_trait)] diff --git a/tests/ui/generator/retain-resume-ref.drop_tracking.stderr b/tests/ui/generator/retain-resume-ref.stderr similarity index 92% rename from tests/ui/generator/retain-resume-ref.drop_tracking.stderr rename to tests/ui/generator/retain-resume-ref.stderr index 7122a951e8070..e33310d12d9ef 100644 --- a/tests/ui/generator/retain-resume-ref.drop_tracking.stderr +++ b/tests/ui/generator/retain-resume-ref.stderr @@ -1,5 +1,5 @@ error[E0499]: cannot borrow `thing` as mutable more than once at a time - --> $DIR/retain-resume-ref.rs:27:25 + --> $DIR/retain-resume-ref.rs:23:25 | LL | gen.as_mut().resume(&mut thing); | ---------- first mutable borrow occurs here diff --git a/tests/ui/generator/static-mut-reference-across-yield.rs b/tests/ui/generator/static-mut-reference-across-yield.rs index 4784ff49be2e9..0fa6d9cdc77b6 100644 --- a/tests/ui/generator/static-mut-reference-across-yield.rs +++ b/tests/ui/generator/static-mut-reference-across-yield.rs @@ -1,8 +1,6 @@ // build-pass -// revisions: mir thir drop_tracking drop_tracking_mir +// revisions: mir thir // [thir]compile-flags: -Zthir-unsafeck -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir #![feature(generators)] diff --git a/tests/ui/generator/unresolved-ct-var-drop-tracking.rs b/tests/ui/generator/unresolved-ct-var-drop-tracking.rs deleted file mode 100644 index a6589348d301e..0000000000000 --- a/tests/ui/generator/unresolved-ct-var-drop-tracking.rs +++ /dev/null @@ -1,15 +0,0 @@ -// incremental -// edition:2021 -// compile-flags: -Zdrop-tracking - -fn main() { - let _ = async { - let s = std::array::from_fn(|_| ()).await; - //~^ ERROR `[(); _]` is not a future - //~| ERROR type inside `async` block must be known in this context - //~| ERROR type inside `async` block must be known in this context - //~| ERROR type inside `async` block must be known in this context - //~| ERROR type inside `async` block must be known in this context - //~| ERROR type inside `async` block must be known in this context - }; -} diff --git a/tests/ui/generator/unresolved-ct-var-drop-tracking.stderr b/tests/ui/generator/unresolved-ct-var-drop-tracking.stderr deleted file mode 100644 index dec0141ab6717..0000000000000 --- a/tests/ui/generator/unresolved-ct-var-drop-tracking.stderr +++ /dev/null @@ -1,78 +0,0 @@ -error[E0277]: `[(); _]` is not a future - --> $DIR/unresolved-ct-var-drop-tracking.rs:7:45 - | -LL | let s = std::array::from_fn(|_| ()).await; - | ----------------------------^^^^^ - | | || - | | |`[(); _]` is not a future - | | help: remove the `.await` - | this call returns `[(); _]` - | - = help: the trait `Future` is not implemented for `[(); _]` - = note: [(); _] must be a future or must implement `IntoFuture` to be awaited - = note: required for `[(); _]` to implement `IntoFuture` - -error[E0698]: type inside `async` block must be known in this context - --> $DIR/unresolved-ct-var-drop-tracking.rs:7:17 - | -LL | let s = std::array::from_fn(|_| ()).await; - | ^^^^^^^^^^^^^^^^^^^ cannot infer the value of const parameter `N` declared on the function `from_fn` - | -note: the type is part of the `async` block because of this `await` - --> $DIR/unresolved-ct-var-drop-tracking.rs:7:45 - | -LL | let s = std::array::from_fn(|_| ()).await; - | ^^^^^ - -error[E0698]: type inside `async` block must be known in this context - --> $DIR/unresolved-ct-var-drop-tracking.rs:7:17 - | -LL | let s = std::array::from_fn(|_| ()).await; - | ^^^^^^^^^^^^^^^^^^^ cannot infer the value of const parameter `N` declared on the function `from_fn` - | -note: the type is part of the `async` block because of this `await` - --> $DIR/unresolved-ct-var-drop-tracking.rs:7:45 - | -LL | let s = std::array::from_fn(|_| ()).await; - | ^^^^^ - -error[E0698]: type inside `async` block must be known in this context - --> $DIR/unresolved-ct-var-drop-tracking.rs:7:17 - | -LL | let s = std::array::from_fn(|_| ()).await; - | ^^^^^^^^^^^^^^^^^^^ cannot infer the value of const parameter `N` declared on the function `from_fn` - | -note: the type is part of the `async` block because of this `await` - --> $DIR/unresolved-ct-var-drop-tracking.rs:7:45 - | -LL | let s = std::array::from_fn(|_| ()).await; - | ^^^^^ - -error[E0698]: type inside `async` block must be known in this context - --> $DIR/unresolved-ct-var-drop-tracking.rs:7:17 - | -LL | let s = std::array::from_fn(|_| ()).await; - | ^^^^^^^^^^^^^^^^^^^ cannot infer the value of const parameter `N` declared on the function `from_fn` - | -note: the type is part of the `async` block because of this `await` - --> $DIR/unresolved-ct-var-drop-tracking.rs:7:45 - | -LL | let s = std::array::from_fn(|_| ()).await; - | ^^^^^ - -error[E0698]: type inside `async` block must be known in this context - --> $DIR/unresolved-ct-var-drop-tracking.rs:7:17 - | -LL | let s = std::array::from_fn(|_| ()).await; - | ^^^^^^^^^^^^^^^^^^^ cannot infer the value of const parameter `N` declared on the function `from_fn` - | -note: the type is part of the `async` block because of this `await` - --> $DIR/unresolved-ct-var-drop-tracking.rs:7:45 - | -LL | let s = std::array::from_fn(|_| ()).await; - | ^^^^^ - -error: aborting due to 6 previous errors - -Some errors have detailed explanations: E0277, E0698. -For more information about an error, try `rustc --explain E0277`. diff --git a/tests/ui/impl-trait/issue-55872-2.drop_tracking.stderr b/tests/ui/impl-trait/issue-55872-2.drop_tracking.stderr deleted file mode 100644 index 477c964bd40fd..0000000000000 --- a/tests/ui/impl-trait/issue-55872-2.drop_tracking.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias - --> $DIR/issue-55872-2.rs:17:9 - | -LL | async {} - | ^^^^^^^^ - -error: aborting due to previous error - diff --git a/tests/ui/impl-trait/issue-55872-2.drop_tracking_mir.stderr b/tests/ui/impl-trait/issue-55872-2.drop_tracking_mir.stderr deleted file mode 100644 index c14bb5cc9142d..0000000000000 --- a/tests/ui/impl-trait/issue-55872-2.drop_tracking_mir.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error: type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias - --> $DIR/issue-55872-2.rs:17:9 - | -LL | async {} - | ^^^^^^^^ - -error: type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias - --> $DIR/issue-55872-2.rs:17:9 - | -LL | async {} - | ^^^^^^^^ - -error: aborting due to 2 previous errors - diff --git a/tests/ui/impl-trait/issue-55872-2.rs b/tests/ui/impl-trait/issue-55872-2.rs index 7a5cb3b3dfcbe..ec3d924cea775 100644 --- a/tests/ui/impl-trait/issue-55872-2.rs +++ b/tests/ui/impl-trait/issue-55872-2.rs @@ -1,6 +1,3 @@ -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir // edition:2018 #![feature(impl_trait_in_assoc_type)] @@ -16,7 +13,6 @@ impl Bar for S { fn foo() -> Self::E { async {} //~^ ERROR type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias - //[drop_tracking_mir]~^^ ERROR type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias } } diff --git a/tests/ui/impl-trait/issue-55872-2.no_drop_tracking.stderr b/tests/ui/impl-trait/issue-55872-2.stderr similarity index 86% rename from tests/ui/impl-trait/issue-55872-2.no_drop_tracking.stderr rename to tests/ui/impl-trait/issue-55872-2.stderr index 477c964bd40fd..11b8485c8bbfe 100644 --- a/tests/ui/impl-trait/issue-55872-2.no_drop_tracking.stderr +++ b/tests/ui/impl-trait/issue-55872-2.stderr @@ -1,5 +1,5 @@ error: type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias - --> $DIR/issue-55872-2.rs:17:9 + --> $DIR/issue-55872-2.rs:14:9 | LL | async {} | ^^^^^^^^ diff --git a/tests/ui/impl-trait/recursive-impl-trait-type-indirect.drop_tracking_mir.stderr b/tests/ui/impl-trait/recursive-impl-trait-type-indirect.drop_tracking_mir.stderr deleted file mode 100644 index 7cef19c48fe8e..0000000000000 --- a/tests/ui/impl-trait/recursive-impl-trait-type-indirect.drop_tracking_mir.stderr +++ /dev/null @@ -1,147 +0,0 @@ -error[E0720]: cannot resolve opaque type - --> $DIR/recursive-impl-trait-type-indirect.rs:11:22 - | -LL | fn option(i: i32) -> impl Sized { - | ^^^^^^^^^^ recursive opaque type -LL | -LL | if i < 0 { None } else { Some((option(i - 1), i)) } - | ---- ------------------------ returning here with type `Option<(impl Sized, i32)>` - | | - | returning here with type `Option<(impl Sized, i32)>` - -error[E0720]: cannot resolve opaque type - --> $DIR/recursive-impl-trait-type-indirect.rs:16:15 - | -LL | fn tuple() -> impl Sized { - | ^^^^^^^^^^ recursive opaque type -LL | -LL | (tuple(),) - | ---------- returning here with type `(impl Sized,)` - -error[E0720]: cannot resolve opaque type - --> $DIR/recursive-impl-trait-type-indirect.rs:21:15 - | -LL | fn array() -> impl Sized { - | ^^^^^^^^^^ recursive opaque type -LL | -LL | [array()] - | --------- returning here with type `[impl Sized; 1]` - -error[E0720]: cannot resolve opaque type - --> $DIR/recursive-impl-trait-type-indirect.rs:26:13 - | -LL | fn ptr() -> impl Sized { - | ^^^^^^^^^^ recursive opaque type -LL | -LL | &ptr() as *const _ - | ------------------ returning here with type `*const impl Sized` - -error[E0720]: cannot resolve opaque type - --> $DIR/recursive-impl-trait-type-indirect.rs:31:16 - | -LL | fn fn_ptr() -> impl Sized { - | ^^^^^^^^^^ recursive opaque type -LL | -LL | fn_ptr as fn() -> _ - | ------------------- returning here with type `fn() -> impl Sized` - -error[E0720]: cannot resolve opaque type - --> $DIR/recursive-impl-trait-type-indirect.rs:36:25 - | -LL | fn closure_capture() -> impl Sized { - | ^^^^^^^^^^ recursive opaque type -... -LL | / move || { -LL | | x; - | | - closure captures itself here -LL | | } - | |_____- returning here with type `{closure@$DIR/recursive-impl-trait-type-indirect.rs:39:5: 39:12}` - -error[E0720]: cannot resolve opaque type - --> $DIR/recursive-impl-trait-type-indirect.rs:44:29 - | -LL | fn closure_ref_capture() -> impl Sized { - | ^^^^^^^^^^ recursive opaque type -... -LL | / move || { -LL | | &x; - | | - closure captures itself here -LL | | } - | |_____- returning here with type `{closure@$DIR/recursive-impl-trait-type-indirect.rs:47:5: 47:12}` - -error[E0720]: cannot resolve opaque type - --> $DIR/recursive-impl-trait-type-indirect.rs:52:21 - | -LL | fn closure_sig() -> impl Sized { - | ^^^^^^^^^^ recursive opaque type -LL | -LL | || closure_sig() - | ---------------- returning here with type `{closure@$DIR/recursive-impl-trait-type-indirect.rs:54:5: 54:7}` - -error[E0720]: cannot resolve opaque type - --> $DIR/recursive-impl-trait-type-indirect.rs:57:23 - | -LL | fn generator_sig() -> impl Sized { - | ^^^^^^^^^^ recursive opaque type -LL | -LL | || generator_sig() - | ------------------ returning here with type `{closure@$DIR/recursive-impl-trait-type-indirect.rs:59:5: 59:7}` - -error[E0720]: cannot resolve opaque type - --> $DIR/recursive-impl-trait-type-indirect.rs:62:27 - | -LL | fn generator_capture() -> impl Sized { - | ^^^^^^^^^^ recursive opaque type -... -LL | / move || { -LL | | yield; -LL | | x; - | | - generator captures itself here -LL | | } - | |_____- returning here with type `{generator@$DIR/recursive-impl-trait-type-indirect.rs:65:5: 65:12}` - -error[E0720]: cannot resolve opaque type - --> $DIR/recursive-impl-trait-type-indirect.rs:71:35 - | -LL | fn substs_change() -> impl Sized { - | ^^^^^^^^^^ recursive opaque type -LL | -LL | (substs_change::<&T>(),) - | ------------------------ returning here with type `(impl Sized,)` - -error[E0720]: cannot resolve opaque type - --> $DIR/recursive-impl-trait-type-indirect.rs:76:24 - | -LL | fn generator_hold() -> impl Sized { - | ^^^^^^^^^^ recursive opaque type -... -LL | let x = generator_hold(); - | - generator captures itself here - -error[E0720]: cannot resolve opaque type - --> $DIR/recursive-impl-trait-type-indirect.rs:90:26 - | -LL | fn mutual_recursion() -> impl Sync { - | ^^^^^^^^^ recursive opaque type -LL | -LL | mutual_recursion_b() - | -------------------- returning here with type `impl Sized` -... -LL | fn mutual_recursion_b() -> impl Sized { - | ---------- returning this opaque type `impl Sized` - -error[E0720]: cannot resolve opaque type - --> $DIR/recursive-impl-trait-type-indirect.rs:95:28 - | -LL | fn mutual_recursion() -> impl Sync { - | --------- returning this opaque type `impl Sync` -... -LL | fn mutual_recursion_b() -> impl Sized { - | ^^^^^^^^^^ recursive opaque type -LL | -LL | mutual_recursion() - | ------------------ returning here with type `impl Sync` - -error: aborting due to 14 previous errors - -For more information about this error, try `rustc --explain E0720`. diff --git a/tests/ui/impl-trait/recursive-impl-trait-type-indirect.no_drop_tracking.stderr b/tests/ui/impl-trait/recursive-impl-trait-type-indirect.no_drop_tracking.stderr deleted file mode 100644 index 4d4090f27fc39..0000000000000 --- a/tests/ui/impl-trait/recursive-impl-trait-type-indirect.no_drop_tracking.stderr +++ /dev/null @@ -1,152 +0,0 @@ -error[E0720]: cannot resolve opaque type - --> $DIR/recursive-impl-trait-type-indirect.rs:11:22 - | -LL | fn option(i: i32) -> impl Sized { - | ^^^^^^^^^^ recursive opaque type -LL | -LL | if i < 0 { None } else { Some((option(i - 1), i)) } - | ---- ------------------------ returning here with type `Option<(impl Sized, i32)>` - | | - | returning here with type `Option<(impl Sized, i32)>` - -error[E0720]: cannot resolve opaque type - --> $DIR/recursive-impl-trait-type-indirect.rs:16:15 - | -LL | fn tuple() -> impl Sized { - | ^^^^^^^^^^ recursive opaque type -LL | -LL | (tuple(),) - | ---------- returning here with type `(impl Sized,)` - -error[E0720]: cannot resolve opaque type - --> $DIR/recursive-impl-trait-type-indirect.rs:21:15 - | -LL | fn array() -> impl Sized { - | ^^^^^^^^^^ recursive opaque type -LL | -LL | [array()] - | --------- returning here with type `[impl Sized; 1]` - -error[E0720]: cannot resolve opaque type - --> $DIR/recursive-impl-trait-type-indirect.rs:26:13 - | -LL | fn ptr() -> impl Sized { - | ^^^^^^^^^^ recursive opaque type -LL | -LL | &ptr() as *const _ - | ------------------ returning here with type `*const impl Sized` - -error[E0720]: cannot resolve opaque type - --> $DIR/recursive-impl-trait-type-indirect.rs:31:16 - | -LL | fn fn_ptr() -> impl Sized { - | ^^^^^^^^^^ recursive opaque type -LL | -LL | fn_ptr as fn() -> _ - | ------------------- returning here with type `fn() -> impl Sized` - -error[E0720]: cannot resolve opaque type - --> $DIR/recursive-impl-trait-type-indirect.rs:36:25 - | -LL | fn closure_capture() -> impl Sized { - | ^^^^^^^^^^ recursive opaque type -... -LL | / move || { -LL | | x; - | | - closure captures itself here -LL | | } - | |_____- returning here with type `{closure@$DIR/recursive-impl-trait-type-indirect.rs:39:5: 39:12}` - -error[E0720]: cannot resolve opaque type - --> $DIR/recursive-impl-trait-type-indirect.rs:44:29 - | -LL | fn closure_ref_capture() -> impl Sized { - | ^^^^^^^^^^ recursive opaque type -... -LL | / move || { -LL | | &x; - | | - closure captures itself here -LL | | } - | |_____- returning here with type `{closure@$DIR/recursive-impl-trait-type-indirect.rs:47:5: 47:12}` - -error[E0720]: cannot resolve opaque type - --> $DIR/recursive-impl-trait-type-indirect.rs:52:21 - | -LL | fn closure_sig() -> impl Sized { - | ^^^^^^^^^^ recursive opaque type -LL | -LL | || closure_sig() - | ---------------- returning here with type `{closure@$DIR/recursive-impl-trait-type-indirect.rs:54:5: 54:7}` - -error[E0720]: cannot resolve opaque type - --> $DIR/recursive-impl-trait-type-indirect.rs:57:23 - | -LL | fn generator_sig() -> impl Sized { - | ^^^^^^^^^^ recursive opaque type -LL | -LL | || generator_sig() - | ------------------ returning here with type `{closure@$DIR/recursive-impl-trait-type-indirect.rs:59:5: 59:7}` - -error[E0720]: cannot resolve opaque type - --> $DIR/recursive-impl-trait-type-indirect.rs:62:27 - | -LL | fn generator_capture() -> impl Sized { - | ^^^^^^^^^^ recursive opaque type -... -LL | / move || { -LL | | yield; -LL | | x; - | | - generator captures itself here -LL | | } - | |_____- returning here with type `{generator@$DIR/recursive-impl-trait-type-indirect.rs:65:5: 65:12}` - -error[E0720]: cannot resolve opaque type - --> $DIR/recursive-impl-trait-type-indirect.rs:71:35 - | -LL | fn substs_change() -> impl Sized { - | ^^^^^^^^^^ recursive opaque type -LL | -LL | (substs_change::<&T>(),) - | ------------------------ returning here with type `(impl Sized,)` - -error[E0720]: cannot resolve opaque type - --> $DIR/recursive-impl-trait-type-indirect.rs:76:24 - | -LL | fn generator_hold() -> impl Sized { - | ^^^^^^^^^^ recursive opaque type -LL | -LL | / move || { -LL | | let x = generator_hold(); - | | - generator captures itself here -LL | | yield; -LL | | x; -LL | | } - | |_____- returning here with type `{generator@$DIR/recursive-impl-trait-type-indirect.rs:78:5: 78:12}` - -error[E0720]: cannot resolve opaque type - --> $DIR/recursive-impl-trait-type-indirect.rs:90:26 - | -LL | fn mutual_recursion() -> impl Sync { - | ^^^^^^^^^ recursive opaque type -LL | -LL | mutual_recursion_b() - | -------------------- returning here with type `impl Sized` -... -LL | fn mutual_recursion_b() -> impl Sized { - | ---------- returning this opaque type `impl Sized` - -error[E0720]: cannot resolve opaque type - --> $DIR/recursive-impl-trait-type-indirect.rs:95:28 - | -LL | fn mutual_recursion() -> impl Sync { - | --------- returning this opaque type `impl Sync` -... -LL | fn mutual_recursion_b() -> impl Sized { - | ^^^^^^^^^^ recursive opaque type -LL | -LL | mutual_recursion() - | ------------------ returning here with type `impl Sync` - -error: aborting due to 14 previous errors - -For more information about this error, try `rustc --explain E0720`. diff --git a/tests/ui/impl-trait/recursive-impl-trait-type-indirect.rs b/tests/ui/impl-trait/recursive-impl-trait-type-indirect.rs index 630372e13ed58..ffc0cd9d10c34 100644 --- a/tests/ui/impl-trait/recursive-impl-trait-type-indirect.rs +++ b/tests/ui/impl-trait/recursive-impl-trait-type-indirect.rs @@ -1,7 +1,3 @@ -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir - // Test that impl trait does not allow creating recursive types that are // otherwise forbidden. diff --git a/tests/ui/impl-trait/recursive-impl-trait-type-indirect.drop_tracking.stderr b/tests/ui/impl-trait/recursive-impl-trait-type-indirect.stderr similarity index 80% rename from tests/ui/impl-trait/recursive-impl-trait-type-indirect.drop_tracking.stderr rename to tests/ui/impl-trait/recursive-impl-trait-type-indirect.stderr index 4d4090f27fc39..a792e37118560 100644 --- a/tests/ui/impl-trait/recursive-impl-trait-type-indirect.drop_tracking.stderr +++ b/tests/ui/impl-trait/recursive-impl-trait-type-indirect.stderr @@ -1,5 +1,5 @@ error[E0720]: cannot resolve opaque type - --> $DIR/recursive-impl-trait-type-indirect.rs:11:22 + --> $DIR/recursive-impl-trait-type-indirect.rs:7:22 | LL | fn option(i: i32) -> impl Sized { | ^^^^^^^^^^ recursive opaque type @@ -10,7 +10,7 @@ LL | if i < 0 { None } else { Some((option(i - 1), i)) } | returning here with type `Option<(impl Sized, i32)>` error[E0720]: cannot resolve opaque type - --> $DIR/recursive-impl-trait-type-indirect.rs:16:15 + --> $DIR/recursive-impl-trait-type-indirect.rs:12:15 | LL | fn tuple() -> impl Sized { | ^^^^^^^^^^ recursive opaque type @@ -19,7 +19,7 @@ LL | (tuple(),) | ---------- returning here with type `(impl Sized,)` error[E0720]: cannot resolve opaque type - --> $DIR/recursive-impl-trait-type-indirect.rs:21:15 + --> $DIR/recursive-impl-trait-type-indirect.rs:17:15 | LL | fn array() -> impl Sized { | ^^^^^^^^^^ recursive opaque type @@ -28,7 +28,7 @@ LL | [array()] | --------- returning here with type `[impl Sized; 1]` error[E0720]: cannot resolve opaque type - --> $DIR/recursive-impl-trait-type-indirect.rs:26:13 + --> $DIR/recursive-impl-trait-type-indirect.rs:22:13 | LL | fn ptr() -> impl Sized { | ^^^^^^^^^^ recursive opaque type @@ -37,7 +37,7 @@ LL | &ptr() as *const _ | ------------------ returning here with type `*const impl Sized` error[E0720]: cannot resolve opaque type - --> $DIR/recursive-impl-trait-type-indirect.rs:31:16 + --> $DIR/recursive-impl-trait-type-indirect.rs:27:16 | LL | fn fn_ptr() -> impl Sized { | ^^^^^^^^^^ recursive opaque type @@ -46,7 +46,7 @@ LL | fn_ptr as fn() -> _ | ------------------- returning here with type `fn() -> impl Sized` error[E0720]: cannot resolve opaque type - --> $DIR/recursive-impl-trait-type-indirect.rs:36:25 + --> $DIR/recursive-impl-trait-type-indirect.rs:32:25 | LL | fn closure_capture() -> impl Sized { | ^^^^^^^^^^ recursive opaque type @@ -55,10 +55,10 @@ LL | / move || { LL | | x; | | - closure captures itself here LL | | } - | |_____- returning here with type `{closure@$DIR/recursive-impl-trait-type-indirect.rs:39:5: 39:12}` + | |_____- returning here with type `{closure@$DIR/recursive-impl-trait-type-indirect.rs:35:5: 35:12}` error[E0720]: cannot resolve opaque type - --> $DIR/recursive-impl-trait-type-indirect.rs:44:29 + --> $DIR/recursive-impl-trait-type-indirect.rs:40:29 | LL | fn closure_ref_capture() -> impl Sized { | ^^^^^^^^^^ recursive opaque type @@ -67,28 +67,28 @@ LL | / move || { LL | | &x; | | - closure captures itself here LL | | } - | |_____- returning here with type `{closure@$DIR/recursive-impl-trait-type-indirect.rs:47:5: 47:12}` + | |_____- returning here with type `{closure@$DIR/recursive-impl-trait-type-indirect.rs:43:5: 43:12}` error[E0720]: cannot resolve opaque type - --> $DIR/recursive-impl-trait-type-indirect.rs:52:21 + --> $DIR/recursive-impl-trait-type-indirect.rs:48:21 | LL | fn closure_sig() -> impl Sized { | ^^^^^^^^^^ recursive opaque type LL | LL | || closure_sig() - | ---------------- returning here with type `{closure@$DIR/recursive-impl-trait-type-indirect.rs:54:5: 54:7}` + | ---------------- returning here with type `{closure@$DIR/recursive-impl-trait-type-indirect.rs:50:5: 50:7}` error[E0720]: cannot resolve opaque type - --> $DIR/recursive-impl-trait-type-indirect.rs:57:23 + --> $DIR/recursive-impl-trait-type-indirect.rs:53:23 | LL | fn generator_sig() -> impl Sized { | ^^^^^^^^^^ recursive opaque type LL | LL | || generator_sig() - | ------------------ returning here with type `{closure@$DIR/recursive-impl-trait-type-indirect.rs:59:5: 59:7}` + | ------------------ returning here with type `{closure@$DIR/recursive-impl-trait-type-indirect.rs:55:5: 55:7}` error[E0720]: cannot resolve opaque type - --> $DIR/recursive-impl-trait-type-indirect.rs:62:27 + --> $DIR/recursive-impl-trait-type-indirect.rs:58:27 | LL | fn generator_capture() -> impl Sized { | ^^^^^^^^^^ recursive opaque type @@ -98,10 +98,10 @@ LL | | yield; LL | | x; | | - generator captures itself here LL | | } - | |_____- returning here with type `{generator@$DIR/recursive-impl-trait-type-indirect.rs:65:5: 65:12}` + | |_____- returning here with type `{generator@$DIR/recursive-impl-trait-type-indirect.rs:61:5: 61:12}` error[E0720]: cannot resolve opaque type - --> $DIR/recursive-impl-trait-type-indirect.rs:71:35 + --> $DIR/recursive-impl-trait-type-indirect.rs:67:35 | LL | fn substs_change() -> impl Sized { | ^^^^^^^^^^ recursive opaque type @@ -110,7 +110,7 @@ LL | (substs_change::<&T>(),) | ------------------------ returning here with type `(impl Sized,)` error[E0720]: cannot resolve opaque type - --> $DIR/recursive-impl-trait-type-indirect.rs:76:24 + --> $DIR/recursive-impl-trait-type-indirect.rs:72:24 | LL | fn generator_hold() -> impl Sized { | ^^^^^^^^^^ recursive opaque type @@ -121,10 +121,10 @@ LL | | let x = generator_hold(); LL | | yield; LL | | x; LL | | } - | |_____- returning here with type `{generator@$DIR/recursive-impl-trait-type-indirect.rs:78:5: 78:12}` + | |_____- returning here with type `{generator@$DIR/recursive-impl-trait-type-indirect.rs:74:5: 74:12}` error[E0720]: cannot resolve opaque type - --> $DIR/recursive-impl-trait-type-indirect.rs:90:26 + --> $DIR/recursive-impl-trait-type-indirect.rs:86:26 | LL | fn mutual_recursion() -> impl Sync { | ^^^^^^^^^ recursive opaque type @@ -136,7 +136,7 @@ LL | fn mutual_recursion_b() -> impl Sized { | ---------- returning this opaque type `impl Sized` error[E0720]: cannot resolve opaque type - --> $DIR/recursive-impl-trait-type-indirect.rs:95:28 + --> $DIR/recursive-impl-trait-type-indirect.rs:91:28 | LL | fn mutual_recursion() -> impl Sync { | --------- returning this opaque type `impl Sync` diff --git a/tests/ui/lint/must_not_suspend/dedup.drop_tracking_mir.stderr b/tests/ui/lint/must_not_suspend/dedup.drop_tracking_mir.stderr deleted file mode 100644 index cd3baa857abff..0000000000000 --- a/tests/ui/lint/must_not_suspend/dedup.drop_tracking_mir.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error: `No` held across a suspend point, but should not be - --> $DIR/dedup.rs:19:9 - | -LL | let no = No {}; - | ^^ -LL | wheeee(&no).await; - | ----- the value is held across this suspend point - | -help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point - --> $DIR/dedup.rs:19:9 - | -LL | let no = No {}; - | ^^ -note: the lint level is defined here - --> $DIR/dedup.rs:6:9 - | -LL | #![deny(must_not_suspend)] - | ^^^^^^^^^^^^^^^^ - -error: aborting due to previous error - diff --git a/tests/ui/lint/must_not_suspend/dedup.no_drop_tracking.stderr b/tests/ui/lint/must_not_suspend/dedup.no_drop_tracking.stderr deleted file mode 100644 index aff2f7c32b96d..0000000000000 --- a/tests/ui/lint/must_not_suspend/dedup.no_drop_tracking.stderr +++ /dev/null @@ -1,33 +0,0 @@ -error: `No` held across a suspend point, but should not be - --> $DIR/dedup.rs:19:9 - | -LL | let no = No {}; - | ^^ -LL | wheeee(&no).await; - | ----- the value is held across this suspend point - | -help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point - --> $DIR/dedup.rs:19:9 - | -LL | let no = No {}; - | ^^ -note: the lint level is defined here - --> $DIR/dedup.rs:6:9 - | -LL | #![deny(must_not_suspend)] - | ^^^^^^^^^^^^^^^^ - -error: `No` held across a suspend point, but should not be - --> $DIR/dedup.rs:20:13 - | -LL | wheeee(&no).await; - | ^^ ----- the value is held across this suspend point - | -help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point - --> $DIR/dedup.rs:20:13 - | -LL | wheeee(&no).await; - | ^^ - -error: aborting due to 2 previous errors - diff --git a/tests/ui/lint/must_not_suspend/dedup.rs b/tests/ui/lint/must_not_suspend/dedup.rs index 96bdb7715b183..81a08579bb7bc 100644 --- a/tests/ui/lint/must_not_suspend/dedup.rs +++ b/tests/ui/lint/must_not_suspend/dedup.rs @@ -1,6 +1,3 @@ -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir // edition:2018 #![feature(must_not_suspend)] #![deny(must_not_suspend)] @@ -16,9 +13,7 @@ async fn wheeee(t: T) { } async fn yes() { - let no = No {}; //~ ERROR `No` held across - wheeee(&no).await; //[no_drop_tracking]~ ERROR `No` held across - drop(no); + wheeee(&No {}).await; //~ ERROR `No` held across } fn main() { diff --git a/tests/ui/lint/must_not_suspend/dedup.drop_tracking.stderr b/tests/ui/lint/must_not_suspend/dedup.stderr similarity index 55% rename from tests/ui/lint/must_not_suspend/dedup.drop_tracking.stderr rename to tests/ui/lint/must_not_suspend/dedup.stderr index cd3baa857abff..6925b1640b296 100644 --- a/tests/ui/lint/must_not_suspend/dedup.drop_tracking.stderr +++ b/tests/ui/lint/must_not_suspend/dedup.stderr @@ -1,18 +1,16 @@ error: `No` held across a suspend point, but should not be - --> $DIR/dedup.rs:19:9 + --> $DIR/dedup.rs:16:13 | -LL | let no = No {}; - | ^^ -LL | wheeee(&no).await; - | ----- the value is held across this suspend point +LL | wheeee(&No {}).await; + | ^^^^^ ----- the value is held across this suspend point | help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point - --> $DIR/dedup.rs:19:9 + --> $DIR/dedup.rs:16:13 | -LL | let no = No {}; - | ^^ +LL | wheeee(&No {}).await; + | ^^^^^ note: the lint level is defined here - --> $DIR/dedup.rs:6:9 + --> $DIR/dedup.rs:3:9 | LL | #![deny(must_not_suspend)] | ^^^^^^^^^^^^^^^^ diff --git a/tests/ui/lint/must_not_suspend/ref-drop-tracking.rs b/tests/ui/lint/must_not_suspend/ref-drop-tracking.rs deleted file mode 100644 index 1bc4a38125753..0000000000000 --- a/tests/ui/lint/must_not_suspend/ref-drop-tracking.rs +++ /dev/null @@ -1,30 +0,0 @@ -// edition:2018 -// compile-flags: -Zdrop-tracking -#![feature(must_not_suspend)] -#![deny(must_not_suspend)] - -#[must_not_suspend = "You gotta use Umm's, ya know?"] -struct Umm { - i: i64 -} - -struct Bar { - u: Umm, -} - -async fn other() {} - -impl Bar { - async fn uhoh(&mut self) { - let guard = &mut self.u; //~ ERROR `Umm` held across - - other().await; - - *guard = Umm { - i: 2 - } - } -} - -fn main() { -} diff --git a/tests/ui/lint/must_not_suspend/ref-drop-tracking.stderr b/tests/ui/lint/must_not_suspend/ref-drop-tracking.stderr deleted file mode 100644 index 348880b9c9f31..0000000000000 --- a/tests/ui/lint/must_not_suspend/ref-drop-tracking.stderr +++ /dev/null @@ -1,27 +0,0 @@ -error: reference to `Umm` held across a suspend point, but should not be - --> $DIR/ref-drop-tracking.rs:19:13 - | -LL | let guard = &mut self.u; - | ^^^^^ -LL | -LL | other().await; - | ----- the value is held across this suspend point - | -note: You gotta use Umm's, ya know? - --> $DIR/ref-drop-tracking.rs:19:13 - | -LL | let guard = &mut self.u; - | ^^^^^ -help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point - --> $DIR/ref-drop-tracking.rs:19:13 - | -LL | let guard = &mut self.u; - | ^^^^^ -note: the lint level is defined here - --> $DIR/ref-drop-tracking.rs:4:9 - | -LL | #![deny(must_not_suspend)] - | ^^^^^^^^^^^^^^^^ - -error: aborting due to previous error - diff --git a/tests/ui/lint/must_not_suspend/ref.drop_tracking.stderr b/tests/ui/lint/must_not_suspend/ref.drop_tracking.stderr deleted file mode 100644 index fb18c2be9cb3a..0000000000000 --- a/tests/ui/lint/must_not_suspend/ref.drop_tracking.stderr +++ /dev/null @@ -1,27 +0,0 @@ -error: reference to `Umm` held across a suspend point, but should not be - --> $DIR/ref.rs:22:13 - | -LL | let guard = &mut self.u; - | ^^^^^ -LL | -LL | other().await; - | ----- the value is held across this suspend point - | -note: You gotta use Umm's, ya know? - --> $DIR/ref.rs:22:13 - | -LL | let guard = &mut self.u; - | ^^^^^ -help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point - --> $DIR/ref.rs:22:13 - | -LL | let guard = &mut self.u; - | ^^^^^ -note: the lint level is defined here - --> $DIR/ref.rs:7:9 - | -LL | #![deny(must_not_suspend)] - | ^^^^^^^^^^^^^^^^ - -error: aborting due to previous error - diff --git a/tests/ui/lint/must_not_suspend/ref.drop_tracking_mir.stderr b/tests/ui/lint/must_not_suspend/ref.drop_tracking_mir.stderr deleted file mode 100644 index fb18c2be9cb3a..0000000000000 --- a/tests/ui/lint/must_not_suspend/ref.drop_tracking_mir.stderr +++ /dev/null @@ -1,27 +0,0 @@ -error: reference to `Umm` held across a suspend point, but should not be - --> $DIR/ref.rs:22:13 - | -LL | let guard = &mut self.u; - | ^^^^^ -LL | -LL | other().await; - | ----- the value is held across this suspend point - | -note: You gotta use Umm's, ya know? - --> $DIR/ref.rs:22:13 - | -LL | let guard = &mut self.u; - | ^^^^^ -help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point - --> $DIR/ref.rs:22:13 - | -LL | let guard = &mut self.u; - | ^^^^^ -note: the lint level is defined here - --> $DIR/ref.rs:7:9 - | -LL | #![deny(must_not_suspend)] - | ^^^^^^^^^^^^^^^^ - -error: aborting due to previous error - diff --git a/tests/ui/lint/must_not_suspend/ref.rs b/tests/ui/lint/must_not_suspend/ref.rs index d05dcb83ac57c..3b6ef39c9fe0d 100644 --- a/tests/ui/lint/must_not_suspend/ref.rs +++ b/tests/ui/lint/must_not_suspend/ref.rs @@ -1,8 +1,4 @@ // edition:2018 -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir - #![feature(must_not_suspend)] #![deny(must_not_suspend)] @@ -23,7 +19,6 @@ impl Bar { other().await; - let _g = &*guard; *guard = Umm { i: 2 } } } diff --git a/tests/ui/lint/must_not_suspend/ref.no_drop_tracking.stderr b/tests/ui/lint/must_not_suspend/ref.stderr similarity index 88% rename from tests/ui/lint/must_not_suspend/ref.no_drop_tracking.stderr rename to tests/ui/lint/must_not_suspend/ref.stderr index 6976dd3499194..148af00a3d22a 100644 --- a/tests/ui/lint/must_not_suspend/ref.no_drop_tracking.stderr +++ b/tests/ui/lint/must_not_suspend/ref.stderr @@ -1,5 +1,5 @@ error: `Umm` held across a suspend point, but should not be - --> $DIR/ref.rs:22:26 + --> $DIR/ref.rs:18:26 | LL | let guard = &mut self.u; | ^^^^^^ @@ -8,17 +8,17 @@ LL | other().await; | ----- the value is held across this suspend point | note: You gotta use Umm's, ya know? - --> $DIR/ref.rs:22:26 + --> $DIR/ref.rs:18:26 | LL | let guard = &mut self.u; | ^^^^^^ help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point - --> $DIR/ref.rs:22:26 + --> $DIR/ref.rs:18:26 | LL | let guard = &mut self.u; | ^^^^^^ note: the lint level is defined here - --> $DIR/ref.rs:7:9 + --> $DIR/ref.rs:3:9 | LL | #![deny(must_not_suspend)] | ^^^^^^^^^^^^^^^^ diff --git a/tests/ui/lint/must_not_suspend/trait.drop_tracking_mir.stderr b/tests/ui/lint/must_not_suspend/trait.drop_tracking_mir.stderr deleted file mode 100644 index 8c8ad1f3788da..0000000000000 --- a/tests/ui/lint/must_not_suspend/trait.drop_tracking_mir.stderr +++ /dev/null @@ -1,37 +0,0 @@ -error: implementer of `Wow` held across a suspend point, but should not be - --> $DIR/trait.rs:24:9 - | -LL | let _guard1 = r#impl(); - | ^^^^^^^ -... -LL | other().await; - | ----- the value is held across this suspend point - | -help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point - --> $DIR/trait.rs:24:9 - | -LL | let _guard1 = r#impl(); - | ^^^^^^^ -note: the lint level is defined here - --> $DIR/trait.rs:6:9 - | -LL | #![deny(must_not_suspend)] - | ^^^^^^^^^^^^^^^^ - -error: boxed `Wow` trait object held across a suspend point, but should not be - --> $DIR/trait.rs:25:9 - | -LL | let _guard2 = r#dyn(); - | ^^^^^^^ -LL | -LL | other().await; - | ----- the value is held across this suspend point - | -help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point - --> $DIR/trait.rs:25:9 - | -LL | let _guard2 = r#dyn(); - | ^^^^^^^ - -error: aborting due to 2 previous errors - diff --git a/tests/ui/lint/must_not_suspend/trait.no_drop_tracking.stderr b/tests/ui/lint/must_not_suspend/trait.no_drop_tracking.stderr deleted file mode 100644 index 8c8ad1f3788da..0000000000000 --- a/tests/ui/lint/must_not_suspend/trait.no_drop_tracking.stderr +++ /dev/null @@ -1,37 +0,0 @@ -error: implementer of `Wow` held across a suspend point, but should not be - --> $DIR/trait.rs:24:9 - | -LL | let _guard1 = r#impl(); - | ^^^^^^^ -... -LL | other().await; - | ----- the value is held across this suspend point - | -help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point - --> $DIR/trait.rs:24:9 - | -LL | let _guard1 = r#impl(); - | ^^^^^^^ -note: the lint level is defined here - --> $DIR/trait.rs:6:9 - | -LL | #![deny(must_not_suspend)] - | ^^^^^^^^^^^^^^^^ - -error: boxed `Wow` trait object held across a suspend point, but should not be - --> $DIR/trait.rs:25:9 - | -LL | let _guard2 = r#dyn(); - | ^^^^^^^ -LL | -LL | other().await; - | ----- the value is held across this suspend point - | -help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point - --> $DIR/trait.rs:25:9 - | -LL | let _guard2 = r#dyn(); - | ^^^^^^^ - -error: aborting due to 2 previous errors - diff --git a/tests/ui/lint/must_not_suspend/trait.rs b/tests/ui/lint/must_not_suspend/trait.rs index cc3ae298dbba7..6c911cb4b0f09 100644 --- a/tests/ui/lint/must_not_suspend/trait.rs +++ b/tests/ui/lint/must_not_suspend/trait.rs @@ -1,6 +1,3 @@ -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir // edition:2018 #![feature(must_not_suspend)] #![deny(must_not_suspend)] @@ -25,9 +22,6 @@ pub async fn uhoh() { let _guard2 = r#dyn(); //~ ERROR boxed `Wow` trait object held across other().await; - - drop(_guard1); - drop(_guard2); } fn main() { diff --git a/tests/ui/lint/must_not_suspend/trait.drop_tracking.stderr b/tests/ui/lint/must_not_suspend/trait.stderr similarity index 88% rename from tests/ui/lint/must_not_suspend/trait.drop_tracking.stderr rename to tests/ui/lint/must_not_suspend/trait.stderr index 8c8ad1f3788da..2c03f8e822dfd 100644 --- a/tests/ui/lint/must_not_suspend/trait.drop_tracking.stderr +++ b/tests/ui/lint/must_not_suspend/trait.stderr @@ -1,5 +1,5 @@ error: implementer of `Wow` held across a suspend point, but should not be - --> $DIR/trait.rs:24:9 + --> $DIR/trait.rs:21:9 | LL | let _guard1 = r#impl(); | ^^^^^^^ @@ -8,18 +8,18 @@ LL | other().await; | ----- the value is held across this suspend point | help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point - --> $DIR/trait.rs:24:9 + --> $DIR/trait.rs:21:9 | LL | let _guard1 = r#impl(); | ^^^^^^^ note: the lint level is defined here - --> $DIR/trait.rs:6:9 + --> $DIR/trait.rs:3:9 | LL | #![deny(must_not_suspend)] | ^^^^^^^^^^^^^^^^ error: boxed `Wow` trait object held across a suspend point, but should not be - --> $DIR/trait.rs:25:9 + --> $DIR/trait.rs:22:9 | LL | let _guard2 = r#dyn(); | ^^^^^^^ @@ -28,7 +28,7 @@ LL | other().await; | ----- the value is held across this suspend point | help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point - --> $DIR/trait.rs:25:9 + --> $DIR/trait.rs:22:9 | LL | let _guard2 = r#dyn(); | ^^^^^^^ diff --git a/tests/ui/lint/must_not_suspend/unit.drop_tracking.stderr b/tests/ui/lint/must_not_suspend/unit.drop_tracking.stderr deleted file mode 100644 index e24cffdd0df43..0000000000000 --- a/tests/ui/lint/must_not_suspend/unit.drop_tracking.stderr +++ /dev/null @@ -1,26 +0,0 @@ -error: `Umm` held across a suspend point, but should not be - --> $DIR/unit.rs:22:9 - | -LL | let _guard = bar(); - | ^^^^^^ -LL | other().await; - | ----- the value is held across this suspend point - | -note: You gotta use Umm's, ya know? - --> $DIR/unit.rs:22:9 - | -LL | let _guard = bar(); - | ^^^^^^ -help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point - --> $DIR/unit.rs:22:9 - | -LL | let _guard = bar(); - | ^^^^^^ -note: the lint level is defined here - --> $DIR/unit.rs:6:9 - | -LL | #![deny(must_not_suspend)] - | ^^^^^^^^^^^^^^^^ - -error: aborting due to previous error - diff --git a/tests/ui/lint/must_not_suspend/unit.no_drop_tracking.stderr b/tests/ui/lint/must_not_suspend/unit.no_drop_tracking.stderr deleted file mode 100644 index e24cffdd0df43..0000000000000 --- a/tests/ui/lint/must_not_suspend/unit.no_drop_tracking.stderr +++ /dev/null @@ -1,26 +0,0 @@ -error: `Umm` held across a suspend point, but should not be - --> $DIR/unit.rs:22:9 - | -LL | let _guard = bar(); - | ^^^^^^ -LL | other().await; - | ----- the value is held across this suspend point - | -note: You gotta use Umm's, ya know? - --> $DIR/unit.rs:22:9 - | -LL | let _guard = bar(); - | ^^^^^^ -help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point - --> $DIR/unit.rs:22:9 - | -LL | let _guard = bar(); - | ^^^^^^ -note: the lint level is defined here - --> $DIR/unit.rs:6:9 - | -LL | #![deny(must_not_suspend)] - | ^^^^^^^^^^^^^^^^ - -error: aborting due to previous error - diff --git a/tests/ui/lint/must_not_suspend/unit.rs b/tests/ui/lint/must_not_suspend/unit.rs index fbc51b366817c..d3a19f704324d 100644 --- a/tests/ui/lint/must_not_suspend/unit.rs +++ b/tests/ui/lint/must_not_suspend/unit.rs @@ -1,6 +1,3 @@ -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir // edition:2018 #![feature(must_not_suspend)] #![deny(must_not_suspend)] @@ -10,6 +7,7 @@ struct Umm { i: i64 } + fn bar() -> Umm { Umm { i: 1 @@ -21,7 +19,6 @@ async fn other() {} pub async fn uhoh() { let _guard = bar(); //~ ERROR `Umm` held across other().await; - drop(_guard); } fn main() { diff --git a/tests/ui/lint/must_not_suspend/unit.drop_tracking_mir.stderr b/tests/ui/lint/must_not_suspend/unit.stderr similarity index 86% rename from tests/ui/lint/must_not_suspend/unit.drop_tracking_mir.stderr rename to tests/ui/lint/must_not_suspend/unit.stderr index e24cffdd0df43..11c95c1464ae1 100644 --- a/tests/ui/lint/must_not_suspend/unit.drop_tracking_mir.stderr +++ b/tests/ui/lint/must_not_suspend/unit.stderr @@ -1,5 +1,5 @@ error: `Umm` held across a suspend point, but should not be - --> $DIR/unit.rs:22:9 + --> $DIR/unit.rs:20:9 | LL | let _guard = bar(); | ^^^^^^ @@ -7,17 +7,17 @@ LL | other().await; | ----- the value is held across this suspend point | note: You gotta use Umm's, ya know? - --> $DIR/unit.rs:22:9 + --> $DIR/unit.rs:20:9 | LL | let _guard = bar(); | ^^^^^^ help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point - --> $DIR/unit.rs:22:9 + --> $DIR/unit.rs:20:9 | LL | let _guard = bar(); | ^^^^^^ note: the lint level is defined here - --> $DIR/unit.rs:6:9 + --> $DIR/unit.rs:3:9 | LL | #![deny(must_not_suspend)] | ^^^^^^^^^^^^^^^^ diff --git a/tests/ui/lint/must_not_suspend/warn.drop_tracking.stderr b/tests/ui/lint/must_not_suspend/warn.drop_tracking.stderr deleted file mode 100644 index 4f7b40a5efed1..0000000000000 --- a/tests/ui/lint/must_not_suspend/warn.drop_tracking.stderr +++ /dev/null @@ -1,26 +0,0 @@ -warning: `Umm` held across a suspend point, but should not be - --> $DIR/warn.rs:24:9 - | -LL | let _guard = bar(); - | ^^^^^^ -LL | other().await; - | ----- the value is held across this suspend point - | -note: You gotta use Umm's, ya know? - --> $DIR/warn.rs:24:9 - | -LL | let _guard = bar(); - | ^^^^^^ -help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point - --> $DIR/warn.rs:24:9 - | -LL | let _guard = bar(); - | ^^^^^^ -note: the lint level is defined here - --> $DIR/warn.rs:7:9 - | -LL | #![warn(must_not_suspend)] - | ^^^^^^^^^^^^^^^^ - -warning: 1 warning emitted - diff --git a/tests/ui/lint/must_not_suspend/warn.no_drop_tracking.stderr b/tests/ui/lint/must_not_suspend/warn.no_drop_tracking.stderr deleted file mode 100644 index 4f7b40a5efed1..0000000000000 --- a/tests/ui/lint/must_not_suspend/warn.no_drop_tracking.stderr +++ /dev/null @@ -1,26 +0,0 @@ -warning: `Umm` held across a suspend point, but should not be - --> $DIR/warn.rs:24:9 - | -LL | let _guard = bar(); - | ^^^^^^ -LL | other().await; - | ----- the value is held across this suspend point - | -note: You gotta use Umm's, ya know? - --> $DIR/warn.rs:24:9 - | -LL | let _guard = bar(); - | ^^^^^^ -help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point - --> $DIR/warn.rs:24:9 - | -LL | let _guard = bar(); - | ^^^^^^ -note: the lint level is defined here - --> $DIR/warn.rs:7:9 - | -LL | #![warn(must_not_suspend)] - | ^^^^^^^^^^^^^^^^ - -warning: 1 warning emitted - diff --git a/tests/ui/lint/must_not_suspend/warn.rs b/tests/ui/lint/must_not_suspend/warn.rs index 5a4863169ea35..7fdea66a23517 100644 --- a/tests/ui/lint/must_not_suspend/warn.rs +++ b/tests/ui/lint/must_not_suspend/warn.rs @@ -1,6 +1,3 @@ -// revisions: no_drop_tracking drop_tracking drop_tracking_mir -// [drop_tracking] compile-flags: -Zdrop-tracking -// [drop_tracking_mir] compile-flags: -Zdrop-tracking-mir // edition:2018 // run-pass #![feature(must_not_suspend)] @@ -23,7 +20,6 @@ async fn other() {} pub async fn uhoh() { let _guard = bar(); //~ WARNING `Umm` held across other().await; - drop(_guard); } fn main() { diff --git a/tests/ui/lint/must_not_suspend/warn.drop_tracking_mir.stderr b/tests/ui/lint/must_not_suspend/warn.stderr similarity index 86% rename from tests/ui/lint/must_not_suspend/warn.drop_tracking_mir.stderr rename to tests/ui/lint/must_not_suspend/warn.stderr index 4f7b40a5efed1..194433552cf1a 100644 --- a/tests/ui/lint/must_not_suspend/warn.drop_tracking_mir.stderr +++ b/tests/ui/lint/must_not_suspend/warn.stderr @@ -1,5 +1,5 @@ warning: `Umm` held across a suspend point, but should not be - --> $DIR/warn.rs:24:9 + --> $DIR/warn.rs:21:9 | LL | let _guard = bar(); | ^^^^^^ @@ -7,17 +7,17 @@ LL | other().await; | ----- the value is held across this suspend point | note: You gotta use Umm's, ya know? - --> $DIR/warn.rs:24:9 + --> $DIR/warn.rs:21:9 | LL | let _guard = bar(); | ^^^^^^ help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point - --> $DIR/warn.rs:24:9 + --> $DIR/warn.rs:21:9 | LL | let _guard = bar(); | ^^^^^^ note: the lint level is defined here - --> $DIR/warn.rs:7:9 + --> $DIR/warn.rs:4:9 | LL | #![warn(must_not_suspend)] | ^^^^^^^^^^^^^^^^