diff options
| author | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2023-06-06 14:00:40 +0000 |
|---|---|---|
| committer | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2023-06-06 14:00:40 +0000 |
| commit | d4d8f1c1fff6543ef334672cccb43de5fb633d6f (patch) | |
| tree | 55c3beea913dce9594a684edcc5f707ad5f1ed5e | |
| parent | c09ef968782c8ada9aa5427605b1b7925ac60d32 (diff) | |
| parent | 4ecd45a5889153f5844c142e404bf5398b24dfec (diff) | |
| download | rust-d4d8f1c1fff6543ef334672cccb43de5fb633d6f.tar.gz rust-d4d8f1c1fff6543ef334672cccb43de5fb633d6f.zip | |
Sync from rust e6d4725c76f3b526c74454bc51afdf6daf133506
| -rw-r--r-- | src/common.rs | 16 | ||||
| -rw-r--r-- | src/intrinsics/mod.rs | 5 |
2 files changed, 5 insertions, 16 deletions
diff --git a/src/common.rs b/src/common.rs index e2932baaa90..a694bb26afb 100644 --- a/src/common.rs +++ b/src/common.rs @@ -6,6 +6,7 @@ use rustc_index::IndexVec; use rustc_middle::ty::layout::{ FnAbiError, FnAbiOfHelpers, FnAbiRequest, LayoutError, LayoutOfHelpers, }; +use rustc_span::source_map::Spanned; use rustc_span::SourceFile; use rustc_target::abi::call::FnAbi; use rustc_target::abi::{Integer, Primitive}; @@ -495,25 +496,16 @@ impl<'tcx> FnAbiOfHelpers<'tcx> for RevealAllLayoutCx<'tcx> { fn_abi_request: FnAbiRequest<'tcx>, ) -> ! { if let FnAbiError::Layout(LayoutError::SizeOverflow(_)) = err { - self.0.sess.span_fatal(span, err.to_string()) + self.0.sess.emit_fatal(Spanned { span, node: err }) } else { match fn_abi_request { FnAbiRequest::OfFnPtr { sig, extra_args } => { - span_bug!( - span, - "`fn_abi_of_fn_ptr({}, {:?})` failed: {}", - sig, - extra_args, - err - ); + span_bug!(span, "`fn_abi_of_fn_ptr({sig}, {extra_args:?})` failed: {err:?}"); } FnAbiRequest::OfInstance { instance, extra_args } => { span_bug!( span, - "`fn_abi_of_instance({}, {:?})` failed: {}", - instance, - extra_args, - err + "`fn_abi_of_instance({instance}, {extra_args:?})` failed: {err:?}" ); } } diff --git a/src/intrinsics/mod.rs b/src/intrinsics/mod.rs index 0a513b08b74..1e83c30bd67 100644 --- a/src/intrinsics/mod.rs +++ b/src/intrinsics/mod.rs @@ -475,9 +475,7 @@ fn codegen_regular_intrinsic_call<'tcx>( sym::unchecked_add | sym::unchecked_sub | sym::unchecked_mul - | sym::unchecked_div | sym::exact_div - | sym::unchecked_rem | sym::unchecked_shl | sym::unchecked_shr => { intrinsic_args!(fx, args => (x, y); intrinsic); @@ -487,8 +485,7 @@ fn codegen_regular_intrinsic_call<'tcx>( sym::unchecked_add => BinOp::Add, sym::unchecked_sub => BinOp::Sub, sym::unchecked_mul => BinOp::Mul, - sym::unchecked_div | sym::exact_div => BinOp::Div, - sym::unchecked_rem => BinOp::Rem, + sym::exact_div => BinOp::Div, sym::unchecked_shl => BinOp::Shl, sym::unchecked_shr => BinOp::Shr, _ => unreachable!(), |
