Skip to content

Commit

Permalink
fix comment
Browse files Browse the repository at this point in the history
  • Loading branch information
MingyuChen1 committed Sep 5, 2022
1 parent b37e645 commit a42c0d7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_error_messages/locales/en-US/middle.ftl
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
3 changes: 1 addition & 2 deletions compiler/rustc_middle/src/traits/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
}
}

Expand Down

0 comments on commit a42c0d7

Please sign in to comment.