rustc: Fix mixing crates with different share_generics#64324
Merged
bors merged 3 commits intorust-lang:masterfrom Sep 25, 2019
Merged
rustc: Fix mixing crates with different share_generics#64324bors merged 3 commits intorust-lang:masterfrom
share_generics#64324bors merged 3 commits intorust-lang:masterfrom
Conversation
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.
This commit addresses #64319 by removing the
dylibcrate type from thelist of crate type that exports generic symbols. The bug in #64319
arises because a
dylibcrate type was trying to export a symbol in anuptream crate but it miscalculated the symbol name of the uptream
symbol. This isn't really necessary, though, since
dylibcrates aren'tthat heavily used, so we can just conservatively say that the
dylibcrate type never exports generic symbols, forcibly removing them from
the exported symbol lists if were to otherwise find them.
The fix here happens in two places:
First is in the
local_crate_exports_genericsmethod, indicating thatit's now
falsefor theDylibcrate type. Only rlibs actuallyexport generics at this point.
Next is when we load exported symbols from upstream crate. If, for our
compilation session, the crate may be included from a dynamic library,
then its generic symbols are removed. When the crate was linked into a
dynamic library its symbols weren't exported, so we can't consider
them a candidate to link against.
Overally this should avoid situations where we incorrectly calculate the
upstream symbol names in the face of differnet
share_genericsoptions,ultimately...
Closes #64319