Migrate OpaqueHiddenType mismatch

This commit is contained in:
111
2022-08-31 20:16:02 +08:00
parent 3e834a7a62
commit 00cd965046
3 changed files with 47 additions and 13 deletions

View File

@@ -12,3 +12,29 @@ pub struct DropCheckOverflow<'tcx> {
pub ty: Ty<'tcx>,
pub note: String,
}
#[derive(SessionDiagnostic)]
#[diag(middle::opaque_hidden_type_mismatch)]
pub struct OpaqueHiddenTypeMismatch<'tcx> {
pub self_ty: Ty<'tcx>,
pub other_ty: Ty<'tcx>,
#[primary_span]
#[label]
pub other_span: Span,
#[subdiagnostic]
pub sub: TypeMismatchReason,
}
#[derive(SessionSubdiagnostic)]
pub enum TypeMismatchReason {
#[label(middle::conflict_types)]
ConflictType {
#[primary_span]
span: Span,
},
#[note(middle::previous_use_here)]
PreviousUse {
#[primary_span]
span: Span,
},
}