Revert duplication of tests.

This commit is contained in:
Camille GILLOT 2023-05-07 18:38:52 +00:00
parent ff03204365
commit a626caaad9
178 changed files with 439 additions and 4891 deletions

View File

@ -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<Output = ()>`, 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: 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<bool>) {
| - within this `impl Future<Output = ()>`
...
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<Output = ()>`, 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>(_: T) -> ! {
| _____________________________^
LL | | panic!()
LL | | }
| |_^
= note: required because it captures the following types: `ResumeTy`, `Option<bool>`, `impl Future<Output = !>`, `()`
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<bool>) {
| ________________________________^
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: 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<Output = ()>`, 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: 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<Output = ()>`, 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: 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`.

View File

@ -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<Output = ()>`, 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: 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<bool>) {
| - within this `impl Future<Output = ()>`
...
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<Output = ()>`, 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>(_: T) -> ! {
| _____________________________^
LL | | panic!()
LL | | }
| |_^
= note: required because it captures the following types: `ResumeTy`, `Option<bool>`, `impl Future<Output = !>`, `()`
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<bool>) {
| ________________________________^
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: 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<Output = ()>`, 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: 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<Output = ()>`, 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: 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`.

View File

@ -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<Output = ()>`, 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: 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<bool>) {
| - within this `impl Future<Output = ()>`
...
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<Output = ()>`, 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>(_: T) -> ! {
| _____________________________^
LL | | panic!()
LL | | }
| |_^
= note: required because it captures the following types: `impl Future<Output = !>`
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<bool>) {
| ________________________________^
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: 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<Output = ()>`, 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: 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<Output = ()>`, 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: 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`.

View File

@ -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<Output = ()>`, 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: 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<Output = ()>`, 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: 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<Output = ()>`, 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: 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<Output = ()>`, 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: Send>(_: T) {}
| ^^^^ required by this bound in `is_send`
error: aborting due to 4 previous errors

View File

@ -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;

View File

@ -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<Output = ()>`, 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: 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<Output = ()>`, 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: 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<Output = ()>`, 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: 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<Output = ()>`, 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: Send>(_: T) {}
| ^^^^ required by this bound in `is_send`

View File

@ -1,24 +0,0 @@
error[E0277]: `()` is not a future
--> $DIR/async-error-span.rs:10:20
|
LL | fn get_future() -> impl Future<Output = ()> {
| ^^^^^^^^^^^^^^^^^^^^^^^^ `()` 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`.

View File

@ -1,25 +0,0 @@
error[E0277]: `()` is not a future
--> $DIR/async-error-span.rs:10:20
|
LL | fn get_future() -> impl Future<Output = ()> {
| ^^^^^^^^^^^^^^^^^^^^^^^^ `()` 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`.

View File

@ -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<Output = ()> {
}
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;
}

View File

@ -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<Output = ()> {
| ^^^^^^^^^^^^^^^^^^^^^^^^ `()` is not a future
@ -8,13 +8,13 @@ LL | fn get_future() -> impl Future<Output = ()> {
= 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;
| ^^^^^

View File

@ -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<Output = ()>`, 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<impl Debug>` 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<Output = ()>`, 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

View File

@ -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<Output = ()>`, 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<Output = ()>`, 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<Output = ()>`, 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<Output = ()>`, 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<Output = ()>`, 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

View File

@ -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
}

View File

@ -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<Output = ()>`, 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<impl Debug>` 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<Output = ()>`, 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`

View File

@ -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 <https://github.com/rust-lang/rust/issues/48055> for more information
= note: `#[warn(incomplete_features)]` on by default
error[E0277]: the size for values of type `(dyn Future<Output = T> + Unpin + 'static)` cannot be known at compilation time
--> $DIR/awaiting-unsized-param.rs:10:17
|
LL | async fn bug<T>(mut f: dyn Future<Output = T> + Unpin) -> T {
| ^^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `(dyn Future<Output = T> + 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`.

View File

@ -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

View File

@ -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<Output = T> + 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<T>(mut f: dyn Future<Output = T> + Unpin) -> T {
| ^^^^^ doesn't have a size known at compile-time

View File

@ -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();

View File

@ -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;

View File

@ -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<Output = ()>`, the trait `Send` is not implemented for `Rc<String>`
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: Send>(_: T) {}
| ^^^^ required by this bound in `assert_send`
error: aborting due to previous error

View File

@ -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<Output = ()>`, the trait `Send` is not implemented for `Rc<String>`
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: Send>(_: T) {}
| ^^^^ required by this bound in `assert_send`
error: aborting due to previous error

View File

@ -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<Output = ()>`, the trait `Send` is not implemented for `Rc<String>`
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: Send>(_: T) {}
| ^^^^ required by this bound in `assert_send`
error: aborting due to previous error

View File

@ -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)]

View File

@ -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<Output = ()>`, the trait `Send` is not implemented for `Rc<String>`
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: Send>(_: T) {}
| ^^^^ required by this bound in `assert_send`

View File

@ -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)]

View File

@ -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<Output = ()>`, the trait `Send` is not implemented for `Rc<String>`
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: Send>(_: T) {}
| ^^^^ required by this bound in `assert_send`
error: aborting due to previous error

View File

@ -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

View File

@ -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<Output = ()>`, the trait `Send` is not implemented for `Rc<String>`
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: Send>(_: T) {}
| ^^^^ required by this bound in `assert_send`

View File

@ -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

View File

@ -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<Output = ()>`, 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: Sync>(t: T) { }
| ^^^^ required by this bound in `is_sync`
error: aborting due to previous error

View File

@ -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<Output = ()>`, 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: Sync>(t: T) { }
| ^^^^ required by this bound in `is_sync`
error: aborting due to previous error

View File

@ -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: Sync>(t: T) { }
async fn bar() {
let x = Foo;
baz().await;
drop(x);
}
async fn baz() { }

View File

@ -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<Output = ()>`, 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: Sync>(t: T) { }
| ^^^^ required by this bound in `is_sync`

View File

@ -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<Foo>: 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<Foo>` 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: Send>(t: T) { }
| ^^^^ required by this bound in `is_send`
help: consider borrowing here
|
LL | is_send(&bar());
| +
error: aborting due to previous error

View File

@ -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<Foo>: 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<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
|
LL | fn is_send<T: Send>(t: T) { }
| ^^^^ required by this bound in `is_send`
help: consider borrowing here
|
LL | is_send(&bar());
| +
error: aborting due to previous error

View File

@ -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: Send>(t: T) { }
async fn bar() {
let x = Box::new(Foo);
let x = Foo;
baz().await;
}

View File

@ -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<Foo>: Send` is not satisfied
= help: within `impl Future<Output = ()>`, 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<Foo>` 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: Send>(t: T) { }
| ^^^^ required by this bound in `is_send`
help: consider borrowing here
|
LL | is_send(&bar());
| +
error: aborting due to previous error

View File

@ -1,27 +0,0 @@
error[E0277]: the trait bound `Foo: Qux` is not satisfied in `impl Future<Output = ()>`
--> $DIR/issue-64130-3-other.rs:27:12
|
LL | async fn bar() {
| - within this `impl Future<Output = ()>`
...
LL | is_qux(bar());
| ^^^^^ within `impl Future<Output = ()>`, 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<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
|
LL | fn is_qux<T: 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`.

View File

@ -1,25 +0,0 @@
error[E0277]: the trait bound `Foo: Qux` is not satisfied in `impl Future<Output = ()>`
--> $DIR/issue-64130-3-other.rs:27:12
|
LL | async fn bar() {
| - within this `impl Future<Output = ()>`
...
LL | is_qux(bar());
| ^^^^^ within `impl Future<Output = ()>`, 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<Foo>` 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: 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`.

View File

@ -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: Qux>(t: T) {}
async fn bar() {
let x = Box::new(Foo);
let x = Foo;
baz().await;
}

View File

@ -1,5 +1,5 @@
error[E0277]: the trait bound `Foo: Qux` is not satisfied in `impl Future<Output = ()>`
--> $DIR/issue-64130-3-other.rs:27:12
--> $DIR/issue-64130-3-other.rs:24:12
|
LL | async fn bar() {
| - within this `impl Future<Output = ()>`
@ -8,16 +8,16 @@ LL | is_qux(bar());
| ^^^^^ within `impl Future<Output = ()>`, 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<Foo>` 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: Qux>(t: T) {}
| ^^^ required by this bound in `is_qux`

View File

@ -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

View File

@ -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

View File

@ -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() {

View File

@ -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: Send>(_: T) {}
| ^^^^ required by this bound in `spawn`
error: aborting due to previous error

View File

@ -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: Send>(_: T) {}
| ^^^^ required by this bound in `spawn`
error: aborting due to previous error

View File

@ -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: Send>(_: T) {}
| ^^^^ required by this bound in `spawn`
error: aborting due to previous error

View File

@ -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);
});
}

