Skip to content

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

Merged
bors merged 10 commits intorust-lang:masterfrom
Urgau:rfc3373-non-local-defs
Feb 25, 2024
Merged

Implement RFC 3373: Avoid non-local definitions in functions#120393
bors merged 10 commits intorust-lang:masterfrom
Urgau:rfc3373-non-local-defs

Conversation

@Urgau
Copy link
Member

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

@Urgau Urgau force-pushed the rfc3373-non-local-defs branch from 844e9bd to e9aeaaa Compare January 27, 2024 00:11
@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).
@Urgau Urgau force-pushed the rfc3373-non-local-defs branch from e9aeaaa to 686077e Compare January 27, 2024 12:16
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.

@WaffleLapkin WaffleLapkin self-assigned this Jan 27, 2024
@Urgau Urgau force-pushed the rfc3373-non-local-defs branch from 686077e to db51d11 Compare January 27, 2024 12:38
@rust-log-analyzer

This comment has been minimized.

@Urgau Urgau force-pushed the rfc3373-non-local-defs branch from db51d11 to 27d6eaa Compare January 27, 2024 14:26
@Urgau
Copy link
Member Author

Urgau commented Feb 21, 2024

@Dylan-DPC I appreciate your enthusiasm, but the FCP isn't finished yet (no finished-final-comment-period The final comment period is finished for this PR / Issue. ), it will finish this saturday.

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 21, 2024
@rfcbot rfcbot added finished-final-comment-period The final comment period is finished for this PR / Issue. to-announce Announce this issue on triage meeting and removed final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. labels Feb 24, 2024
@rfcbot
Copy link

rfcbot commented Feb 24, 2024

The final comment period, with a disposition to merge, as per the review above, is now complete.

As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.

This will be merged soon.

@Urgau
Copy link
Member Author

Urgau commented Feb 24, 2024

@bors r=@WaffleLapkin

@bors
Copy link
Collaborator

bors commented Feb 24, 2024

📌 Commit 63469ab has been approved by WaffleLapkin

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Feb 25, 2024

⌛ Testing commit 63469ab with merge b0d3e04...

@bors
Copy link
Collaborator

bors commented Feb 25, 2024

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

@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%)

@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

@Urgau
Copy link
Member 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.

Details

For those curious:
image2

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

location / scoping of Impl