fix comment

This commit is contained in:
111 2022-09-05 23:18:18 +08:00
parent b37e645d80
commit a42c0d79da
3 changed files with 3 additions and 4 deletions

View File

@ -1,6 +1,6 @@
middle_drop_check_overflow =
overflow while adding drop-check rules for {$ty}
.note = {$note}
.note = overflowed on {$overflow_ty}
middle_opaque_hidden_type_mismatch =
concrete type differs from previous defining opaque type use

View File

@ -10,7 +10,7 @@ pub struct DropCheckOverflow<'tcx> {
#[primary_span]
pub span: Span,
pub ty: Ty<'tcx>,
pub note: String,
pub overflow_ty: Ty<'tcx>,
}
#[derive(SessionDiagnostic)]

View File

@ -117,8 +117,7 @@ pub struct DropckOutlivesResult<'tcx> {
impl<'tcx> DropckOutlivesResult<'tcx> {
pub fn report_overflows(&self, tcx: TyCtxt<'tcx>, span: Span, ty: Ty<'tcx>) {
if let Some(overflow_ty) = self.overflows.get(0) {
let note = format!("overflowed on {}", overflow_ty);
tcx.sess.emit_err(DropCheckOverflow { span, ty, note });
tcx.sess.emit_err(DropCheckOverflow { span, ty, overflow_ty: *overflow_ty });
}
}