View File

@ -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: Send>(_: T) {}
| ^^^^ required by this bound in `spawn`
error: aborting due to previous error

View File

@ -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<i32>`
= 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<Output = Arc<RefCell<i32>>>`, 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<i32>`
= 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<Output = Arc<RefCell<i32>>>`, 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<i32>` cannot be shared between threads safely
--> $DIR/issue-68112.rs:65:18
|
LL | require_send(send_fut);
| ------------ ^^^^^^^^ `RefCell<i32>` cannot be shared between threads safely
| |
| required by a bound introduced by this call
|
= help: the trait `Sync` is not implemented for `RefCell<i32>`
= note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead
= note: required for `Arc<RefCell<i32>>` 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) -> T {
| _______________________________^
LL | | t
LL | | }
| |_^
note: required because it appears within the type `impl Future<Output = Arc<RefCell<i32>>>`
--> $DIR/issue-68112.rs:53:31
|
LL | fn make_non_send_future2() -> impl Future<Output = Arc<RefCell<i32>>> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: required because it captures the following types: `ResumeTy`, `impl Future<Output = Arc<RefCell<i32>>>`, `()`, `Ready<i32>`
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`.

View File

@ -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<i32>`
= 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<Output = Arc<RefCell<i32>>>`, 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<i32>`
= 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<Output = Arc<RefCell<i32>>>`, 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<i32>` cannot be shared between threads safely
--> $DIR/issue-68112.rs:65:5
|
LL | require_send(send_fut);
| ^^^^^^^^^^^^ `RefCell<i32>` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `RefCell<i32>`
= note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead
= note: required for `Arc<RefCell<i32>>` 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) -> T {
| _______________________________^
LL | | t
LL | | }
| |_^
note: required because it appears within the type `impl Future<Output = Arc<RefCell<i32>>>`
--> $DIR/issue-68112.rs:53:31
|
LL | fn make_non_send_future2() -> impl Future<Output = Arc<RefCell<i32>>> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: required because it captures the following types: `impl Future<Output = Arc<RefCell<i32>>>`, `Ready<i32>`
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`.

