Skip to content
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

Reuse CrateNum for proc-macro crates even when cross-compiling #86876

Merged
merged 1 commit into from
Jul 15, 2021

Commits on Jul 15, 2021

  1. Reuse CrateNum for proc-macro crates even when cross-compiling

    Proc-macros are always compiled for the host, so this should be the same
    in every way as recompiling the crate.
    
    I am not sure why the previous code special-cased the target, since the
    compiler properly gives an error when trying to load a crate for a
    different host:
    
    ```
    error[E0461]: couldn't find crate `dependency` with expected target triple x86_64-unknown-linux-gnu
      --> /home/joshua/rustc4/src/test/ui/cfg-dependent.rs:8:2
       |
    LL |     dependency::is_64();
       |     ^^^^^^^^^^
       |
       = note: the following crate versions were found:
               crate `dependency`, target triple i686-unknown-linux-gnu: /home/joshua/rustc4/build/x86_64-unknown-linux-gnu/test/ui/cfg-dependent/auxiliary/libdependency.so
    ```
    
    I think another possible fix is to remove the check altogether. But I'm
    not sure, and this fix works, so I'm not making the larger change here.
    jyn514 committed Jul 15, 2021
    Configuration menu
    Copy the full SHA
    68b9598 View commit details
    Browse the repository at this point in the history