-
Notifications
You must be signed in to change notification settings - Fork 14k
Fix tests to use static linking #148064
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
base: master
Are you sure you want to change the base?
Fix tests to use static linking #148064
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,5 @@ | ||
| //@ no-prefer-dynamic | ||
|
|
||
| #![crate_type = "lib"] | ||
|
|
||
| pub static ARRAY: [u8; 1] = [1]; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,4 +10,8 @@ static X: &'static u8 = &ARRAY[0]; | |
| static Y: &'static u8 = &(&ARRAY)[0]; | ||
| static Z: u8 = (&ARRAY)[0]; | ||
|
|
||
| pub fn main() {} | ||
| pub fn main() { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why does the auxiliary for this test need to change? This doesn't use
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure if the presence of |
||
| // Make sure to actually reference the statics. | ||
| assert_eq!(&X, &Y); | ||
| assert_eq!(&X, &&Z); | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm surprised that
--crate-type dyliboverrides#![crate_type = "lib"].There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's documented to behave this way: https://doc.rust-lang.org/reference/linkage.html#r-link.repetition