-
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
Reintroduce spotlight / "important traits" feature #74370
Conversation
Some changes occurred in HTML/CSS/JS. Some changes occurred in HTML/CSS themes. |
r? @ollie27 (rust_highfive has picked a reviewer for you, use r? to override) |
c35e99d
to
1a6fe87
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.
|
||
if let Some(did) = decl.output.def_id() { | ||
let c = cache(); | ||
if let Some(impls) = c.impls.get(&did) { |
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.
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.
Given that this is reintroducing an old feature that was previously accepted in this form, can we handle this as a followup?
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.
Like, I want to ladn this so we can gather more community feedback on this feature and grow it. It's a feature that existed in this form for a while and was recently removed, my priority is getting it back in so we can improve it.
@ollie27 Guillaume has said he's good with this once we have your approval. Would you be okay with landing this with followups filed? I would rather keep this PR scoped to mostly bringing the feature back as is, with some basic UI changes. I want to do improvements differently, with a tracking issue. |
I'm really not a fan of reintroducing bugs but I guess it's not the end of the world. There's even an old issue still open (#55082) for the impls that aren't applicable. Could the issue with free functions I pointed out in #74370 (review) be fixed though? That wasn't an issue with the old implementation. If it's too difficult to fix then the important traits feature could be disabled for those functions for now. |
Yeah I can fix that, i didn't immediately understand what the bug was but I do now |
@ollie27 Guillaume is holding off on r+ing until you confirm the fix above, can you do so? |
☔ The latest upstream changes (presumably #72481) made this pull request unmergeable. Please resolve the merge conflicts. |
We need it for run buttons (rust-lang#44671), but not function defs
a497fd3
to
c621a54
Compare
Looks good now, glad it was an easy fix. |
@bors r=GuillaumeGomez |
📌 Commit c621a54 has been approved by |
🌲 The tree is currently closed for pull requests below priority 5, this pull request will be tested once the tree is reopened |
…meGomez Reintroduce spotlight / "important traits" feature (Reopened version of rust-lang#74111 because Github is broken, see discussion there) Fixes rust-lang#73785 This PR reintroduces the "spotlight" ("important traits") feature. A couple changes have been made: As there were concerns about its visibility, it has been moved to be next to the return type, as opposed to being on the side. It also no longer produces a modal, it shows the traits on hover, and it can be clicked on to pin the hover bubble. ![image](https://user-images.githubusercontent.com/1617736/86674555-a82d2600-bfad-11ea-9a4a-a1a9ffd66ae5.png) ![image](https://user-images.githubusercontent.com/1617736/86674533-a1061800-bfad-11ea-9e8a-c62ad86ed0d7.png) It also works fine on mobile: ![image](https://user-images.githubusercontent.com/1617736/86674638-bda25000-bfad-11ea-8d8d-1798b608923e.png)
…arth Rollup of 21 pull requests Successful merges: - rust-lang#73566 (Don't run `everybody_loops` for rustdoc; instead ignore resolution errors) - rust-lang#73771 (Don't pollute docs/suggestions with libstd deps) - rust-lang#73794 (Small cleanup for E0705 explanation) - rust-lang#73807 (rustdoc: glue tokens before highlighting) - rust-lang#73835 (Clean up E0710 explanation) - rust-lang#73926 (Ignoring test case: [codegen] repr-transparent-aggregates-1.rs for aarch64) - rust-lang#73981 (Remove some `ignore-stage1` annotations.) - rust-lang#73998 (add regression test for rust-lang#61216) - rust-lang#74140 (Make hir ProjectionKind more precise) - rust-lang#74148 (Move #[doc(alias)] check in rustc) - rust-lang#74159 (forbid generic params in the type of const params) - rust-lang#74171 (Fix 44056 test with debug on macos.) - rust-lang#74221 (Don't panic if the lhs of a div by zero is not statically known) - rust-lang#74325 (Focus on the current file in the source file sidebar) - rust-lang#74359 (rustdoc: Rename internal API fns to `into_string`) - rust-lang#74370 (Reintroduce spotlight / "important traits" feature) - rust-lang#74390 (Fix typo in std::mem::transmute documentation) - rust-lang#74391 (BtreeMap: superficially refactor root access) - rust-lang#74392 (const generics triage) - rust-lang#74397 (Fix typo in the latest release note) - rust-lang#74406 (Set shell for github actions CI) Failed merges: r? @ghost
I'll do the follow-ups soonish |
Followup: #74417 I'll open an internals thread to workshop the UI and name once it's on nightly |
(Reopened version of #74111 because Github is broken, see discussion there)
Fixes #73785
This PR reintroduces the "spotlight" ("important traits") feature.
A couple changes have been made:
As there were concerns about its visibility, it has been moved to be next to the return type, as opposed to being on the side.
It also no longer produces a modal, it shows the traits on hover, and it can be clicked on to pin the hover bubble.
It also works fine on mobile: