-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Add test for raw-dylib with an external variable #100073
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
I have a question, #![feature(raw_dylib)]
#[link(name = "exporter", kind = "raw-dylib")]
extern {
#[link_ordinal(1, 2)]
fn imported_function();
}
fn main() {} Will trigger an error:
But when it's used for a static variable, it won't tigger error: #![feature(raw_dylib)]
#[link(name = "exporter", kind = "raw-dylib")]
extern {
#[link_ordinal(1, 2)]
static mut imported_variable: i32;
}
fn main() {} |
Well spotted - looks like there is a bug where we aren't checking attributes on |
I assume this is the fix for that? Thanks a lot, @dpaoliello! |
☀️ Test successful - checks-actions |
Correct |
Finished benchmarking commit (d77da9d): comparison url. Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results
CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression Footnotes |
All existing tests of link kind
raw-dylib
only validate the ability to link against functions, but it is also possible to link against variables.This adds tests for linking against a variable using
raw-dylib
both by-name and by-ordinal.