rust/compiler/rustc_middle
Trevor Gross 0b8789c201
Rollup merge of #140630 - azhogin:azhogin/async-drop-proxy-source-info-fix, r=oli-obk
Async drop source info fix for proxy-drop-coroutine

Fixes crash at debug info generation: https://github.com/rust-lang/rust/issues/140426 .
Also, the submitted example requires sync Drop implementation too.
Because sync version is required for unwind and when drop is performed in sync context (sync function).

Probably, it is also needed to add such a lint/error about missed `impl Drop`, when there is `impl AsyncDrop`.

Fix description: even minimal, empty coroutine (for proxy-coroutine) has 3 states and the source info array should have 3 elements too.

```
#![feature(async_drop)]

use std::future::AsyncDrop;
use std::pin::Pin;

#[tokio::main(flavor = "current_thread")]
async fn main() {
    let _st = St;
}

struct St;

impl AsyncDrop for St {
    async fn drop(self: Pin<&mut Self>) {
        println!("123");
    }
}
```
2025-05-04 18:11:50 -04:00
..
src Rollup merge of #140630 - azhogin:azhogin/async-drop-proxy-source-info-fix, r=oli-obk 2025-05-04 18:11:50 -04:00
Cargo.toml Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
messages.ftl AsyncDrop implementation using shim codegen of async_drop_in_place::{closure}, scoped async drop added. 2025-04-28 16:23:13 +07:00
README.md

For more information about how rustc works, see the rustc dev guide.