rust/compiler/rustc_middle/src
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
..
dep_graph Reformat parameters to macros used by with-all-queries 2025-04-29 20:48:51 +10:00
hir do not emit OpaqueCast projections with -Znext-solver 2025-04-17 12:15:04 +02:00
hooks Pretty print pattern type values with transmute if they don't satisfy their pattern 2025-02-05 14:56:41 +00:00
infer Split TypeFolder and FallibleTypeFolder 2025-04-15 18:30:35 +00:00
middle AsyncDrop implementation using shim codegen of async_drop_in_place::{closure}, scoped async drop added. 2025-04-28 16:23:13 +07:00
mir Auto merge of #140464 - oli-obk:successors-mut-perf, r=petrochenkov 2025-05-03 10:43:38 +00:00
query Reformat parameters to macros used by with-all-queries 2025-04-29 20:48:51 +10:00
thir Add {ast,hir,thir}::PatKind::Missing variants. 2025-03-28 09:18:57 +11:00
traits Remove weak alias terminology 2025-04-24 11:59:20 +01:00
ty Rollup merge of #140630 - azhogin:azhogin/async-drop-proxy-source-info-fix, r=oli-obk 2025-05-04 18:11:50 -04:00
util Remove attribute #[rustc_error] 2025-03-30 01:32:21 +03:00
arena.rs AsyncDrop implementation using shim codegen of async_drop_in_place::{closure}, scoped async drop added. 2025-04-28 16:23:13 +07:00
error.rs Teach structured errors to display short Ty 2025-02-25 16:56:03 +00:00
lib.rs Simplify LazyAttrTokenStream. 2025-04-30 07:10:56 +10:00
lint.rs Remove LintExpectationId from Level variants 2025-04-03 09:22:21 +00:00
macros.rs Fold visit into ty 2025-03-15 06:34:36 +00:00
metadata.rs Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00
tests.rs Give an item related to issue 27438 a more meaningful name 2024-04-30 22:27:19 +02:00
thir.rs Add useful comments on ExprKind::If variants. 2025-05-02 15:53:39 +10:00
values.rs Use search_for_cycle_permutation to look for variances_of 2025-04-27 09:38:18 +02:00