Skip to content

track the version and PR in which a nightly feature was removed #141619

Closed
@jyn514

Description

@jyn514

Code

#![feature(external_doc)]
#![doc(include("README.md"))]

Current output

error[E0557]: feature has been removed
 --> src/lib.rs:1:12
  |
1 | #![feature(external_doc)]
  |            ^^^^^^^^^^^^ feature has been removed
  |
  = note: use #[doc = include_str!("filename")] instead, which handles macro invocations

error: unknown `doc` attribute `include`
 --> src/lib.rs:2:8
  |
2 | #![doc(include("README.md"))]
  |        ^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[deny(invalid_doc_attributes)]` on by default

Desired output

error[E0557]: feature has been removed
 --> src/lib.rs:1:12
  |
1 | #![feature(external_doc)]
  |            ^^^^^^^^^^^^ feature has been removed
  |
  = note: removed in 1.54 (you are using 1.89-nightly); see <https://github.com/rust-lang/rust/pull/85457>
  = note: use #[doc = include_str!("filename")] instead, which handles macro invocations

Rationale and extra context

this makes it more clear what is going on, and also gives people enough breadcrumbs to find more information. right now it is very hard to find info about removed features without trawling through the code (it took me about 15 minutes just now, and i am both the person who removed this feature and the one who stabilized its replacement).

saying the version also makes it more clear that "removed" is specifically about versions, and tells the person compiling the code that using an older toolchain will likely work. this matters because the person seeing this error is likely not the one who wrote the code, and possibly knows very little about rust's stability policy.

Other cases

Rust Version

1.89.0-nightly

(2025-05-25 283db70ace62a0ae704a)

Anything else?

No response

Metadata

Metadata

Assignees

Labels

A-diagnosticsArea: Messages for errors, warnings, and lintsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-help-wantedCall for participation: Help is requested to fix this issue.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions