From 0de7f4fd0b52ee2888a88f4f45fc68c5f6ebcb2f Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Tue, 12 Nov 2019 14:34:55 +0100 Subject: [PATCH] test(runtime-core) `offset_of!` fails with a struct containing `NonNull` types. It fails only in release mode. That's a bug from the `field-offset` crate. This patch is a temporary fix. --- lib/runtime-core/src/vm.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/runtime-core/src/vm.rs b/lib/runtime-core/src/vm.rs index ea63c47fc..7dfb7de2b 100644 --- a/lib/runtime-core/src/vm.rs +++ b/lib/runtime-core/src/vm.rs @@ -831,15 +831,9 @@ mod vm_offset_tests { #[test] fn func_ctx() { - assert_eq!( - FuncCtx::offset_vmctx() as usize, - offset_of!(FuncCtx => vmctx).get_byte_offset(), - ); + assert_eq!(FuncCtx::offset_vmctx() as usize, 0,); - assert_eq!( - FuncCtx::offset_func_env() as usize, - offset_of!(FuncCtx => func_env).get_byte_offset(), - ); + assert_eq!(FuncCtx::offset_func_env() as usize, 8,); } #[test]