Skip to content

Skip unnecessary comparison with half-open range patterns #121376

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 2 commits into from
Feb 29, 2024

Conversation

Nadrieril
Copy link
Member

@Nadrieril Nadrieril commented Feb 21, 2024

This is the last remaining detail in the implementation of half-open range patterns. Until now, a half-open range pattern like 10.. was converted to 10..T::MAX before lowering to MIR, which generated an extra pointless comparison. With this PR we don't generate it.

@Nadrieril Nadrieril added the F-half_open_range_patterns `#![feature(half_open_range_patterns)]` label Feb 21, 2024
@rustbot
Copy link
Collaborator

rustbot commented Feb 21, 2024

r? @pnkfelix

rustbot has assigned @pnkfelix.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@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 Feb 21, 2024
@pnkfelix
Copy link
Member

(I'll r+ this once I get an answer to my question above)

@rustbot label: -S-waiting-on-review +S-waiting-on-author

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

Nadrieril commented Feb 27, 2024

Fixed the documentation to clarify the invariant I was relying on.

@rustbot ready

(fyi @rustbot author does exactly @rustbot label: -S-waiting-on-review +S-waiting-on-author)

@rustbot rustbot 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 Feb 27, 2024
@pnkfelix
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Feb 29, 2024

📌 Commit 7c6960e has been approved by pnkfelix

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 Feb 29, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 29, 2024
…llaumeGomez

Rollup of 7 pull requests

Successful merges:

 - rust-lang#119748 (Increase visibility of `join_path` and `split_paths`)
 - rust-lang#120820 (Enable CMPXCHG16B, SSE3, SAHF/LAHF and 128-bit Atomics (in nightly) in Windows x64)
 - rust-lang#121000 (pattern_analysis: rework how we hide empty private fields)
 - rust-lang#121376 (Skip unnecessary comparison with half-open range patterns)
 - rust-lang#121596 (Use volatile access instead of `#[used]` for `on_tls_callback`)
 - rust-lang#121669 (Count stashed errors again)
 - rust-lang#121783 (Emitter cleanups)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 2e0a26a into rust-lang:master Feb 29, 2024
@rustbot rustbot added this to the 1.78.0 milestone Feb 29, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Feb 29, 2024
Rollup merge of rust-lang#121376 - Nadrieril:mir-half-ranges, r=pnkfelix

Skip unnecessary comparison with half-open range patterns

This is the last remaining detail in the implementation of half-open range patterns. Until now, a half-open range pattern like `10..` was converted to `10..T::MAX` before lowering to MIR, which generated an extra pointless comparison. With this PR we don't generate it.
@Nadrieril Nadrieril deleted the mir-half-ranges branch February 29, 2024 21:21
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
F-half_open_range_patterns `#![feature(half_open_range_patterns)]` 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.

4 participants