-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
creader: Host crate loaded twice produces different CrateNums if host != target #56935
Copy link
Copy link
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.
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.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Reproduction (as an UI test):
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
CrateNums, so we get the "inconsistent resolution for a macro" assertion.This happens due to the
locate_ctxt.triple == &self.sess.opts.target_triplecondition inCrateLoader::loadpreventing reuse ofCrateNums for host crates during cross-compilation.cc @alexcrichton probably