Closed
Description
Reproduction (as an UI test):
// force-host
// no-prefer-dynamic
#![crate_type = "proc-macro"]
extern crate proc_macro;
use proc_macro::TokenStream;
#[proc_macro]
pub fn mac(input: TokenStream) -> TokenStream {
input
}
// edition:2018
// compile-flags:--extern reproduction
// aux-build:reproduction.rs
reproduction::mac!();
fn main() {}
# Assuming x86_64-unknown-linux-gnu host
./x.py test --bless --stage 1 --target i686-unknown-linux-gnu src/test/ui --test-args reproduction
Name resolution will try to load the crate twice, first in initial pass, then in validation pass.
The results will be different due to different loaded CrateNum
s, so we get the "inconsistent resolution for a macro" assertion.
This happens due to the locate_ctxt.triple == &self.sess.opts.target_triple
condition in CrateLoader::load
preventing reuse of CrateNum
s for host crates during cross-compilation.
cc @alexcrichton probably
Metadata
Metadata
Assignees
Labels
Area: Cross compilationArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: Crate metadataArea: Name/path resolution done by `rustc_resolve` specificallyCategory: This is a bug.Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Relevant to the compiler team, which will review and decide on the PR/issue.