This is very true. I think we should have this covered by checking the
plugins_core version numbers, but that assumes invoking the same compiler version on the same platform and source code will generate identical layouts and usages for the
plugins_core types... It's not technically correct (rust doesn't have a stable ABI and we don't guarantee reproducible builds), but in practice this tends to work out without a problem.
The alternative would be to write
extern "C" shims for every Rust type (vtable for trait methods, wrap all functions in an
extern "C" function, etc.), which gets really annoying really quickly, plus tends to be quite brittle if done manually. I believe this is the approach the
abi_stable crate takes, except it uses macros heavily (both proc and
macro_rules), and had to write
extern "C" wrappers for half the standard library...