Files
rust/tests/ui/bootstrap
Nicholas Nethercote de902bb264 Improve nightly option parse errors
Currently the command `rustc -Zunstable-options -j3 --jobs-backend=1
a.rs`, when run on stable rustc, gives this:
```
error: the option `Z` is only accepted on the nightly compiler

error: the option `jobs` is only accepted on the nightly compiler

error: the option `jobs-backend` is only accepted on the nightly compiler

help: consider switching to a nightly toolchain: `rustup default nightly`

note: selecting a toolchain with `+toolchain` arguments require a rustup proxy; see <https://rust-lang.github.io/rustup/concepts/index.html>

note: for more information about Rust's stability policy, see <https://doc.rust-lang.org/book/appendix-07-nightly-rust.html#unstable-features>

error: 3 nightly options were parsed
```

The errors are fine, but top-level help and notes are weird.

This commit changes it to this, which is more normal:
```
error: the option `Z` is only accepted on the nightly compiler

error: the option `jobs` is only accepted on the nightly compiler

error: the option `jobs-backend` is only accepted on the nightly compiler

error: 3 nightly options were parsed
  |
  = help: consider switching to a nightly toolchain: `rustup default nightly`
  = note: selecting a toolchain with `+toolchain` arguments require a rustup proxy; see <https://rust-lang.github.io/rustup/concepts/index.html>
  = note: for more information about Rust's stability policy, see <https://doc.rust-lang.org/book/appendix-07-nightly-rust.html#unstable-features>
```

It's a slightly different order but that seems fine.

The commit also makes two other small improvements:
- An unnecessary `match opt.stability` is removed. (There's another
  `opt.stability` check a few lines above.)
- It fixes "1 nightly option were parsed" to "1 nightly option was
  parsed".
2026-09-12 11:07:23 +10:00
..