Skip to content

Commit

Permalink
Rollup merge of #130798 - lukas-code:doc-stab, r=notriddle
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
tgross35 authored Sep 24, 2024
2 parents b627dc5 + 789bfcc commit 76b5237
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 76b5237

Please sign in to comment.