I've recently read the following article, which states, that type layouts could change between every two compiler invocations. Some posts in this forum confirm this statement. I was only aware about changing ABI between rustc versions. Doesn't this mean, that the entire prefer-dynamic compiler flag itself is flawed? Or how is e.g. the layout stability from the structs in std-lib upheld?
Do I need to wrap every i8 or &dyn MyTrait I want to pass from binary "A" to a dylib "B", if they are compiled separately with the same compiler version?
I don't know about the standard library specifically, but it is in general a good idea to have dynamically loaded libraries talk to other things over a C FFI based api. We recently received a related issue on the Tokio issue tracker here.