-
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
rustdoc: should we stop showing #[lang = ...]
and some other attributes?
#84309
Comments
Also perhaps we should truncate I know we used to hide attributes unconditionally and now we show them unconditionally since it's almost always one attribute so it's not a space saving thing, but there's the additional concern about it being distracting. We can probably allowlist to a set of attributes we care about ( cc @jsha |
There's already an allow list of attributes, but rust/src/librustdoc/html/render/mod.rs Lines 990 to 998 in b021bee
I'm removing I've tried truncating |
Oh! I feel like I've even seen that list before 😄, probably just forgot. Reducing the visual weight is a great idea, thanks!
|
Yeah, I agree. I wonder if we should also stop showing |
#[lang = ...]
and some other attributes?
I think |
Yeah, I find that duplication a bit annoying :) |
@jyn514 said at #83332 (comment):
I agree that we should link all attributes to their official docs. For |
I mean, I think it would also be useful to make items in the declaration clickable. |
It might be nice to use syntax highlighting for the declaration too. I don't think we'd even have to use the rustc lexer because rustdoc knows that e.g. it's emitting an attribute vs visibility. |
Remove must_use from ALLOWED_ATTRIBUTES This is a fairly common attribute on methods, but is not something you need to know when reading the method docs - the purpose of the attribute is for the compiler to tell you about it if you forget to use a value. Removing reclaims some valuable space in the summary of methods, particularly when the attribute has a long string value. As discussed in rust-lang#84309. Partially addresses rust-lang#81482. r? `@Manishearth`
Remove must_use from ALLOWED_ATTRIBUTES This is a fairly common attribute on methods, but is not something you need to know when reading the method docs - the purpose of the attribute is for the compiler to tell you about it if you forget to use a value. Removing reclaims some valuable space in the summary of methods, particularly when the attribute has a long string value. As discussed in rust-lang#84309. Partially addresses rust-lang#81482. r? ``@Manishearth``
Remove must_use from ALLOWED_ATTRIBUTES This is a fairly common attribute on methods, but is not something you need to know when reading the method docs - the purpose of the attribute is for the compiler to tell you about it if you forget to use a value. Removing reclaims some valuable space in the summary of methods, particularly when the attribute has a long string value. As discussed in rust-lang#84309. Partially addresses rust-lang#81482. r? ```@Manishearth```
rust/src/librustdoc/html/render/mod.rs Lines 1016 to 1017 in 2176e3a
|
I think it can be closed now indeed. |
It seems like we should not be showing
#[lang = ...]
(etc) attributes in rustdoc. Perhaps we should allowlist or denylist such attributes?cc @rust-lang/rustdoc
The text was updated successfully, but these errors were encountered: