Commit 4efeda7
authored
fix(toml): show required rust-version in unstable edition error (#16653)
## What does this PR try to resolve?
Fixes the unhelpful error when a package declares an unstable edition on
a
stable Cargo toolchain. Previously the error told the user to "try a
newer
version of Cargo" but gave no indication of *which* version, forcing
them to
dig through docs.
This PR adds a `help:` line that names the required toolchain version,
derived from the package's `rust-version` field (or from
`Edition::first_version()` once that is set at unstable time).
Before:
```
Consider trying a newer version of Cargo (this may require the nightly release).
See https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#unstable-editions
```
After:
```
Consider trying a newer version of Cargo (this may require the nightly release).
help: mypackage@0.1.0 requires rustc 1.90
See https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#unstable-editions
```
Also fixes a latent bug in `edition_unstable_gated`: it expected
`feature 'edition{next}'` but current code emits `feature
'unstable-editions'`.
The test was silently skipping because `Edition::LATEST_UNSTABLE` is
`None`.
Fixes #153053 files changed
Lines changed: 62 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
733 | 733 | | |
734 | 734 | | |
735 | 735 | | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
736 | 749 | | |
737 | 750 | | |
738 | 751 | | |
| |||
773 | 786 | | |
774 | 787 | | |
775 | 788 | | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
776 | 792 | | |
777 | 793 | | |
778 | 794 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1359 | 1359 | | |
1360 | 1360 | | |
1361 | 1361 | | |
1362 | | - | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
1363 | 1371 | | |
1364 | 1372 | | |
1365 | 1373 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
245 | 282 | | |
246 | 283 | | |
247 | 284 | | |
| |||
0 commit comments