Skip to content

Commit a42c0d7

Browse files
committed
fix comment
1 parent b37e645 commit a42c0d7

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

compiler/rustc_error_messages/locales/en-US/middle.ftl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
middle_drop_check_overflow =
22
overflow while adding drop-check rules for {$ty}
3-
.note = {$note}
3+
.note = overflowed on {$overflow_ty}
44
55
middle_opaque_hidden_type_mismatch =
66
concrete type differs from previous defining opaque type use

compiler/rustc_middle/src/error.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub struct DropCheckOverflow<'tcx> {
1010
#[primary_span]
1111
pub span: Span,
1212
pub ty: Ty<'tcx>,
13-
pub note: String,
13+
pub overflow_ty: Ty<'tcx>,
1414
}
1515

1616
#[derive(SessionDiagnostic)]

compiler/rustc_middle/src/traits/query.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,7 @@ pub struct DropckOutlivesResult<'tcx> {
117117
impl<'tcx> DropckOutlivesResult<'tcx> {
118118
pub fn report_overflows(&self, tcx: TyCtxt<'tcx>, span: Span, ty: Ty<'tcx>) {
119119
if let Some(overflow_ty) = self.overflows.get(0) {
120-
let note = format!("overflowed on {}", overflow_ty);
121-
tcx.sess.emit_err(DropCheckOverflow { span, ty, note });
120+
tcx.sess.emit_err(DropCheckOverflow { span, ty, overflow_ty: *overflow_ty });
122121
}
123122
}
124123

0 commit comments

Comments
 (0)