-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-pluginsArea: compiler plugins, doc.rust-lang.org/nightly/unstable-book/language-features/plugin.htmlArea: compiler plugins, doc.rust-lang.org/nightly/unstable-book/language-features/plugin.html
Description
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.
I plan to work on this after #8157.
Metadata
Metadata
Assignees
Labels
A-pluginsArea: compiler plugins, doc.rust-lang.org/nightly/unstable-book/language-features/plugin.htmlArea: compiler plugins, doc.rust-lang.org/nightly/unstable-book/language-features/plugin.html