You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We'd produce a metadata table with a TypeId hash for each exported symbol and check it in DynamicLibrary::symbol. The function will still need to be unsafe because there are plenty of ways to deliberately circumvent the check (collisions of the 64-bit hash, hex-editing the .so file, etc) but it will fix the poor user experience of accidental type mismatch when using plugins (in the case of rustc plugins, this is #14841).
We'll also have DynamicLibrary::raw_symbol which does no typecheck, gives an *mut u8, and can be used with non-Rust .so's.
Maybe DynamicLibrary could be kept separate and a higher-level one built in top? (E.g. DynamicLibrary & RustDynamicLibrary or CDynamicLibrary & DynamicLibrary.)
E.g. theoretically RustDynamicLibrary could check for validity/that's it's a rust library/read metadata when opening it, while this is not possible wit a non-Rust .so.
This is unfortunately fairly unlikely to happen, and we're unlikely to stabilize DynamicLibrary as-is, so I'm going to close this as we're not tracking feature requests for various libs in this issue tracker.
Reuse recursion limit as expansion limit
A configurable recursion limit was introduced by looking at the recursion_limit crate attribute. Instead of relying on a global constant we will reuse this value for expansion limit as well.
Addresses: rust-lang/rust-analyzer#8640 (comment)
We'd produce a metadata table with a
TypeId
hash for each exported symbol and check it inDynamicLibrary::symbol
. The function will still need to beunsafe
because there are plenty of ways to deliberately circumvent the check (collisions of the 64-bit hash, hex-editing the .so file, etc) but it will fix the poor user experience of accidental type mismatch when using plugins (in the case of rustc plugins, this is #14841).We'll also have
DynamicLibrary::raw_symbol
which does no typecheck, gives an*mut u8
, and can be used with non-Rust .so's.I plan to work on this after #8157.
The text was updated successfully, but these errors were encountered: