Skip to content

Commit

Permalink
bless tests
Browse files Browse the repository at this point in the history
  • Loading branch information
b-naber committed Jun 29, 2023
1 parent 0fb7794 commit 2bc0875
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 39 deletions.
23 changes: 1 addition & 22 deletions tests/ui/async-await/async-fn-nonsend.drop_tracking_mir.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,5 @@ note: required by a bound in `assert_send`
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
error: aborting due to previous error

4 changes: 2 additions & 2 deletions tests/ui/async-await/async-fn-nonsend.no_drop_tracking.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ 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
--> $DIR/async-fn-nonsend.rs:77:17
|
LL | assert_send(non_sync_with_method_call_panic());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `non_sync_with_method_call_panic` is not `Send`
Expand All @@ -93,7 +93,7 @@ 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
--> $DIR/async-fn-nonsend.rs:79:17
|
LL | assert_send(non_sync_with_method_call_infinite_loop());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `non_sync_with_method_call_infinite_loop` is not `Send`
Expand Down
3 changes: 2 additions & 1 deletion tests/ui/async-await/async-fn-nonsend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ pub fn pass_assert() {
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
//[no_drop_tracking]~^ ERROR future cannot be sent between threads safely
//[drop_tracking]~^^ 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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,11 @@ 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
note: captured value is not `Send` because `&mut` references cannot be sent unless their referent is `Send`
--> $DIR/drop-track-field-assign-nonsend.rs:19:21
|
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 | async fn handle(&mut self) {
| ^^^^^^^^^ has type `&mut Agent` which is not `Send`, because `Agent` is not `Send`
note: required by a bound in `assert_send`
--> $DIR/drop-track-field-assign-nonsend.rs:40:19
|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,11 @@ 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
note: captured value is not `Send` because `&mut` references cannot be sent unless their referent is `Send`
--> $DIR/field-assign-nonsend.rs:19:21
|
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 | async fn handle(&mut self) {
| ^^^^^^^^^ has type `&mut Agent` which is not `Send`, because `Agent` is not `Send`
note: required by a bound in `assert_send`
--> $DIR/field-assign-nonsend.rs:40:19
|
Expand Down

0 comments on commit 2bc0875

Please sign in to comment.