Closed
Description
Code
$(rustup which rustc --toolchain 1.68) +nightly -Zunstable-options
Current output
error: the option `Z` is only accepted on the nightly compiler
Desired output
error: the option `Z` is only accepted on the nightly compiler
error: couldn't read +nightly: No such file or directory (os error 2)
|
= note: selecting a toolchain with `+toolchain` arguments require a rustup proxy; see <https://rust-lang.github.io/rustup/concepts/index.html>
Rationale and extra context
Distros often install rustc directly, without a rustup wrapper. In that case, people using the distro rustc may see suggestions on stack overflow or elsewhere that won't work with their toolchain. We should improve the error message for them.
Originally reported in #104785.
Other cases
No response
Anything else?
Note that to test your change for this issue, you'll have to set channel = "stable"
in config.toml; nightly reports a different error:
; $(rustup which rustc --toolchain nightly) +nightly -Zunstable-options
error: couldn't read +nightly: No such file or directory (os error 2)
error: aborting due to previous error
Metadata
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsArea: `#[stable]`, `#[unstable]` etc.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Relevant to the compiler team, which will review and decide on the PR/issue.