Skip to content

Cargo is unable to resolve link conflicts for compiler extensions #4028

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

Closed
ishitatsuyuki opened this issue May 11, 2017 · 0 comments
Closed

Comments

@ishitatsuyuki
Copy link
Contributor

When you use a crate that is also used inside rustc...

   Compiling rls v0.1.0 (file:///home/ishitatsuyuki/Documents/rls)
error[E0523]: found two different crates with name `bitflags` that are not distinguished by differing `-C metadata`. This will result in symbol conflicts between the two.
  --> src/build.rs:12:1
   |
12 | extern crate rustc;
   | ^^^^^^^^^^^^^^^^^^^

error: Could not compile `rls`.

To learn more, run the command again with --verbose.

Trigger conditions:

  • opt_level is set to 2 (upstream settings)
  • Using rustc_private with one of the crates that compiler also use (e.g. bitflags, rustc-serialize)

This is really... broken. This bug is discovered during the process of rust-lang/rust#41639. Most compiler plugins (I tried clippy) are not affected, due to the nature of minimal dependencies they're using. It can be also reproduced on them if I added the dependency and extern crate clause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant