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

pattern_analysis: Gracefully abort on type incompatibility #120313

Merged
merged 1 commit into from
Feb 5, 2024

Conversation

Nadrieril
Copy link
Member

This leaves the option for a consumer of the crate to return Err instead of panicking on type error. rust-analyzer could use that (e.g. rust-lang/rust-analyzer#15808).

Since the only use of TypeCx::bug is in Constructor::is_covered_by, it is tempting to return false instead of Err(), but that would cause "non-exhaustive match" false positives.

r? @compiler-errors

@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 24, 2024
@Nadrieril
Copy link
Member Author

This will regress match-stress

@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 Jan 24, 2024
@bors
Copy link
Contributor

bors commented Jan 24, 2024

⌛ Trying commit 8ea37ae with merge 8d0058e...

bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 24, 2024
pattern_analysis: Gracefully abort on type incompatibility

This leaves the option for a consumer of the crate to return `Err` instead of panicking on type error. rust-analyzer could use that (e.g. rust-lang/rust-analyzer#15808).

Since the only use of `TypeCx::bug` is in `Constructor::is_covered_by`, it is tempting to return `false` instead of `Err()`, but that would cause "non-exhaustive match" false positives.

r? `@compiler-errors`
@bors
Copy link
Contributor

bors commented Jan 24, 2024

☀️ Try build successful - checks-actions
Build commit: 8d0058e (8d0058ec16c5c41713eb54d3da9fd1ead2edc5e9)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (8d0058e): comparison URL.

Overall result: ❌ regressions - 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 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)
2.2% [2.2%, 2.2%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

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)
3.1% [3.1%, 3.1%] 1
Regressions ❌
(secondary)
3.0% [1.3%, 4.7%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-4.1% [-4.1%, -4.1%] 1
All ❌✅ (primary) 3.1% [3.1%, 3.1%] 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: 663.194s -> 663.003s (-0.03%)
Artifact size: 308.36 MiB -> 308.37 MiB (0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 24, 2024
@Nadrieril
Copy link
Member Author

Lol, for once I did not regress match-stress

@Nadrieril
Copy link
Member Author

Nadrieril commented Jan 28, 2024

Grmbl, bors didn't tell me about the merge conflict again :(

@Nadrieril Nadrieril force-pushed the graceful-error branch 2 times, most recently from b15141a to 7d53726 Compare January 30, 2024 16:40
@Nadrieril
Copy link
Member Author

I rebased onto #120321 because conflicts, only the last commit is this PR

Copy link
Member

@compiler-errors compiler-errors left a comment

Choose a reason for hiding this comment

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

r=me

Since the only use of `TypeCx::bug` is in `Constructor::is_covered_by`,
it is tempting to return `false` instead of `Err()`, but that would
cause "non-exhaustive match" false positives.
@compiler-errors compiler-errors 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-review Status: Awaiting review from the assignee but also interested parties. labels Feb 1, 2024
@compiler-errors
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Feb 1, 2024

📌 Commit 400dc46 has been approved by compiler-errors

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Feb 1, 2024

🌲 The tree is currently closed for pull requests below priority 100. This pull request will be tested once the tree is reopened.

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 1, 2024
@Nadrieril
Copy link
Member Author

Ah nice, CI is back on

@bors rollup

@Nadrieril
Copy link
Member Author

What am I doing, this one had a perf regression

@bors rollup=never

@bors
Copy link
Contributor

bors commented Feb 5, 2024

⌛ Testing commit 400dc46 with merge f067fd6...

@bors
Copy link
Contributor

bors commented Feb 5, 2024

☀️ Test successful - checks-actions
Approved by: compiler-errors
Pushing f067fd6 to master...

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

Finished benchmarking commit (f067fd6): 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
Regressions ❌
(secondary)
1.9% [1.8%, 2.0%] 6
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

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)
3.3% [3.3%, 3.4%] 2
Regressions ❌
(secondary)
3.9% [3.5%, 4.5%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.5% [-3.5%, -3.5%] 1
All ❌✅ (primary) 3.3% [3.3%, 3.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: 660.166s -> 661.246s (0.16%)
Artifact size: 308.14 MiB -> 308.13 MiB (-0.00%)

@rustbot rustbot added the perf-regression Performance regression. label Feb 6, 2024
@Nadrieril Nadrieril deleted the graceful-error branch February 6, 2024 04:12
@Kobzol
Copy link
Contributor

Kobzol commented Feb 13, 2024

The pattern matching machinery is now being changed a lot, and the match-stress benchmark is swinging back and forth. I don't think it's needed to dig deeper on this.

@rustbot label: +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Feb 13, 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.

6 participants