rust/src/librustc_interface
Mazdak Farrokhzad 40fae88fa8
Rollup merge of #64324 - alexcrichton:share-generics-again, r=michaelwoerister
rustc: Fix mixing crates with different `share_generics`

This commit addresses #64319 by removing the `dylib` crate type from the
list of crate type that exports generic symbols. The bug in #64319
arises because a `dylib` crate type was trying to export a symbol in an
uptream crate but it miscalculated the symbol name of the uptream
symbol. This isn't really necessary, though, since `dylib` crates aren't
that heavily used, so we can just conservatively say that the `dylib`
crate 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_generics` method, indicating that
  it's now `false` for the `Dylib` crate type. Only rlibs actually
  export 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_generics` options,
ultimately...

Closes #64319
2019-09-25 03:48:22 +02:00
..
profile Remove redundant imports 2019-03-30 22:37:02 +01:00
build.rs Locate rustc binary similarly to codegen backend loading 2019-09-10 16:57:14 -04:00
Cargo.toml Locate rustc binary similarly to codegen backend loading 2019-09-10 16:57:14 -04:00
interface.rs Remove lint annotations in specific crates that are already enforced by rustbuild 2019-07-28 18:46:24 +03:00
lib.rs Deny unused_lifetimes through rustbuild 2019-07-28 18:47:02 +03:00
passes.rs Rollup merge of #64324 - alexcrichton:share-generics-again, r=michaelwoerister 2019-09-25 03:48:22 +02:00
proc_macro_decls.rs rename hir::map::local_def_id_from_hir_id to local_def_id 2019-07-04 12:53:12 +02:00
queries.rs Add a comment to Compiler::compile(). 2019-09-19 06:56:52 +10:00
util.rs Locate rustc binary similarly to codegen backend loading 2019-09-10 16:57:14 -04:00