-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #101779 - eholk:drop-tracking-test-output, r=jyn514
Update test output for drop tracking #97334 has a lot of updates to test outputs that makes the PR larger than it needs to be. This PR pulls those changes out so we can keep the other one as simple as possible. r? `@jyn514`
- Loading branch information
Showing
20 changed files
with
372 additions
and
72 deletions.
There are no files selected for viewing
110 changes: 110 additions & 0 deletions
110
src/test/ui/async-await/async-await-let-else.drop-tracking.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
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); | ||
| ----------- ^^^^^^ await occurs here, with `Rc::new(())` maybe used later | ||
| | | ||
| has type `Rc<()>` which is not `Send` | ||
note: `Rc::new(())` is later dropped here | ||
--> $DIR/async-await-let-else.rs:33:35 | ||
| | ||
LL | (Rc::new(()), bar().await); | ||
| ^ | ||
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`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/test/ui/async-await/issue-64130-4-async-move.no_drop_tracking.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
error: future cannot be sent between threads safely | ||
--> $DIR/issue-64130-4-async-move.rs:19: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:25: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:23:15 | ||
| | ||
LL | match client.status() { | ||
| ^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
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: 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: 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: 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:26 | ||
| | ||
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`. |
Oops, something went wrong.