Skip to content

Commit 5671a76

Browse files
committed
Update partial-drop-partial-reinit.rs
1 parent b950ae4 commit 5671a76

3 files changed

+45
-7
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
error[E0277]: `NotSend` cannot be sent between threads safely
2+
--> $DIR/partial-drop-partial-reinit.rs:9:16
3+
|
4+
LL | gimme_send(foo());
5+
| ---------- ^^^^^ `NotSend` cannot be sent between threads safely
6+
| |
7+
| required by a bound introduced by this call
8+
...
9+
LL | async fn foo() {
10+
| - within this `impl Future<Output = ()>`
11+
|
12+
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `NotSend`
13+
= note: required because it appears within the type `(NotSend,)`
14+
= note: required because it captures the following types: `ResumeTy`, `(NotSend,)`, `()`, `impl Future<Output = ()>`
15+
note: required because it's used within this `async fn` body
16+
--> $DIR/partial-drop-partial-reinit.rs:31:16
17+
|
18+
LL | async fn foo() {
19+
| ________________^
20+
LL | |
21+
LL | |
22+
LL | | let mut x = (NotSend {},);
23+
... |
24+
LL | | bar().await;
25+
LL | | }
26+
| |_^
27+
note: required by a bound in `gimme_send`
28+
--> $DIR/partial-drop-partial-reinit.rs:17:18
29+
|
30+
LL | fn gimme_send<T: Send>(t: T) {
31+
| ^^^^ required by this bound in `gimme_send`
32+
33+
error: aborting due to previous error
34+
35+
For more information about this error, try `rustc --explain E0277`.

src/test/ui/async-await/partial-drop-partial-reinit.stderr renamed to src/test/ui/async-await/partial-drop-partial-reinit.no_drop_tracking.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0277]: `NotSend` cannot be sent between threads safely
2-
--> $DIR/partial-drop-partial-reinit.rs:6:16
2+
--> $DIR/partial-drop-partial-reinit.rs:9:16
33
|
44
LL | gimme_send(foo());
55
| ---------- ^^^^^ `NotSend` cannot be sent between threads safely
@@ -13,7 +13,7 @@ LL | async fn foo() {
1313
= note: required because it appears within the type `(NotSend,)`
1414
= note: required because it captures the following types: `ResumeTy`, `(NotSend,)`, `impl Future<Output = ()>`, `()`
1515
note: required because it's used within this `async fn` body
16-
--> $DIR/partial-drop-partial-reinit.rs:28:16
16+
--> $DIR/partial-drop-partial-reinit.rs:31:16
1717
|
1818
LL | async fn foo() {
1919
| ________________^
@@ -25,7 +25,7 @@ LL | | bar().await;
2525
LL | | }
2626
| |_^
2727
note: required by a bound in `gimme_send`
28-
--> $DIR/partial-drop-partial-reinit.rs:14:18
28+
--> $DIR/partial-drop-partial-reinit.rs:17:18
2929
|
3030
LL | fn gimme_send<T: Send>(t: T) {
3131
| ^^^^ required by this bound in `gimme_send`

src/test/ui/async-await/partial-drop-partial-reinit.rs

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
// edition:2021
2+
// revisions: no_drop_tracking drop_tracking
3+
// [drop_tracking] compile-flags: -Zdrop-tracking=yes
4+
// [no_drop_tracking] compile-flags: -Zdrop-tracking=no
25
#![feature(negative_impls)]
36
#![allow(unused)]
47

@@ -12,8 +15,8 @@ fn main() {
1215
}
1316

1417
fn gimme_send<T: Send>(t: T) {
15-
//~^ NOTE required by this bound
16-
//~| NOTE required by a bound
18+
//~^ NOTE required by this bound
19+
//~| NOTE required by a bound
1720
drop(t);
1821
}
1922

@@ -26,8 +29,8 @@ impl Drop for NotSend {
2629
impl !Send for NotSend {}
2730

2831
async fn foo() {
29-
//~^ NOTE used within this `async fn` body
30-
//~| NOTE within this `impl Future
32+
//~^ NOTE used within this `async fn` body
33+
//~| NOTE within this `impl Future
3134
let mut x = (NotSend {},);
3235
drop(x.0);
3336
x.0 = NotSend {};

0 commit comments

Comments
 (0)