-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Fully document rustdoc-json-types
#127290
Fully document rustdoc-json-types
#127290
Conversation
rustdoc-json-types is a public (although nightly-only) API. If possible, consider changing |
This comment has been minimized.
This comment has been minimized.
d68cac0
to
662f4e5
Compare
☔ The latest upstream changes (presumably #127305) made this pull request unmergeable. Please resolve the merge conflicts. |
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.
Thanks for working on this. Unfortunately, it needs a lot of changes before it's suitable to merge.
I've left a comment for all the major categories of issue, but not for each instance as that got unwieldy. When they've all been fixed, please mark this as ready, and I'll take another look at it.
@rustbot author
There are merge commits (commits with multiple parents) in your changes. We have a no merge policy so these commits will need to be removed for this pull request to be merged. You can start a rebase with the following commands:
The following commits are merge commits: |
4624360
to
83d3158
Compare
There are merge commits (commits with multiple parents) in your changes. We have a no merge policy so these commits will need to be removed for this pull request to be merged. You can start a rebase with the following commands:
The following commits are merge commits (since this message was last posted): |
83d3158
to
15fef33
Compare
@rustbot review I'm not sure about my wording for FORMAT_VERSION though, but I am sure that we should elaborate a bit on what does it actually convey, are there ways to improve? |
☔ The latest upstream changes (presumably #127665) made this pull request unmergeable. Please resolve the merge conflicts. |
29371be
to
4980bf3
Compare
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 is alot closer, thanks for working on it.
src/rustdoc-json-types/lib.rs
Outdated
pub synthetic: bool, | ||
/// The name of the generic parameter used for the blanket impl, if this impl was produced by | ||
/// one. For example, for `impl<T, U> Into<U> for T` this field would be `"T"`. |
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.
How is this different from for_
?
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.
As discussed here, I'm happy to leave this to a follup-up, as long as a FIXME comment is added to improve the situation here.
@rustbot author |
28b790b
to
5ac2f69
Compare
@rustbot review |
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.
@rustbot author
src/rustdoc-json-types/lib.rs
Outdated
pub synthetic: bool, | ||
/// The name of the generic parameter used for the blanket impl, if this impl was produced by | ||
/// one. For example, for `impl<T, U> Into<U> for T` this field would be `"T"`. |
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.
As discussed here, I'm happy to leave this to a follup-up, as long as a FIXME comment is added to improve the situation here.
src/rustdoc-json-types/lib.rs
Outdated
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] | ||
#[serde(rename_all = "snake_case")] | ||
pub enum Type { | ||
/// Structs, enums, and unions | ||
/// Structs, enums, unions, etc., e.g. `std::option::Option<u32>` |
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.
It's better to exaustive here. This code:
rust/src/tools/jsondoclint/src/item_kind.rs
Lines 133 to 135 in 2cbbe8b
pub fn is_type(self) -> bool { | |
matches!(self, Kind::Struct | Kind::Enum | Kind::Union | Kind::TypeAlias) | |
} |
controls the things we expect to find here. If you remove Kind::TypeAlias
you can see where it appears here
src/rustdoc-json-types/lib.rs
Outdated
Generic(String), | ||
/// Built in numeric (i*, u*, f*) types, bool, and char | ||
/// Built-in types, such as the integers, floating-point numbers, `bool`, and `char`. |
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.
The problems is you suggest that all built-in types are documented as Type::Primitive
, when this isn't the case. I.E. there are built-in types that arn't primitives (e.g. (i32, i32)
and &'static str
@rustbot review |
This looks good to merge now. If you're able, you should squash the commits, as they arn't logically separate, and it makes tracking the format evolution easier. r=me with commits squashed. Thanks again for working on this, and sticking through the many rounds of review. |
537295d
to
c881f72
Compare
@bors r+ rollup |
Nicely done, this is a major improvement and I love it! |
…iaskrgr Rollup of 5 pull requests Successful merges: - rust-lang#109174 (Replace `io::Cursor::{remaining_slice, is_empty}`) - rust-lang#127290 (Fully document `rustdoc-json-types`) - rust-lang#128055 (std: unsafe-wrap personality::dwarf::eh) - rust-lang#128269 (improve cargo invocations on bootstrap) - rust-lang#128310 (Add missing periods on `BTreeMap` cursor `peek_next` docs) Failed merges: - rust-lang#127543 (More unsafe attr verification) - rust-lang#128182 (handle no_std targets on std builds) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#127290 - its-the-shrimp:document_rustdoc_json_types, r=aDotInTheVoid Fully document `rustdoc-json-types` 100% of `rustdoc-json-types` is now documented Here's the summary from rustdoc with `-Zunstable-options --show-coverage`: ``` +-------------------------------------+------------+------------+------------+------------+ | File | Documented | Percentage | Examples | Percentage | +-------------------------------------+------------+------------+------------+------------+ | src/rustdoc-json-types/lib.rs | 314 | 100.0% | 23 | 31.9% | +-------------------------------------+------------+------------+------------+------------+ | Total | 314 | 100.0% | 23 | 31.9% | +-------------------------------------+------------+------------+------------+------------+ ```
100% of
rustdoc-json-types
is now documentedHere's the summary from rustdoc with
-Zunstable-options --show-coverage
: