Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upSymbol names for generics are not stable across crates #32554
Comments
alexcrichton
added
the
A-codegen
label
Mar 28, 2016
This comment has been minimized.
This comment has been minimized.
|
Interesting. |
This comment has been minimized.
This comment has been minimized.
|
I'm going to look into this a little... |
michaelwoerister
self-assigned this
Mar 29, 2016
This comment has been minimized.
This comment has been minimized.
|
That might be the culprit: rust/src/librustc/ty/context.rs Line 437 in 641204a pub fn crate_disambiguator(&self, cnum: ast::CrateNum) -> token::InternedString {
if cnum == LOCAL_CRATE {
self.sess.crate_disambiguator.get().as_str()
} else {
self.sess.cstore.crate_name(cnum)
}
}One at least... |
This comment has been minimized.
This comment has been minimized.
|
@michaelwoerister d'oh that looks like a copy-n-paste bug... On Tue, Mar 29, 2016 at 10:46 AM, Michael Woerister <
|
This comment has been minimized.
This comment has been minimized.
|
It does. I'm currently in the process of writing a test case for this. |
This comment has been minimized.
This comment has been minimized.
|
aren't these internal symbols anyway? |
This comment has been minimized.
This comment has been minimized.
|
@arielb1 Not necessarily when using multiple codegen units. And even otherwise, it's nice to have the same name across all crates. In theory, for a size-optimized build we might also want to switch to linkonce_odr or weak_odr linkage, in which case we'd also need the names to be the same. |
dotdash commentedMar 28, 2016
Given this:
cgu.rs
a.rs
We get two different symbol names for the monomorphizations of id.
cgu.ll
a.ll
cc @nikomatsakis @michaelwoerister