Rustdoc label trait feature#157058
Conversation
|
Some changes occurred in compiler/rustc_attr_parsing cc @jdonszelmann, @JonathanBrouwer Some changes occurred in compiler/rustc_passes/src/check_attr.rs cc @jdonszelmann, @JonathanBrouwer Some changes occurred in HTML/CSS/JS. cc @GuillaumeGomez, @lolbinarycat rust-analyzer is developed in its own repository. If possible, consider making this change to rust-lang/rust-analyzer instead. cc @rust-lang/rust-analyzer Some changes occurred in compiler/rustc_hir/src/attrs |
|
r? @fmease rustbot has assigned @fmease. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
I would generated the color hash from the trait path (so |
|
|
||
| let Some(impls) = cx.cache().impls.get(&did) else { return Vec::new() }; | ||
|
|
||
| let mut out: Vec<LabelTraitInfo> = impls |
There was a problem hiding this comment.
Instead of using a Vec, would be better to use a BTreeMap. It's sorted on insert and prevents duplications.
There was a problem hiding this comment.
I changed to do that but then collect it to Vec, keeping this discussion opened as I'm not sure if you meant something else.
This comment has been minimized.
This comment has been minimized.
2977320 to
6cddf7b
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
60688d1 to
58f56a9
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
6795d57 to
993c2d1
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
View all comments
its full pathShould the following be out of scope ?
#[doc(notable_trait(color="0xff0000")])Color discussion
I went for the higher chroma, even though some values use a fallback, I'm not opposed to go for a less chromatic palette, but that's very bikeshedding so I'll defer to authority.
with chroma 0.21:

with chroma 0.090:

History
Initially, this PR added a new feature "label_trait", it was then decided in rustdoc meeting to reuse current notable_trait feature.