4 ms·
Going back to my original answer, the difference lies in what the two languages ask of the linker under normal circumstances. Normal, non-FFI-using C++ can hit
by Rusky 6y ago
Going back to my original answer, the difference lies in what the two languages ask of the linker under normal circumstances.
Normal, non-FFI-using C++ can hit ODR violations in response to things like typos or subtle mis-uses of `inline` and templates.
Normal, non-FFI-using Rust is designed such that these situations never come up.
My original comment was never talking about FFI in the first place, where yes, both languages are much more at the mercy of what the platform provides. However, in that case the spooky UB ODR violations I was referring to are also not relevant, because you just get normal, fully-defined platform behavior- the expectations of the compiler (and thus the chances for them to be violated, resulting in UB), are different.