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

rustc_lint: Enforce rustc::potential_query_instability lint #119251

Merged
merged 2 commits into from
Dec 31, 2023

Conversation

Enselic
Copy link
Member

@Enselic Enselic commented Dec 23, 2023

Stop allowing rustc::potential_query_instability on all of rustc_lint and instead allow it on a case-by-case basis if it is safe to do so. In this particular crate, all lints were safe to allow.

Part of #84447 which is E-help-wanted.

@rustbot
Copy link
Collaborator

rustbot commented Dec 23, 2023

r? @wesleywiser

(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 Dec 23, 2023
@@ -1028,6 +1028,8 @@ impl<'s, P: LintLevelsProvider> LintLevelsBuilder<'s, P> {
}

if !is_crate_node {
// We break on the first lint, and it does not matter which one.
Copy link
Contributor

Choose a reason for hiding this comment

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

It may not matter, but emitting a different diagnostic depending on the architecture is a bug.

Copy link
Member Author

@Enselic Enselic Dec 31, 2023

Choose a reason for hiding this comment

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

I changed current_specs() to return a &FxIndexMap, which only cascaded to 13 other places, which seems fine. So now the iteration order here should be deterministic.

(Due to conflicts with master I also had to rebase.)

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 29, 2023
… r=cjgillot

rustc_lint: Prevent triplication of various lints

Prevent triplication of various lints. The triplication happens because we run the same lint three times (or less in some cases):
* In `BuiltinCombinedPreExpansionLintPass`
* In `BuiltinCombinedEarlyLintPass`
* In `shallow_lint_levels_on()`

Only run the lints one time by checking the `lint_added_lints` bool.

Set your GitHub diff setting to ignore whitespaces changes when reviewing this PR, since I had to enclose a block inside an if.

Closes rust-lang#73301

(I found this while exploring the code related to [this](rust-lang#119251 (comment)) comment.)
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Dec 30, 2023
Rollup merge of rust-lang#119388 - Enselic:prevent-lint-triplication, r=cjgillot

rustc_lint: Prevent triplication of various lints

Prevent triplication of various lints. The triplication happens because we run the same lint three times (or less in some cases):
* In `BuiltinCombinedPreExpansionLintPass`
* In `BuiltinCombinedEarlyLintPass`
* In `shallow_lint_levels_on()`

Only run the lints one time by checking the `lint_added_lints` bool.

Set your GitHub diff setting to ignore whitespaces changes when reviewing this PR, since I had to enclose a block inside an if.

Closes rust-lang#73301

(I found this while exploring the code related to [this](rust-lang#119251 (comment)) comment.)
@bors
Copy link
Contributor

bors commented Dec 30, 2023

☔ The latest upstream changes (presumably #119421) made this pull request unmergeable. Please resolve the merge conflicts.

…exMap`

So that lint iteration order becomes predicitable. Discovered with
`rustc::potential_query_instability`.
Stop allowing `rustc::potential_query_instability` on all of
`rustc_lint` and instead allow it on a case-by-case basis if it is safe
to do so. In this particular crate, all lints were safe to allow.
@Enselic
Copy link
Member Author

Enselic commented Dec 31, 2023

r? @cjgillot

@rustbot rustbot assigned cjgillot and unassigned wesleywiser Dec 31, 2023
@cjgillot
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Dec 31, 2023

📌 Commit 295d600 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 Dec 31, 2023
@bors
Copy link
Contributor

bors commented Dec 31, 2023

⌛ Testing commit 295d600 with merge e51e98d...

@bors
Copy link
Contributor

bors commented Dec 31, 2023

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 31, 2023
@bors bors merged commit e51e98d into rust-lang:master Dec 31, 2023
12 checks passed
@rustbot rustbot added this to the 1.77.0 milestone Dec 31, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (e51e98d): comparison URL.

Overall result: ❌ regressions - 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.2% [0.2%, 0.3%] 2
Regressions ❌
(secondary)
0.3% [0.2%, 0.4%] 8
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.2% [0.2%, 0.3%] 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)
- - 0
Improvements ✅
(primary)
-1.3% [-2.2%, -0.4%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -1.3% [-2.2%, -0.4%] 2

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: 665.69s -> 666.95s (0.19%)
Artifact size: 311.76 MiB -> 311.74 MiB (-0.01%)

@Enselic
Copy link
Member Author

Enselic commented Jan 1, 2024

The performance regression should be fixed by #119488.

@Mark-Simulacrum Mark-Simulacrum added the perf-regression-triaged The performance regression has been triaged. label Jan 8, 2024
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.

7 participants