use rustc_macros::SessionDiagnostic;
use rustc_span::{BytePos, Span};
+use crate::infer::error_reporting::{
+ need_type_info::{GeneratorKindAsDiagArg, UnderspecifiedArgKind},
+ ObligationCauseAsDiagArg,
+};
+
#[derive(SessionDiagnostic)]
#[diag(infer::opaque_hidden_type)]
pub struct OpaqueHiddenTypeDiag {
pub struct NeedTypeInfoInGenerator<'a> {
#[primary_span]
pub span: Span,
- pub generator_kind: &'static str,
+ pub generator_kind: GeneratorKindAsDiagArg,
#[subdiagnostic]
pub bad_label: InferenceBadError<'a>,
}
#[primary_span]
pub span: Span,
pub bad_kind: &'static str,
- pub prefix_kind: &'static str,
+ pub prefix_kind: UnderspecifiedArgKind,
pub has_parent: bool,
pub prefix: &'a str,
pub parent_prefix: &'a str,
type_name: String,
kind: &'static str,
x_kind: &'static str,
- prefix_kind: &'static str,
+ prefix_kind: UnderspecifiedArgKind,
prefix: &'a str,
arg_name: String,
},
},
WithRequirement {
span: Span,
- requirement: &'static str,
+ requirement: ObligationCauseAsDiagArg<'a>,
expected_found: Option<(DiagnosticStyledString, DiagnosticStyledString)>,
},
}