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

Enumerate lint expectations using AttrId #130050

Merged
merged 2 commits into from
Sep 11, 2024
Merged

Conversation

cjgillot
Copy link
Contributor

@cjgillot cjgillot commented Sep 6, 2024

This PR implements the idea I outlined in #127884 (comment)

We can uniquely identify a lint expectation #[expect(lint0, lint1...)] using the AttrId and the index of the lint inside the attribute. This PR uses this property in check_expectations.

In addition, this PR stops stashing expected diagnostics to wait for the unstable -> stable LintExpectationId mapping: if the lint is emitted with an unstable attribute, it must have been emitted by an eval_always query (like inside the resolver), so won't be loaded from cache. Decoding an AttrId from the on-disk cache ICEs, so we have no risk of accidentally checking an expectation.

Fixes #127884

cc @xFrednet

@rustbot
Copy link
Collaborator

rustbot commented Sep 6, 2024

r? @fee1-dead

rustbot has assigned @fee1-dead.
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-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 6, 2024
@cjgillot
Copy link
Contributor Author

cjgillot commented Sep 6, 2024

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 6, 2024
@bors
Copy link
Contributor

bors commented Sep 6, 2024

⌛ Trying commit 94f8347 with merge f42cfbb...

bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 6, 2024
Enumerate lint expectations using AttrId

This PR implements the idea I outlined in rust-lang#127884 (comment)

We can uniquely identify a lint expectation `#[expect(lint0, lint1...)]` using the `AttrId` and the index of the lint inside the attribute. This PR uses this property in `check_expectations`.

In addition, this PR stops stashing expected diagnostics to wait for the unstable -> stable `LintExpectationId` mapping: if the lint is emitted with an unstable attribute, it must have been emitted by an `eval_always` query (like inside the resolver), so won't be loaded from cache. Decoding an `AttrId` from the on-disk cache ICEs, so we have no risk of accidentally checking an expectation.

Fixes rust-lang#127884

cc `@xFrednet`
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Sep 7, 2024

☀️ Try build successful - checks-actions
Build commit: f42cfbb (f42cfbbecfcb9306dd61e55c19101dfa87b5d3e8)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (f42cfbb): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

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

Max RSS (memory usage)

Results (secondary -2.5%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

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

Cycles

Results (secondary 4.1%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

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

Binary size

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

Bootstrap: 756.217s -> 756.219s (0.00%)
Artifact size: 341.14 MiB -> 341.19 MiB (0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 7, 2024
Copy link
Member

@fee1-dead fee1-dead left a comment

Choose a reason for hiding this comment

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

LGTM, this is pretty much a clean up in my view.

@fee1-dead
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Sep 7, 2024

📌 Commit 6dfc403 has been approved by fee1-dead

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 Sep 7, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 10, 2024
Enumerate lint expectations using AttrId

This PR implements the idea I outlined in rust-lang#127884 (comment)

We can uniquely identify a lint expectation `#[expect(lint0, lint1...)]` using the `AttrId` and the index of the lint inside the attribute. This PR uses this property in `check_expectations`.

In addition, this PR stops stashing expected diagnostics to wait for the unstable -> stable `LintExpectationId` mapping: if the lint is emitted with an unstable attribute, it must have been emitted by an `eval_always` query (like inside the resolver), so won't be loaded from cache. Decoding an `AttrId` from the on-disk cache ICEs, so we have no risk of accidentally checking an expectation.

Fixes rust-lang#127884

cc `@xFrednet`
@bors
Copy link
Contributor

bors commented Sep 10, 2024

⌛ Testing commit 6dfc403 with merge 49bbdae...

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-msvc-ext failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@bors
Copy link
Contributor

bors commented Sep 10, 2024

💔 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 Sep 10, 2024
@cjgillot
Copy link
Contributor Author

@bors retry

@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 Sep 11, 2024
@bors
Copy link
Contributor

bors commented Sep 11, 2024

⌛ Testing commit 6dfc403 with merge 4c5fc2c...

@bors
Copy link
Contributor

bors commented Sep 11, 2024

☀️ Test successful - checks-actions
Approved by: fee1-dead
Pushing 4c5fc2c to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 11, 2024
@bors bors merged commit 4c5fc2c into rust-lang:master Sep 11, 2024
7 checks passed
@rustbot rustbot added this to the 1.83.0 milestone Sep 11, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (4c5fc2c): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

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

Max RSS (memory usage)

Results (secondary 2.1%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
4.7% [4.6%, 4.8%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.0% [-3.0%, -3.0%] 1
All ❌✅ (primary) - - 0

Cycles

Results (secondary 21.1%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
21.1% [19.9%, 22.6%] 6
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 756.649s -> 755.32s (-0.18%)
Artifact size: 341.32 MiB -> 341.31 MiB (-0.00%)

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-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

#[expect(unused_imports)] does not work correctly on grouped imports
6 participants