View File

@ -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<T>(Option<T>);
impl<T: Unpin> Future for Ready<T> {
impl<T> Future for Ready<T> {
type Output = T;
fn poll(mut self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<T> {
Poll::Ready(self.0.take().unwrap())

View File

@ -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<i32>`
= 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<Output = Arc<RefCell<i32>>>`, 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<i32>`
= 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<Output = Arc<RefCell<i32>>>`, 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<i32>` cannot be shared between threads safely
--> $DIR/issue-68112.rs:65:18
--> $DIR/issue-68112.rs:62:18
|
LL | require_send(send_fut);
| ------------ ^^^^^^^^ `RefCell<i32>` 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<RefCell<i32>>` 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) -> T {
| _______________________________^
@ -56,13 +56,13 @@ LL | | t
LL | | }
| |_^
note: required because it appears within the type `impl Future<Output = Arc<RefCell<i32>>>`
--> $DIR/issue-68112.rs:53:31
--> $DIR/issue-68112.rs:50:31
|
LL | fn make_non_send_future2() -> impl Future<Output = Arc<RefCell<i32>>> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: required because it captures the following types: `ResumeTy`, `impl Future<Output = Arc<RefCell<i32>>>`, `()`, `i32`, `Ready<i32>`
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`

View File

@ -1,18 +0,0 @@
error: future cannot be sent between threads safely
--> $DIR/issue-70818.rs:7:38
|
LL | fn foo<T: Send, U>(ty: T, ty1: U) -> impl Future<Output = (T, U)> + 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<T: Send, U: std::marker::Send>(ty: T, ty1: U) -> impl Future<Output = (T, U)> + Send {
| +++++++++++++++++++
error: aborting due to previous error

View File

@ -1,18 +0,0 @@
error: future cannot be sent between threads safely
--> $DIR/issue-70818.rs:7:38
|
LL | fn foo<T: Send, U>(ty: T, ty1: U) -> impl Future<Output = (T, U)> + 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<T: Send, U: std::marker::Send>(ty: T, ty1: U) -> impl Future<Output = (T, U)> + Send {
| +++++++++++++++++++
error: aborting due to previous error

View File

@ -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;

View File

@ -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<T: Send, U>(ty: T, ty1: U) -> impl Future<Output = (T, U)> + 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`

View File

@ -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<T>(_c: impl FnMut() -> T) where T: Future<Output=()> {
| ___________________________________________________________________^
LL | | }
| |_^
= note: required because it captures the following types: `ResumeTy`, `impl Future<Output = ()>`, `()`
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`.

View File

@ -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<T>(_c: impl FnMut() -> T) where T: Future<Output=()> {
| ___________________________________________________________________^
LL | | }
| |_^
= note: required because it captures the following types: `impl Future<Output = ()>`
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`.

View File

@ -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<T>(_c: impl FnMut() -> T) where T: Future<Output=()> {
}
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());

View File

@ -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

View File

@ -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;

View File

@ -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`.

View File

@ -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`.

View File

@ -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`.

View File

@ -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() {}

View File

@ -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<Box<{async block@$DIR/issue-86507.rs:21:17: 23:18}>>` to `Pin<Box<(dyn Future<Output = ()> + 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

View File

@ -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<Box<{async block@$DIR/issue-86507.rs:21:17: 23:18}>>` to `Pin<Box<(dyn Future<Output = ()> + 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

View File

@ -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;

View File

@ -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<Box<{async block@$DIR/issue-86507.rs:21:17: 23:18}>>` to `Pin<Box<(dyn Future<Output = ()> + Send + 'async_trait)>>`
= note: required for the cast from `Pin<Box<{async block@$DIR/issue-86507.rs:18:17: 20:18}>>` to `Pin<Box<(dyn Future<Output = ()> + Send + 'async_trait)>>`
help: consider further restricting this bound
|
LL | fn bar<'me, 'async_trait, T: Send + std::marker::Sync>(x: &'me T)

View File

@ -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 {

View File

@ -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};

View File

@ -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: Send>(_: T) {}
| ^^^^ required by this bound in `assert_send`
error: aborting due to previous error

View File

@ -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: Send>(_: T) {}
fn main() {
assert_send(async {
//[no_drop_tracking]~^ ERROR future cannot be sent between threads safely
bar(Foo(std::ptr::null())).await;
})
}

View File

@ -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];

View File

@ -6,7 +6,7 @@ LL | g(issue_67893::run())
|
= help: within `impl Future<Output = ()>`, 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

View File

@ -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`.

View File

@ -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`.

View File

@ -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`.

View File

@ -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`

View File

@ -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)]

