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

Support tool lints with the #[expect] attribute (RFC 2383) #95542

Merged
merged 6 commits into from
May 9, 2022

Conversation

xFrednet
Copy link
Member

@xFrednet xFrednet commented Mar 31, 2022

This PR fixes the ICE #94953 by making the assert for converted expectation IDs conditional.

Additionally, it moves the lint expectation check into a separate query to support rustdoc and other tools. On the way, I've also added some tests to ensure that the attribute works for Clippy and rustdoc lints.

The number of changes comes from the long test file. This may look like a monster PR, this may smell like a monster PR and this may be a monster PR, but it's a harmless monster. 🦕


Closes: #94953

cc: #85549

r? @wesleywiser

cc: @rust-lang/rustdoc

@rustbot rustbot added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Mar 31, 2022
@rust-highfive
Copy link
Collaborator

Some changes occurred in src/tools/clippy.

cc @rust-lang/clippy

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 31, 2022
@xFrednet xFrednet added the F-lint_reasons `#![feature(lint_reasons)]` label Apr 1, 2022
Copy link
Member

@flip1995 flip1995 left a comment

Choose a reason for hiding this comment

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

This LGTM. Though I'm not familiar with the query system and if just adding a new key for Option<Symbol> is ok, so I leave that to Wesley to decide.

compiler/rustc_middle/src/query/mod.rs Outdated Show resolved Hide resolved
@JohnCSimon JohnCSimon added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 24, 2022
@xFrednet
Copy link
Member Author

xFrednet commented May 3, 2022

Hey @wesleywiser, could you take a look at this PR? 🙃

Copy link
Member

@wesleywiser wesleywiser left a comment

Choose a reason for hiding this comment

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

Thanks for the ping @xFrednet! This looks really good and I'm glad to see we were able to resolve the ICE while keeping that check in place. I left one small suggestion with the tests added and then we can merge.

@xFrednet xFrednet force-pushed the rfc-2383-expect-query branch from 41208ff to c26742d Compare May 6, 2022 13:16
@xFrednet
Copy link
Member Author

xFrednet commented May 6, 2022

Thank you for the review! I've rebased on master as well. I've only changed the mentioned comment and updated the line numbers in the .stderr files. Everything else stayed the same 🙃

@wesleywiser
Copy link
Member

Awesome!

@bors r+

@bors
Copy link
Contributor

bors commented May 6, 2022

📌 Commit c26742d has been approved by wesleywiser

@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 6, 2022
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request May 6, 2022
…esleywiser

Support tool lints with the `#[expect]` attribute (RFC 2383)

This PR fixes the ICE rust-lang#94953 by making the assert for converted expectation IDs conditional.

Additionally, it moves the lint expectation check into a separate query to support rustdoc and other tools. On the way, I've also added some tests to ensure that the attribute works for Clippy and rustdoc lints.

The number of changes comes from the long test file. This may look like a monster PR, this may smell like a monster PR and this may be a monster PR, but it's a harmless monster. 🦕

---

Closes: rust-lang#94953

cc: rust-lang#85549

r? `@wesleywiser`

cc: `@rust-lang/rustdoc`
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request May 6, 2022
…esleywiser

Support tool lints with the `#[expect]` attribute (RFC 2383)

This PR fixes the ICE rust-lang#94953 by making the assert for converted expectation IDs conditional.

Additionally, it moves the lint expectation check into a separate query to support rustdoc and other tools. On the way, I've also added some tests to ensure that the attribute works for Clippy and rustdoc lints.

The number of changes comes from the long test file. This may look like a monster PR, this may smell like a monster PR and this may be a monster PR, but it's a harmless monster. 🦕

---

Closes: rust-lang#94953

cc: rust-lang#85549

r? ``@wesleywiser``

cc: ``@rust-lang/rustdoc``
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request May 7, 2022
…esleywiser

Support tool lints with the `#[expect]` attribute (RFC 2383)

This PR fixes the ICE rust-lang#94953 by making the assert for converted expectation IDs conditional.

Additionally, it moves the lint expectation check into a separate query to support rustdoc and other tools. On the way, I've also added some tests to ensure that the attribute works for Clippy and rustdoc lints.

