about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis/src/errors.rs
diff options
context:
space:
mode:
authorTrevor Gross <t.gross35@gmail.com>2025-06-18 20:22:50 -0400
committerGitHub <noreply@github.com>2025-06-18 20:22:50 -0400
commit2526b01fdd5cbddf9e4d993edca92db411288d14 (patch)
tree4c6aa20c4128be089dd1308fed701f3edeb36c80 /compiler/rustc_hir_analysis/src/errors.rs
parenta021227fb5b2d8abc775b8c9b5ab3f9ce3ed0378 (diff)
parenteee2d7b1016d6f2743c5f61989b28e05fefd9aff (diff)
Rollup merge of #142606 - azhogin:azhogin/async-drop-without-sync-drop-error, r=oli-obk
AsyncDrop trait without sync Drop generates an error

When type implements `AsyncDrop` trait, it must also implement sync `Drop` trait to be used in sync context and unwinds.
This PR adds error generation in such a case.

Fixes: rust-lang/rust#140696
Diffstat (limited to 'compiler/rustc_hir_analysis/src/errors.rs')
-rw-r--r--compiler/rustc_hir_analysis/src/errors.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/rustc_hir_analysis/src/errors.rs b/compiler/rustc_hir_analysis/src/errors.rs
index 8de2aec95a7..318aaab50f4 100644
--- a/compiler/rustc_hir_analysis/src/errors.rs
+++ b/compiler/rustc_hir_analysis/src/errors.rs
@@ -1712,3 +1712,11 @@ pub(crate) struct AbiCustomClothedFunction {
     )]
     pub naked_span: Span,
 }
+
+#[derive(Diagnostic)]
+#[diag(hir_analysis_async_drop_without_sync_drop)]
+#[help]
+pub(crate) struct AsyncDropWithoutSyncDrop {
+    #[primary_span]
+    pub span: Span,
+}