-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Add RTN support to rustdoc #137956
base: master
Are you sure you want to change the base?
Add RTN support to rustdoc #137956
Conversation
rustdoc-json-types is a public (although nightly-only) API. If possible, consider changing cc @CraftSpider, @aDotInTheVoid, @Enselic, @obi1kenobi Some changes occurred in tests/rustdoc-json |
…2, r=jieyouxu triagebot.toml: Don't label `test/rustdoc-json` as A-rustdoc-search This happened because `test/rustdoc-js` is a prefix of `test/rustdoc-json`, and triagebot works on prefixes. Maybe this should be fixed in triagebot, but this works now. This happened on rust-lang#137956 and rust-lang#137955.
Rollup merge of rust-lang#137958 - aDotInTheVoid:aDotInTheVoid-patch-2, r=jieyouxu triagebot.toml: Don't label `test/rustdoc-json` as A-rustdoc-search This happened because `test/rustdoc-js` is a prefix of `test/rustdoc-json`, and triagebot works on prefixes. Maybe this should be fixed in triagebot, but this works now. This happened on rust-lang#137956 and rust-lang#137955.
☔ The latest upstream changes (presumably #138155) made this pull request unmergeable. Please resolve the merge conflicts. |
@@ -30,7 +30,7 @@ pub type FxHashMap<K, V> = HashMap<K, V>; // re-export for use in src/librustdoc | |||
/// This integer is incremented with every breaking change to the API, | |||
/// and is returned along with the JSON blob as [`Crate::format_version`]. | |||
/// Consuming code should assert that this value matches the format version(s) that it supports. | |||
pub const FORMAT_VERSION: u32 = 40; | |||
pub const FORMAT_VERSION: u32 = 41; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This adds support to rustdoc and rustdoc-json for rendering
(..)
RTN (return type notation) style generics.Cleaning
rustc_middle::ty::Ty
is not correct still, though, and ends up rendering a function like:Into this:
This is because
clean_middle_ty
doesn't actually have sufficient context about whether the RPITIT is in its "defining scope" or not, so we don't know if the type was originally written like-> impl Trait
or with RTN likeT::method(..)
.Closes #123996