-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
core::error::Error has incorrect stabilization version #130765
Comments
This might be a bit tricky because you can't just change the feature gate on AFAICT #[stable(feature = "rust1", since = "1.0.0")]
pub use core::error::Error; But the #[stable(feature = "rust1", since = "1.0.0")]
pub trait Error: Debug + Display { ... } If I change the stability attribute on Stabilization of Haven't looked into this too closely, it could be a couple of things in rustc stability attribute handling -> rustdoc rendering together that leads to this behavior. |
Note that |
I've put up a PR to change the displayed stability/version number in rustdoc: #130798 |
Rollup merge of rust-lang#130798 - lukas-code:doc-stab, r=notriddle rustdoc: inherit parent's stability where applicable It is currently not possible for a re-export to have a different stability (rust-lang#30827). Therefore the standard library uses a hack when moving items like `std::error::Error` or `std::net::IpAddr` into `core` by marking the containing module (`core::error` / `core::net`) as unstable or stable in a later version than the items the module contains. Previously, rustdoc would always show the *stability as declared* for an item rather than the *stability as publicly reachable* (i.e. the features required to actually access the item), which could be confusing when viewing the docs. This PR changes it so that we show the stability of the first unstable parent or the most recently stabilized parent instead, to hopefully make things less confusing. fixes rust-lang#130765 screenshots: ![error in std](https://github.com/user-attachments/assets/2ab9bdb9-ed81-4e45-a832-ac7d3ba1be3f) ![error in core](https://github.com/user-attachments/assets/46f46182-5642-4ac5-b92e-0b99a8e2496d)
rustdoc: inherit parent's stability where applicable It is currently not possible for a re-export to have a different stability (rust-lang/rust#30827). Therefore the standard library uses a hack when moving items like `std::error::Error` or `std::net::IpAddr` into `core` by marking the containing module (`core::error` / `core::net`) as unstable or stable in a later version than the items the module contains. Previously, rustdoc would always show the *stability as declared* for an item rather than the *stability as publicly reachable* (i.e. the features required to actually access the item), which could be confusing when viewing the docs. This PR changes it so that we show the stability of the first unstable parent or the most recently stabilized parent instead, to hopefully make things less confusing. fixes rust-lang/rust#130765 screenshots: ![error in std](https://github.com/user-attachments/assets/2ab9bdb9-ed81-4e45-a832-ac7d3ba1be3f) ![error in core](https://github.com/user-attachments/assets/46f46182-5642-4ac5-b92e-0b99a8e2496d)
Location
https://doc.rust-lang.org/nightly/core/error/trait.Error.html
Summary
Within this page, the stabilization version of
Error
is set as1.0.0
, whenError
incore
has only just recently been stabilized.The text was updated successfully, but these errors were encountered: