From acb201af54e15b1beebb5b8a6691f6c851afe177 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Wed, 14 Feb 2024 23:52:57 +0000 Subject: make better async fn kind errors --- compiler/rustc_trait_selection/src/errors.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'compiler/rustc_trait_selection/src/errors.rs') diff --git a/compiler/rustc_trait_selection/src/errors.rs b/compiler/rustc_trait_selection/src/errors.rs index 20cd573f46e..407fff03e15 100644 --- a/compiler/rustc_trait_selection/src/errors.rs +++ b/compiler/rustc_trait_selection/src/errors.rs @@ -135,6 +135,8 @@ pub struct ClosureKindMismatch { #[label(trait_selection_closure_kind_requirement)] pub cause_span: Span, + pub trait_prefix: &'static str, + #[subdiagnostic] pub fn_once_label: Option, @@ -157,3 +159,11 @@ pub struct ClosureFnMutLabel { pub span: Span, pub place: String, } + +#[derive(Diagnostic)] +#[diag(trait_selection_async_closure_not_fn)] +pub(crate) struct AsyncClosureNotFn { + #[primary_span] + pub span: Span, + pub kind: &'static str, +} -- cgit 1.4.1-3-g733a5