The number of changes comes from the long test file. This may look like a monster PR, this may smell like a monster PR and this may be a monster PR, but it's a harmless monster. 🦕

---

Closes: rust-lang#94953

cc: rust-lang#85549

r? ```@wesleywiser```

cc: ```@rust-lang/rustdoc```
@bors
Copy link
Contributor

bors commented May 7, 2022

⌛ Testing commit c26742d with merge 3076beb64cc568bead8924a7d63edf516ce1a662...

@GuillaumeGomez
Copy link
Member

Failed in #96813:

 error: unresolved link to `unstable_expect_diagnostics`
   --> compiler/rustc_errors/src/lib.rs:429:15
    |
429 |     /// The [`unstable_expect_diagnostics`] should be empty when this struct is
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^ no item named `unstable_expect_diagnostics` in scope
    |
    = note: `-D rustdoc::broken-intra-doc-links` implied by `-D warnings`
    = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`

error: unresolved link to `unstable_expect_diagnostics`
   --> compiler/rustc_errors/src/lib.rs:432:20
    |
432 |     /// check if [`unstable_expect_diagnostics`] is empty, if the expectation ids
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^ no item named `unstable_expect_diagnostics` in scope
    |
    = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`

error: could not document `rustc_errors`

@bors r-

@bors
Copy link
Contributor

bors commented May 8, 2022

✌️ @xFrednet can now approve this pull request

@xFrednet
Copy link
Member Author

xFrednet commented May 8, 2022

Thanks, I thought about using r=wesleywiser before, but was unsure if that would be okay 😅

@bors r=wesleywiser

@bors
Copy link
Contributor

bors commented May 8, 2022

📌 Commit 332a9fa200f6e36fb8d5fbaf8e9fe0433562beea has been approved by wesleywiser

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 8, 2022
@bors
Copy link
Contributor

bors commented May 8, 2022

⌛ Testing commit 332a9fa200f6e36fb8d5fbaf8e9fe0433562beea with merge 7e33efee9b7aba31953af392753e6f8bb682bd82...

@bors
Copy link
Contributor

bors commented May 8, 2022

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels May 8, 2022
@rust-log-analyzer

This comment has been minimized.

@xFrednet
Copy link
Member Author

xFrednet commented May 8, 2022

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 8, 2022
@xFrednet xFrednet force-pushed the rfc-2383-expect-query branch from 332a9fa to 9516a40 Compare May 8, 2022 15:24
@xFrednet
Copy link
Member Author

xFrednet commented May 8, 2022

Let's hope that third times is the charm.

@bors r=wesleywiser rollup=iffy

@bors
Copy link
Contributor

bors commented May 8, 2022

📌 Commit 9516a40 has been approved by wesleywiser

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 8, 2022
@bors
Copy link
Contributor

bors commented May 9, 2022

⌛ Testing commit 9516a40 with merge a571179...

@bors
Copy link
Contributor

bors commented May 9, 2022

☀️ Test successful - checks-actions
Approved by: wesleywiser
Pushing a571179 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 9, 2022
@bors bors merged commit a571179 into rust-lang:master May 9, 2022
@rustbot rustbot added this to the 1.62.0 milestone May 9, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (a571179): comparison url.

Summary: This benchmark run did not return any relevant results.

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

xFrednet pushed a commit to xFrednet/rust that referenced this pull request May 21, 2022
…leywiser

Support tool lints with the `#[expect]` attribute (RFC 2383)

This PR fixes the ICE rust-lang#94953 by making the assert for converted expectation IDs conditional.

Additionally, it moves the lint expectation check into a separate query to support rustdoc and other tools. On the way, I've also added some tests to ensure that the attribute works for Clippy and rustdoc lints.

The number of changes comes from the long test file. This may look like a monster PR, this may smell like a monster PR and this may be a monster PR, but it's a harmless monster. 🦕

---

Closes: rust-lang#94953

cc: rust-lang#85549

r? `@wesleywiser`

cc: `@rust-lang/rustdoc`
@xFrednet xFrednet deleted the rfc-2383-expect-query branch June 3, 2022 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-lint_reasons `#![feature(lint_reasons)]` 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-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet