Skip to content
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: Negative impls are not notable #125134

Merged

Conversation

compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented May 15, 2024

In #124097, we add impl !Iterator for [T] for coherence reasons, and since Iterator is a notable trait, this means that all -> &[_] now are tagged with a !Iterator impl as a notable trait.

I "fixed" the failing tests in that PR with 6cbbb8b, where I just blessed the tests, since I didn't want to mix these changes with that PR; however, don't believe negative impls are notable, and this PR aims to prevent these impls from being mentioned.

In the standard library, we use negative impls purely to guide coherence. They're not really a signal of anything useful to the end-user. If there ever is a case that we want negative impls to be mentioned as notable, this really should be an opt-in feature.

@rustbot
Copy link
Collaborator

rustbot commented May 15, 2024

r? @fmease

rustbot has assigned @fmease.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels May 15, 2024
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if we need the positive test because we have a bunch of them already (rg 'notable-traits-data' test/rustdoc)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't hurt to show that a negative impl doesn't disqualify the positive impl though

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point!

Copy link
Member

@fmease fmease left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise looks good. I'm surprised too see that we do a bunch of similar logic in notable_traits_{decl,button}. Ideally, you wouldn't've need to update two places. Anyway, I would need to look into that a bit deeper so see if that could be avoided through a refactor.

@fmease
Copy link
Member

fmease commented May 15, 2024

Thanks! @bors r+ rollup

@bors
Copy link
Contributor

bors commented May 15, 2024

📌 Commit 8994840 has been approved by fmease

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 15, 2024
@bors
Copy link
Contributor

bors commented May 15, 2024

⌛ Testing commit 8994840 with merge b21b74b...

@bors
Copy link
Contributor

bors commented May 15, 2024

☀️ Test successful - checks-actions
Approved by: fmease
Pushing b21b74b to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 15, 2024
@bors bors merged commit b21b74b into rust-lang:master May 15, 2024
7 checks passed
@rustbot rustbot added this to the 1.80.0 milestone May 15, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (b21b74b): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.3% [0.3%, 0.3%] 1
Regressions ❌
(secondary)
2.1% [2.1%, 2.1%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.3% [0.3%, 0.3%] 1

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 678.357s -> 680.309s (0.29%)
Artifact size: 316.14 MiB -> 316.05 MiB (-0.03%)

@fmease
Copy link
Member

fmease commented May 15, 2024

(perf regressions spurious, not in doc profile)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants