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

Exhaustiveness: simplify empty pattern logic #119835

Merged
merged 5 commits into from
Jan 20, 2024

Conversation

Nadrieril
Copy link
Member

The logic that handles empty patterns had gotten quite convoluted. This PR simplifies it a lot. I tried to make the logic as easy as possible to follow; this only does logically equivalent changes.

The first commit is a drive-by comment clarification that was requested after another PR a while back.

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 10, 2024
@bors

This comment was marked as outdated.

@compiler-errors
Copy link
Member

I'll review this in a few days

@bors

This comment was marked as outdated.

@pnkfelix
Copy link
Member

@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 16, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 16, 2024
Exhaustiveness: simplify empty pattern logic

The logic that handles empty patterns had gotten quite convoluted. This PR simplifies it a lot. I tried to make the logic as easy as possible to follow; this only does logically equivalent changes.

The first commit is a drive-by comment clarification that was requested after another PR a while back.

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

bors commented Jan 16, 2024

⌛ Trying commit d95644d with merge ce365bf...

@bors
Copy link
Contributor

bors commented Jan 16, 2024

☀️ Try build successful - checks-actions
Build commit: ce365bf (ce365bf014f3fb5a50598105c64e4b1ddb2d9338)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (ce365bf): comparison URL.

Overall result: no relevant changes - 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 benchmark run did not return any relevant results for this metric.

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)
- - 0
Improvements ✅
(secondary)
-1.7% [-1.9%, -1.5%] 2
All ❌✅ (primary) - - 0

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)
2.3% [2.3%, 2.3%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 664.25s -> 663.387s (-0.13%)
Artifact size: 308.27 MiB -> 308.39 MiB (0.04%)

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

i will review this tomorrow along w/ the other one, ping me on thursday if i have not

@compiler-errors
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Jan 17, 2024

📌 Commit d95644d has been approved by compiler-errors

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 Jan 17, 2024
@compiler-errors
Copy link
Member

@bors rollup=maybe

bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 19, 2024
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#117561 (Stabilize `slice_first_last_chunk`)
 - rust-lang#117662 ([rustdoc] Allows links in headings)
 - rust-lang#119815 (Format sources into the error message when loading codegen backends)
 - rust-lang#119835 (Exhaustiveness: simplify empty pattern logic)
 - rust-lang#119984 (Change return type of unstable `Waker::noop()` from `Waker` to `&Waker`.)
 - rust-lang#120009 (never_patterns: typecheck never patterns)
 - rust-lang#120122 (Don't add needs-triage to A-diagnostics)
 - rust-lang#120126 (Suggest `.swap()` when encountering conflicting borrows from `mem::swap` on a slice)
 - rust-lang#120134 (Restrict access to the private field of newtype indexes)

Failed merges:

 - rust-lang#119968 (Remove unused/unnecessary features)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 20, 2024
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#117561 (Stabilize `slice_first_last_chunk`)
 - rust-lang#117662 ([rustdoc] Allows links in headings)
 - rust-lang#119815 (Format sources into the error message when loading codegen backends)
 - rust-lang#119835 (Exhaustiveness: simplify empty pattern logic)
 - rust-lang#119984 (Change return type of unstable `Waker::noop()` from `Waker` to `&Waker`.)
 - rust-lang#120009 (never_patterns: typecheck never patterns)
 - rust-lang#120122 (Don't add needs-triage to A-diagnostics)
 - rust-lang#120126 (Suggest `.swap()` when encountering conflicting borrows from `mem::swap` on a slice)
 - rust-lang#120134 (Restrict access to the private field of newtype indexes)

Failed merges:

 - rust-lang#119968 (Remove unused/unnecessary features)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 2587100 into rust-lang:master Jan 20, 2024
12 checks passed
@rustbot rustbot added this to the 1.77.0 milestone Jan 20, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jan 20, 2024
Rollup merge of rust-lang#119835 - Nadrieril:simplify-empty-logic, r=compiler-errors

Exhaustiveness: simplify empty pattern logic

The logic that handles empty patterns had gotten quite convoluted. This PR simplifies it a lot. I tried to make the logic as easy as possible to follow; this only does logically equivalent changes.

The first commit is a drive-by comment clarification that was requested after another PR a while back.

r? `@compiler-errors`
@Nadrieril Nadrieril deleted the simplify-empty-logic branch January 20, 2024 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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