about summary refs log tree commit diff
diff options
context:
space:
mode:
authorhkalbasi <hamidrezakalbasi@protonmail.com>2023-06-30 21:21:23 +0330
committerhkalbasi <hamidrezakalbasi@protonmail.com>2023-06-30 21:21:52 +0330
commit45828cdb54ba2dcd962a25f1639680461493d08d (patch)
tree34a109eafb6032bcffad47082217943b59a73dc5
parent76bcd9946ad2ecfa6c541d3d6eaee187f3b73a30 (diff)
downloadrust-45828cdb54ba2dcd962a25f1639680461493d08d.tar.gz
rust-45828cdb54ba2dcd962a25f1639680461493d08d.zip
Disable mir interpreter for targets with different pointer size from host
-rw-r--r--crates/hir-ty/src/mir/eval.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/crates/hir-ty/src/mir/eval.rs b/crates/hir-ty/src/mir/eval.rs
index 01295a9fc3c..dd23f1957c7 100644
--- a/crates/hir-ty/src/mir/eval.rs
+++ b/crates/hir-ty/src/mir/eval.rs
@@ -468,6 +468,9 @@ pub fn interpret_mir(
     let ty = body.locals[return_slot()].ty.clone();
     let mut evaluator = Evaluator::new(db, body, assert_placeholder_ty_is_unused);
     let x: Result<Const> = (|| {
+        if evaluator.ptr_size() != std::mem::size_of::<usize>() {
+            not_supported!("targets with different pointer size from host");
+        }
         let bytes = evaluator.interpret_mir(&body, None.into_iter())?;
         let mut memory_map = evaluator.create_memory_map(
             &bytes,