-
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
Print more tags in rustdoc #37134
Print more tags in rustdoc #37134
Conversation
vec!("repr").iter().any(|x| x == &s) | ||
} | ||
|
||
fn render_attribute(attr: &clean::Attribute, recurse: bool) -> String { |
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.
Returning Option<String>
seems appropriate instead of possibly returning an empty string
} | ||
|
||
fn attribute_with_values(s: &str) -> bool { | ||
vec!("repr").iter().any(|x| x == &s) |
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.
["repr"].iter().any(|x| x == &s)
Same goes above
+0 for me on this. I don't like displaying attributes in the docs in general like we do currently with |
cc #37012 |
I could add a |
@bors: delegate=kmcallister |
✌️ @kmcallister can now approve this pull request |
I feel similarly to @frewsxcv . /cc @rust-lang/tools @rust-lang/docs |
The screenshot shows unbalanced brackets: #[repr(i32])]
pub struct F; |
I'd prefer not to do this by default - attributes are mostly an implementation detail and this adds visual clutter. +1 for a show_attributes option some how. On the implementation side - why have this ad hoc pretty printing? Why not use the source text? Or the compiler's pretty printer? |
@nrc: I actually didn't know there was. And if there was, why not using it from the start? If it's in order to filter the output, we'll still need it. |
f4c004d
to
520d5f4
Compare
Similarly to #37250, gonna wait until after the beta branch to merge this |
Beta has been branched! Let's see how the wider community feels about this. @bors: r+ |
📌 Commit 520d5f4 has been approved by |
…klabnik Print more tags in rustdoc r? @steveklabnik cc @frewsxcv A little screenshot: <img width="1440" alt="screen shot 2016-10-13 at 01 41 53" src="https://cloud.githubusercontent.com/assets/3050060/19331745/873cd71e-90e6-11e6-88f8-715668366a3f.png">
r? @steveklabnik
cc @frewsxcv
A little screenshot: