-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Symbol names for monomorphized trait impls are not stable across crates #32948
Comments
I think that calling |
If you look in |
@Kha Good catch. rust/src/librustc/ty/item_path.rs Line 221 in c9f1501
|
@michaelwoerister ah, I see, yes, that makes sense. I guess the problem is that we don't have a way to serialize type names that is cross-crate safe. We should try to keep the "spirit" of that rule working though since it'd be nice to get those paths in the symbol names. |
This should be fixed by @eddyb's metadata PR. |
Using a global variable, interesting... well, I didn't think of that solution 😄 . |
@Kha It's just a thread-local at least |
I think we can improve on the situation by moving to a scheme where we dump types in a structured, but simpler, manner than the current printing logic, and then we can even reuse parts of C++ mangling schemes to get smaller symbols and cleaner |
@eddyb yes, please! |
This should be fixed since #33602 landed. |
Removing from milestone since this is just needs-test now. |
Fixed by #36832. |
In the spirit of #32554:
crate
A
:crate
B
:A.ll
:B.ll
:IOW,
A
uses the encoding of<Bar as Foo>::foo
, whileB
uses<A::Bar as A::Foo>::foo
. The issue seems to be that while symbol names correctly usectxt::absolute_item_path_str
, that function indirectly callsctxt::item_path_str
via e.g.TraitRef
'sDisplay
implementation.cc @nikomatsakis @michaelwoerister
The text was updated successfully, but these errors were encountered: