Skip to content

Commit d4d8f1c

Browse files
committed
Sync from rust e6d4725c76f3b526c74454bc51afdf6daf133506
2 parents c09ef96 + 4ecd45a commit d4d8f1c

File tree

2 files changed

+5
-16
lines changed

2 files changed

+5
-16
lines changed

src/common.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use rustc_index::IndexVec;
66
use rustc_middle::ty::layout::{
77
FnAbiError, FnAbiOfHelpers, FnAbiRequest, LayoutError, LayoutOfHelpers,
88
};
9+
use rustc_span::source_map::Spanned;
910
use rustc_span::SourceFile;
1011
use rustc_target::abi::call::FnAbi;
1112
use rustc_target::abi::{Integer, Primitive};
@@ -495,25 +496,16 @@ impl<'tcx> FnAbiOfHelpers<'tcx> for RevealAllLayoutCx<'tcx> {
495496
fn_abi_request: FnAbiRequest<'tcx>,
496497
) -> ! {
497498
if let FnAbiError::Layout(LayoutError::SizeOverflow(_)) = err {
498-
self.0.sess.span_fatal(span, err.to_string())
499+
self.0.sess.emit_fatal(Spanned { span, node: err })
499500
} else {
500501
match fn_abi_request {
501502
FnAbiRequest::OfFnPtr { sig, extra_args } => {
502-
span_bug!(
503-
span,
504-
"`fn_abi_of_fn_ptr({}, {:?})` failed: {}",
505-
sig,
506-
extra_args,
507-
err
508-
);
503+
span_bug!(span, "`fn_abi_of_fn_ptr({sig}, {extra_args:?})` failed: {err:?}");
509504
}
510505
FnAbiRequest::OfInstance { instance, extra_args } => {
511506
span_bug!(
512507
span,
513-
"`fn_abi_of_instance({}, {:?})` failed: {}",
514-
instance,
515-
extra_args,
516-
err
508+
"`fn_abi_of_instance({instance}, {extra_args:?})` failed: {err:?}"
517509
);
518510
}
519511
}

src/intrinsics/mod.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -475,9 +475,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
475475
sym::unchecked_add
476476
| sym::unchecked_sub
477477
| sym::unchecked_mul
478-
| sym::unchecked_div
479478
| sym::exact_div
480-
| sym::unchecked_rem
481479
| sym::unchecked_shl
482480
| sym::unchecked_shr => {
483481
intrinsic_args!(fx, args => (x, y); intrinsic);
@@ -487,8 +485,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
487485
sym::unchecked_add => BinOp::Add,
488486
sym::unchecked_sub => BinOp::Sub,
489487
sym::unchecked_mul => BinOp::Mul,
490-
sym::unchecked_div | sym::exact_div => BinOp::Div,
491-
sym::unchecked_rem => BinOp::Rem,
488+
sym::exact_div => BinOp::Div,
492489
sym::unchecked_shl => BinOp::Shl,
493490
sym::unchecked_shr => BinOp::Shr,
494491
_ => unreachable!(),

0 commit comments

Comments
 (0)