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

Implement RFC 3373: Avoid non-local definitions in functions #120393

Merged
merged 10 commits into from Feb 25, 2024

Conversation

Urgau
Copy link
Contributor

@Urgau Urgau commented Jan 26, 2024

@rustbot
Copy link
Collaborator

rustbot commented Jan 26, 2024

r? @petrochenkov

(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 Jan 26, 2024
@rustbot
Copy link
Collaborator

rustbot commented Jan 26, 2024

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rustbot
Copy link
Collaborator

rustbot commented Jan 26, 2024

Some changes occurred in src/tools/rustfmt

cc @rust-lang/rustfmt

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

Nadrieril added a commit to Nadrieril/rust that referenced this pull request Jan 27, 2024
…piler-errors

Improve handling of numbers in `IntoDiagnosticArg`

While working on rust-lang#120393, I realize that my fluent selectors were not working. So here is an improvement (not a fix unfortunately).
Nadrieril added a commit to Nadrieril/rust that referenced this pull request Jan 27, 2024
…piler-errors

Improve handling of numbers in `IntoDiagnosticArg`

While working on rust-lang#120393, I realize that my fluent selectors were not working. So here is an improvement (not a fix unfortunately).
Nadrieril added a commit to Nadrieril/rust that referenced this pull request Jan 27, 2024
…piler-errors

Improve handling of numbers in `IntoDiagnosticArg`

While working on rust-lang#120393, I realize that my fluent selectors were not working. So here is an improvement (not a fix unfortunately).
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jan 27, 2024
…piler-errors

Improve handling of numbers in `IntoDiagnosticArg`

While working on rust-lang#120393, I realize that my fluent selectors were not working. So here is an improvement (not a fix unfortunately).
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jan 27, 2024
Rollup merge of rust-lang#120398 - Urgau:into_diag_arg-numbers, r=compiler-errors

Improve handling of numbers in `IntoDiagnosticArg`

While working on rust-lang#120393, I realize that my fluent selectors were not working. So here is an improvement (not a fix unfortunately).
@rust-log-analyzer

This comment has been minimized.

compiler/rustc_lint/src/non_local_def.rs Outdated Show resolved Hide resolved
compiler/rustc_lint/src/non_local_def.rs Outdated Show resolved Hide resolved
compiler/rustc_lint/src/non_local_def.rs Outdated Show resolved Hide resolved
tests/ui/lint/non_local_definitions.rs Outdated Show resolved Hide resolved
tests/ui/lint/non_local_definitions.rs Outdated Show resolved Hide resolved
tests/ui/lint/non_local_definitions.rs Show resolved Hide resolved
compiler/rustc_lint/src/non_local_def.rs Outdated Show resolved Hide resolved
@WaffleLapkin WaffleLapkin self-assigned this Jan 27, 2024
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Feb 25, 2024

☀️ Test successful - checks-actions
Approved by: WaffleLapkin
Pushing b0d3e04 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Feb 25, 2024
@bors bors merged commit b0d3e04 into rust-lang:master Feb 25, 2024
12 checks passed
@rustbot rustbot added this to the 1.78.0 milestone Feb 25, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (b0d3e04): 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)
2.2% [0.5%, 4.2%] 12
Regressions ❌
(secondary)
0.7% [0.1%, 1.8%] 5
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.4% [-0.8%, -0.1%] 27
All ❌✅ (primary) 2.2% [0.5%, 4.2%] 12

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)
1.8% [0.8%, 4.7%] 4
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.0% [-2.0%, -2.0%] 1
All ❌✅ (primary) 1.8% [0.8%, 4.7%] 4

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)
2.7% [2.3%, 3.1%] 6
Regressions ❌
(secondary)
1.0% [1.0%, 1.0%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.7% [2.3%, 3.1%] 6

Binary size

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

Bootstrap: 650.73s -> 651.083s (0.05%)
Artifact size: 311.11 MiB -> 311.22 MiB (0.03%)

@rustbot rustbot added the perf-regression Performance regression. label Feb 25, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 26, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 26, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 27, 2024
@rylev
Copy link
Member

rylev commented Feb 27, 2024

For perf triage I'm going to mark this as triaged since #121625 is meant to try to address this. However, I hope that PR is currently only recovering a small fraction of the performance loss here. Given the complex nature of the change, I imagine a revert is not desirable though even if performance can't be gained back.

@rustbot label: +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Feb 27, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 27, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 27, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 28, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 29, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 29, 2024
@apiraino apiraino removed the to-announce Announce this issue on triage meeting label Feb 29, 2024
@Urgau
Copy link
Contributor Author

Urgau commented Feb 29, 2024

@rylev I tried very hard in #121625 to fix the perf regression, but it when mostly nowhere. My latest (and most promising) attempt end up having a correctness issue.

At some point I was wondering why diesel was the only benchmark to show any regressions (even in incremental), just to realize that in the Crater run some older versions of the crate were affect by the lint; and indeed it now produces 155 warnings!

No wonder why my all attempts went no-where.

If only I could have gotten kcachegrind working earlier it would have screamed this to me; it shows that 99.39% the instructions in the lint is the diagnostic machinery.

So in summary, there is no perf-regression per se, rustc is now just doing way more work because it has to display more than 155 different warnings.

For those curious:
image2

flip1995 pushed a commit to flip1995/rust that referenced this pull request Mar 7, 2024
…leLapkin

Implement RFC 3373: Avoid non-local definitions in functions

This PR implements [RFC 3373: Avoid non-local definitions in functions](rust-lang#120363).
@Urgau Urgau mentioned this pull request May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. 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-lang Relevant to the language team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

location / scoping of Impl