about summary refs log tree commit diff
path: root/compiler/rustc_const_eval
diff options
context:
space:
mode:
authorouz-a <oguz.agcayazi@gmail.com>2021-12-13 12:35:55 +0300
committerouz-a <oguz.agcayazi@gmail.com>2021-12-13 12:35:55 +0300
commit01948e2f45acefc336501b9b9f836845fc566774 (patch)
treee1e492e2289268e143b9cabf1f89e66dc0e0fca3 /compiler/rustc_const_eval
parent4a7fb971c939d268abdbd0963cd45d046442f7af (diff)
downloadrust-01948e2f45acefc336501b9b9f836845fc566774.tar.gz
rust-01948e2f45acefc336501b9b9f836845fc566774.zip
Looser check for binary_op_overflow
Diffstat (limited to 'compiler/rustc_const_eval')
-rw-r--r--compiler/rustc_const_eval/src/interpret/operator.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/operator.rs b/compiler/rustc_const_eval/src/interpret/operator.rs
index a90582fc338..a3094c8991c 100644
--- a/compiler/rustc_const_eval/src/interpret/operator.rs
+++ b/compiler/rustc_const_eval/src/interpret/operator.rs
@@ -330,7 +330,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
             _ if left.layout.ty.is_any_ptr() => {
                 // The RHS type must be the same *or an integer type* (for `Offset`).
                 assert!(
-                    right.layout.ty == left.layout.ty || right.layout.ty.is_integral(),
+                    right.layout.ty.is_any_ptr()|| right.layout.ty.is_integral(),
                     "Unexpected types for BinOp: {:?} {:?} {:?}",
                     left.layout.ty,
                     bin_op,