-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Confusing diagnostics for unstable features when building Rust with stable rustc #110067
Copy link
Copy link
Closed
Closed
Copy link
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Type
Fields
Give feedbackNo fields configured for issues without a type.
I'm trying to build Rust on a Tier 3 platform (
riscv64-alpine-linux-musl; actually it'sriscv64-unknown-muslthat's listed in Tier 3, but I don't think that affects the problem). Since there are no snapshots for this platform, I installed rustc from the distro's package manager (apk) and created aconfig.tomlfile to force using the pre-installed rustc rather than downloading snapshots:And the output of
rustc --version -v:I ran
./x.py build; when it got as far as building the core library, I got a series of errors that were very hard to make sense of until I realized that it's because core library code depends on unstable features and I was using a stable rustc to compile it:There were many more errors, but I think they all relate to unstable features.
It took me ages to figure out that (for example) the first error is due to the
const_closuresfeature being disabled in stable.I understand that the stable compiler won't allow using unstable features even with
-Zunstable-options, but is it possible for the parser to recognize this code even so and reject it with something like "featureconst_closuresis not enabled" instead of the much more generic "expected identifier" error?