View File

@ -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<Output = ()>`
|
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `NotSend`
= note: required because it appears within the type `(NotSend,)`
= note: required because it captures the following types: `ResumeTy`, `(NotSend,)`, `()`, `impl Future<Output = ()>`
note: required because it's used within this `async fn` body
--> $DIR/partial-drop-partial-reinit.rs:31:16
|
LL | async fn foo() {
| ________________^
LL | |
LL | |
LL | | let mut x = (NotSend {},);
... |
LL | | bar().await;
LL | | }
| |_^
note: required by a bound in `gimme_send`
--> $DIR/partial-drop-partial-reinit.rs:17:18
|
LL | fn gimme_send<T: Send>(t: T) {
| ^^^^ required by this bound in `gimme_send`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0277`.

View File

@ -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)]

View File

@ -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<Output = ()>`, `()`
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: Send>(t: T) {
| ^^^^ required by this bound in `gimme_send`

View File

@ -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`.

View File

@ -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`.

View File

@ -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`.

View File

@ -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`

View File

@ -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::<T>().await;
| +++++
error: aborting due to previous error
For more information about this error, try `rustc --explain E0282`.

View File

@ -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`.

View File

@ -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<T>() -> () {}
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() {}

View File

@ -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;
| ^^^^^

View File

@ -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 <https://github.com/rust-lang/rust/issues/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`.

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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`.

View File

@ -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`.

View File

@ -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)]

View File

@ -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

Some files were not shown because too many files have changed in this diff Show More