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

Respect #[expect] the same way #[allow] is with the dead_code lint #114710

Merged
merged 1 commit into from
Aug 12, 2023

Conversation

Urgau
Copy link
Member

@Urgau Urgau commented Aug 10, 2023

This PR makes the #[expect] attribute being respected in the same way the #[allow] attribute is with the dead_code lint.

The fix is much more involved than I would have liked (and it's not because I didn't tried!), because the implementation took advantage of the fact that firing a lint in a allow context is a no-op (for the user, as the lint is suppressed), to not fire-it at all.

And while it's fine for #[allow], it definitively isn't for #[expect], as the presence and absence of a lint is significant. So a big part of the PR is just adding the context information of whenever an item is on the worklist because of an [allow]/#[expect] or not.

Fixes #114557

@rustbot
Copy link
Collaborator

rustbot commented Aug 10, 2023

r? @TaKO8Ki

(rustbot has picked a reviewer for you, use r? to override)

@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 Aug 10, 2023
@lqd
Copy link
Member

lqd commented Aug 10, 2023

@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 Aug 10, 2023
@bors
Copy link
Contributor

bors commented Aug 10, 2023

⌛ Trying commit d801a2f with merge add9a3405485dd24dd88b285a65a8cf2b2961aaf...

@bors
Copy link
Contributor

bors commented Aug 10, 2023

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

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (add9a3405485dd24dd88b285a65a8cf2b2961aaf): 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

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)
5.2% [2.4%, 8.1%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

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: 632.409s -> 631.435s (-0.15%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 11, 2023
@cjgillot
Copy link
Contributor

Thanks for the fix. I agree this is the cleanest solution.
@bors r+

@bors
Copy link
Contributor

bors commented Aug 12, 2023

📌 Commit d801a2f has been approved by cjgillot

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 Aug 12, 2023
@bors
Copy link
Contributor

bors commented Aug 12, 2023

⌛ Testing commit d801a2f with merge 1e836d1...

@bors
Copy link
Contributor

bors commented Aug 12, 2023

☀️ Test successful - checks-actions
Approved by: cjgillot
Pushing 1e836d1 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 12, 2023
@bors bors merged commit 1e836d1 into rust-lang:master Aug 12, 2023
11 checks passed
@rustbot rustbot added this to the 1.73.0 milestone Aug 12, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (1e836d1): comparison URL.

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please open an issue or create a new PR that fixes the regressions, add a comment linking to the newly created issue or PR, and then add the perf-regression-triaged label to this PR.

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

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.5% [0.3%, 0.7%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.6% [-0.8%, -0.5%] 3
All ❌✅ (primary) 0.5% [0.3%, 0.7%] 2

Max RSS (memory usage)

Results

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)
5.6% [2.6%, 8.6%] 2
Improvements ✅
(primary)
-2.0% [-2.0%, -2.0%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.0% [-2.0%, -2.0%] 1

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: 632.973s -> 632.609s (-0.06%)

@rustbot rustbot added the perf-regression Performance regression. label Aug 12, 2023
@Urgau Urgau deleted the fix-expect-dead_code-114557 branch August 12, 2023 22:03
@pnkfelix
Copy link
Member

seems like noise

marking as triaged

@rustbot label: +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Aug 14, 2023
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. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. 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(dead_code)] does not behave identically to #[allow(dead_code)]
8 participants