about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src
diff options
context:
space:
mode:
authorbjorn3 <17426603+bjorn3@users.noreply.github.com>2024-03-30 14:25:13 +0000
committerbjorn3 <17426603+bjorn3@users.noreply.github.com>2024-06-21 19:30:26 +0000
commitaacdce38f7f2298c5779446ffe17cae0068ccd37 (patch)
tree56fd59b7d9f4e906d75d0e4f52d1fa9338ebcc5c /compiler/rustc_codegen_ssa/src
parent22b32432ca3e8296a7649ef8c3711c0310f8f426 (diff)
downloadrust-aacdce38f7f2298c5779446ffe17cae0068ccd37.tar.gz
rust-aacdce38f7f2298c5779446ffe17cae0068ccd37.zip
Remove check_overflow method from MiscMethods
It can be retrieved from the Session too.
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
-rw-r--r--compiler/rustc_codegen_ssa/src/mir/block.rs2
-rw-r--r--compiler/rustc_codegen_ssa/src/traits/misc.rs1
2 files changed, 1 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_ssa/src/mir/block.rs b/compiler/rustc_codegen_ssa/src/mir/block.rs
index 1eec1841a37..b1c22faf1ae 100644
--- a/compiler/rustc_codegen_ssa/src/mir/block.rs
+++ b/compiler/rustc_codegen_ssa/src/mir/block.rs
@@ -658,7 +658,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
         // with #[rustc_inherit_overflow_checks] and inlined from
         // another crate (mostly core::num generic/#[inline] fns),
         // while the current crate doesn't use overflow checks.
-        if !bx.cx().check_overflow() && msg.is_optional_overflow_check() {
+        if !bx.sess().overflow_checks() && msg.is_optional_overflow_check() {
             const_cond = Some(expected);
         }
 
diff --git a/compiler/rustc_codegen_ssa/src/traits/misc.rs b/compiler/rustc_codegen_ssa/src/traits/misc.rs
index af3a9989604..0ace28ed3ba 100644
--- a/compiler/rustc_codegen_ssa/src/traits/misc.rs
+++ b/compiler/rustc_codegen_ssa/src/traits/misc.rs
@@ -16,7 +16,6 @@ pub trait MiscMethods<'tcx>: BackendTypes {
         _vtable: Self::Value,
     ) {
     }
-    fn check_overflow(&self) -> bool;
     fn get_fn(&self, instance: Instance<'tcx>) -> Self::Function;
     fn get_fn_addr(&self, instance: Instance<'tcx>) -> Self::Value;
     fn eh_personality(&self) -> Self::Value;