1use rustc_macros::Diagnostic;
2use rustc_span::Span;
34#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
OpaqueHiddenTypeDiag where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
OpaqueHiddenTypeDiag {
span: __binding_0,
opaque_type: __binding_1,
hidden_type: __binding_2 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("opaque type's hidden type cannot be another opaque type from the same scope")));
;
diag.span(__binding_0);
diag.span_label(__binding_0,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("one of the two opaque types used here has to be outside its defining scope")));
diag.span_note(__binding_1,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("opaque type whose hidden type is being assigned")));
diag.span_note(__binding_2,
rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("opaque type being used as hidden type")));
diag
}
}
}
}
};Diagnostic)]
5#[diag("opaque type's hidden type cannot be another opaque type from the same scope")]
6pub(crate) struct OpaqueHiddenTypeDiag {
7#[primary_span]
8 #[label("one of the two opaque types used here has to be outside its defining scope")]
9pub span: Span,
10#[note("opaque type whose hidden type is being assigned")]
11pub opaque_type: Span,
12#[note("opaque type being used as hidden type")]
13pub hidden_type: Span,
14}