Open
Conversation
bjorn3
reviewed
Oct 24, 2025
| @@ -1 +1,5 @@ | |||
| //@ no-prefer-dynamic | |||
|
|
|||
| #![crate_type = "lib"] | |||
Member
There was a problem hiding this comment.
I'm surprised that --crate-type dylib overrides #![crate_type = "lib"].
Author
There was a problem hiding this comment.
I think it's documented to behave this way: https://doc.rust-lang.org/reference/linkage.html#r-link.repetition
Member
|
@bors r+ |
Collaborator
Member
|
@bors r- |
bjorn3
reviewed
Oct 24, 2025
| static Z: u8 = (&ARRAY)[0]; | ||
|
|
||
| pub fn main() {} | ||
| pub fn main() { |
Member
There was a problem hiding this comment.
Why does the auxiliary for this test need to change? This doesn't use extern "C" {} like the other test does.
Author
There was a problem hiding this comment.
Not sure if the presence of extern "C" makes a material difference. If the auxiliary for this test is not changed, the test fails just like the other one, the symbol name is just mangled:
a.static_array_across_crate.fff1a89e6847c716-cgu.0.rcgu.o : error LNK2001: unresolved external symbol _ZN16pub_static_array5ARRAY17h4c54e0b13136769dE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Per discussion in #142742, this PR makes a couple of tests link in their helper crates statically. The
compiletest's default is to prefer dynamic linking, which in these cases would exercise a problematic (unsupported?) scenario.r? @bjorn3