-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Add RTN support to rustdoc #137956
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
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. |
src/rustdoc-json-types/lib.rs
Outdated
@@ -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.
src/rustdoc-json-types/lib.rs
Outdated
@@ -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.
pub const FORMAT_VERSION: u32 = 41; | |
pub const FORMAT_VERSION: u32 = 42; |
Blocking PR #138109 has been merged. Unblocked. |
c95ee4d
to
e3ac1fa
Compare
bumped to version 42 @bors r=fmease |
Rollup of 16 pull requests Successful merges: - rust-lang#133055 (Expand `CloneToUninit` documentation.) - rust-lang#137147 (Add exclude to config.toml) - rust-lang#137864 (Don't drop `Rvalue::WrapUnsafeBinder` during GVN) - rust-lang#137890 (doc: clarify that consume can be called after BufReader::peek) - rust-lang#137956 (Add RTN support to rustdoc) - rust-lang#137968 (Properly escape regexes in Python scripts) - rust-lang#138082 (Remove `#[cfg(not(test))]` gates in `core`) - rust-lang#138275 (expose `is_s390x_feature_detected!` from `std::arch`) - rust-lang#138303 (Fix Ptr inconsistency in {Rc,Arc}) - rust-lang#138309 (Add missing doc for intrinsic (Fix PR135334)) - rust-lang#138323 (Expand and organize `offset_of!` documentation.) - rust-lang#138329 (debug-assert that the size_hint is well-formed in `collect`) - rust-lang#138465 (linkchecker: bump html5ever) - rust-lang#138471 (Clean up some tests in tests/ui) - rust-lang#138472 (Add codegen test for rust-lang#129795) - rust-lang#138484 (Use lit span when suggesting suffix lit cast) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#137956 - compiler-errors:rtn-rustdoc, r=fmease Add RTN support to rustdoc 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: ```rust pub fn foreign<T: Foreign<bar(..): Send>>() where <T as Foreign>::bar(..): 'static, T::bar(..): Sync, ``` Into this: ```rust pub fn foreign<T>() where T: Foreign, impl Future<Output = ()>: Send + 'static + Sync, ``` 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 like `T::method(..)`. Partially addresses rust-lang#123996 (i.e., HIR side, not middle::ty one)
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(..)
.Partially addresses #123996 (i.e., HIR side, not middle::ty one)