-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
extern crate ... as std overrides the injected crate on 2018 edition #61019
Copy link
Copy link
Closed
Labels
A-HIRArea: The high-level intermediate representation (HIR)Area: The high-level intermediate representation (HIR)A-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.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.T-langRelevant to the language teamRelevant to the language team
Metadata
Metadata
Assignees
Labels
A-HIRArea: The high-level intermediate representation (HIR)Area: The high-level intermediate representation (HIR)A-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.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.T-langRelevant to the language teamRelevant to the language team
Type
Fields
Give feedbackNo fields configured for issues without a type.
On the 2018 edition the following code:
will:
Try to resolveprelude::v1::*insome_crate, failing if it doesn't exist. This probably limits the plausible cases where this could happen toextern crate core as std, andextern crate core as stdwith#![no_std].some_crateinany built-in derives and forHIR lowering.I would expect that the prelude and derives/HIR lowering to always use the injected std/core. Paths starting with
stdshould still resolve to the in the crate the user provided.In the 2015 edition it creates a name conflict with the implicit
extern crate std.cc @petrochenkov @eddyb