-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed as not planned
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitAsyncAwait-TriagedAsync-await issues that have been triaged during a working group meeting.Async-await issues that have been triaged during a working group meeting.T-langRelevant to the language teamRelevant to the language teamWG-asyncWorking group: Async & awaitWorking group: Async & await
Description
For non-Send types with trivial drop, we still consider them held across the generator, even with -Zdrop-tracking
:
async fn trivial_drop() {
// uncomment to make this program compile
// {
let x: *const usize = &0; //~ ERROR has type `*const usize` which is not `Send`
// }
async {}.await;
}
fn assert_send<T: Send>(_: T) {}
fn main() {
assert_send(trivial_drop());
}
There's no reason to do this; *const T
has no drop impl and it's not possible to read or write it if it's not explicitly used after the yield.
Originally posted by @jyn514 in #98754 (comment)
tmandry
Metadata
Metadata
Assignees
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitAsyncAwait-TriagedAsync-await issues that have been triaged during a working group meeting.Async-await issues that have been triaged during a working group meeting.T-langRelevant to the language teamRelevant to the language teamWG-asyncWorking group: Async & awaitWorking group: Async & await