-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-crossArea: Cross compilationArea: Cross compilationA-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-metadataArea: Crate metadataArea: Crate metadataA-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specificallyC-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
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
A-crossArea: Cross compilationArea: Cross compilationA-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-metadataArea: Crate metadataArea: Crate metadataA-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specificallyC-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.