From 14c40b714a9b08d846b2b48ece0788bd47797cb9 Mon Sep 17 00:00:00 2001 From: "Neal H. Walfield" Date: Tue, 29 Jan 2019 09:46:23 +0100 Subject: ffi-macros: Improve assert_tag error message. - A wrapper object may be deallocated either if the object is freed *or* the object is moved. Change the error message to mention both of these possibilities. --- ffi-macros/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ffi-macros/src/lib.rs') diff --git a/ffi-macros/src/lib.rs b/ffi-macros/src/lib.rs index 7bedb0ce..823798d9 100644 --- a/ffi-macros/src/lib.rs +++ b/ffi-macros/src/lib.rs @@ -311,7 +311,8 @@ fn derive_conversion_functions(st: &mut syn::ItemStruct, _: &str, _: &str, if self.1 != #magic_value { if self.1 == 0x5050505050505050 { panic!( - "FFI contract violation: Use-after-free detected"); + "FFI contract violation: \ + Use after move or use after free detected"); } else { panic!( "FFI contract violation: Wrong parameter type"); -- cgit v1.2.3