diff options
author | Neal H. Walfield <neal@pep.foundation> | 2019-01-29 09:46:23 +0100 |
---|---|---|
committer | Neal H. Walfield <neal@pep.foundation> | 2019-01-29 09:48:39 +0100 |
commit | 14c40b714a9b08d846b2b48ece0788bd47797cb9 (patch) | |
tree | 1ca1438ab6712dab9288e1799f2807a87935630a /ffi-macros/src/lib.rs | |
parent | c4f087f886bd66f4177093569db615dc1c1e9e1d (diff) |
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.
Diffstat (limited to 'ffi-macros/src/lib.rs')
-rw-r--r-- | ffi-macros/src/lib.rs | 3 |
1 files changed, 2 insertions, 1 deletions
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"); |