Closed as not planned
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)