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

Convert builtin "global" late lints to run per module #113734

Merged
merged 8 commits into from
Aug 5, 2023

Conversation

cjgillot
Copy link
Contributor

@cjgillot cjgillot commented Jul 15, 2023

The compiler currently has 4 non-incremental lints:

  1. clashing_extern_declarations;
  2. missing_debug_implementations;
  3. unnameable_test_items; changed by Make test harness lint about unnnameable tests. #114414
  4. missing_docs.

Non-incremental lints get reexecuted for each compilation, which is slow. Moreover, those lints are allow-by-default, so run for nothing most of the time. This PR attempts to make them more incremental-friendly.

clashing_extern_declarations is moved to a standalone query.

missing_debug_implementation can use non_blanket_impls_for_ty instead of recomputing it.

missing_docs is harder as it needs to track if there is a doc(hidden) module surrounding. I hack around this using the lint level engine. That's easy to implement and allows to re-enable the lint for a re-exported module, while a more proper solution would reuse the same device as unnameable_test_items.

@rustbot
Copy link
Collaborator

rustbot commented Jul 15, 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Jul 15, 2023
@cjgillot
Copy link
Contributor Author

@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 Jul 15, 2023
@bors
Copy link
Contributor

bors commented Jul 15, 2023

⌛ Trying commit f79296b3077e49380fb3b70761fab33d65e413a0 with merge 48a02fa0c7ccb590217148ef329202c4883e7230...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Jul 15, 2023

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

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (48a02fa0c7ccb590217148ef329202c4883e7230): comparison URL.

Overall result: ❌✅ regressions and improvements - 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.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +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
Regressions ❌
(secondary)
0.9% [0.7%, 1.0%] 4
Improvements ✅
(primary)
-2.2% [-4.2%, -0.6%] 108
Improvements ✅
(secondary)
-5.2% [-26.7%, -0.2%] 72
All ❌✅ (primary) -2.2% [-4.2%, -0.6%] 108

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)
2.5% [2.5%, 2.5%] 1
Improvements ✅
(primary)
-2.5% [-6.5%, -0.6%] 95
Improvements ✅
(secondary)
-6.0% [-13.3%, -0.7%] 62
All ❌✅ (primary) -2.5% [-6.5%, -0.6%] 95

Cycles

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)
-3.6% [-7.1%, -1.5%] 86
Improvements ✅
(secondary)
-7.9% [-28.2%, -2.1%] 52
All ❌✅ (primary) -3.6% [-7.1%, -1.5%] 86

Binary size

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.1% [0.1%, 0.2%] 4
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.1% [-0.1%, -0.1%] 2
All ❌✅ (primary) 0.1% [0.1%, 0.2%] 4

Bootstrap: 657.257s -> 656.692s (-0.09%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jul 15, 2023
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@cjgillot
Copy link
Contributor Author

cc @rust-lang/rustdoc for the change to missing docs lint.

workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Jul 16, 2023
…chenkov

Simplify native_libs query

Drive-by cleanup I saw while implementing rust-lang#113734
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Jul 19, 2023
…chenkov

Simplify native_libs query

Drive-by cleanup I saw while implementing rust-lang#113734
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Jul 19, 2023
…chenkov

Simplify native_libs query

Drive-by cleanup I saw while implementing rust-lang#113734
@cjgillot
Copy link
Contributor Author

cjgillot commented Aug 3, 2023

r? compiler

@bors

This comment was marked as resolved.

bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 4, 2023
…trochenkov

Make test harness lint about unnnameable tests.

Implementation of rust-lang#113734 (comment)

About the options suggested in rust-lang#36629 (comment): adding this case to unused_attribute was just more complicated. I'll try to understand a bit more what you had in mind in rust-lang/rfcs#2471 (comment)

This was just simpler to do in a standalone PR. I'll remove the corresponding changes from rust-lang#113734 later.

r? `@petrochenkov`
@cjgillot cjgillot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 4, 2023
@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Aug 5, 2023

📌 Commit 905b63d has been approved by petrochenkov

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 5, 2023
RalfJung pushed a commit to RalfJung/miri that referenced this pull request Aug 5, 2023
Make test harness lint about unnnameable tests.

Implementation of rust-lang/rust#113734 (comment)

About the options suggested in rust-lang/rust#36629 (comment): adding this case to unused_attribute was just more complicated. I'll try to understand a bit more what you had in mind in rust-lang/rfcs#2471 (comment)

This was just simpler to do in a standalone PR. I'll remove the corresponding changes from rust-lang/rust#113734 later.

r? `@petrochenkov`
@bors
Copy link
Contributor

bors commented Aug 5, 2023

⌛ Testing commit 905b63d with merge 67626b8...

@bors
Copy link
Contributor

bors commented Aug 5, 2023

☀️ Test successful - checks-actions
Approved by: petrochenkov
Pushing 67626b8 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 5, 2023
@bors bors merged commit 67626b8 into rust-lang:master Aug 5, 2023
@rustbot rustbot added this to the 1.73.0 milestone Aug 5, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (67626b8): comparison URL.

Overall result: ✅ improvements - 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
Regressions ❌
(secondary)
0.5% [0.4%, 0.8%] 3
Improvements ✅
(primary)
-1.7% [-3.4%, -0.2%] 88
Improvements ✅
(secondary)
-4.2% [-26.5%, -0.2%] 85
All ❌✅ (primary) -1.7% [-3.4%, -0.2%] 88

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)
2.1% [2.1%, 2.1%] 1
Improvements ✅
(primary)
-3.0% [-8.8%, -0.5%] 105
Improvements ✅
(secondary)
-6.1% [-12.2%, -0.6%] 66
All ❌✅ (primary) -3.0% [-8.8%, -0.5%] 105

Cycles

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)
-2.9% [-5.3%, -1.7%] 54
Improvements ✅
(secondary)
-8.4% [-28.8%, -1.1%] 56
All ❌✅ (primary) -2.9% [-5.3%, -1.7%] 54

Binary size

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.1% [0.0%, 0.1%] 4
Regressions ❌
(secondary)
0.0% [0.0%, 0.0%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.1% [0.0%, 0.1%] 4

Bootstrap: 650.338s -> 649.856s (-0.07%)

@rustbot rustbot removed the perf-regression Performance regression. label Aug 5, 2023
@cjgillot cjgillot deleted the no-crate-lint branch August 5, 2023 11:59
@Kobzol
Copy link
Contributor

Kobzol commented Aug 5, 2023

Awesome results!

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. 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.

9 participants