Skip to content

RegionValues: disable unnecessary range check#158026

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
amandasystems:region-values-point-no-range-check
Jun 19, 2026
Merged

RegionValues: disable unnecessary range check#158026
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
amandasystems:region-values-point-no-range-check

Conversation

@amandasystems

Copy link
Copy Markdown
Contributor

Currently, when adding liveness points to region values in the RegionValues struct, the locations of the points are checked for ranges. This is unnecessarily cautious because they always are in range by construction. The docstring for the method used in the checks suggests that it was designed for underlying bit sets that currently aren't used for this.

This adds documentation (including debug assertions) to make this clearer and removes the checks, which should have a strictly positive impact on performance.

@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 Jun 17, 2026
@rustbot

rustbot commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

r? @petrochenkov

rustbot has assigned @petrochenkov.
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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: borrowck, compiler
  • borrowck, compiler expanded to 73 candidates
  • Random selection from 21 candidates

Comment thread compiler/rustc_borrowck/src/region_infer/values.rs Outdated
Comment thread compiler/rustc_borrowck/src/region_infer/values.rs Outdated
Comment thread compiler/rustc_borrowck/src/region_infer/values.rs
@petrochenkov

Copy link
Copy Markdown
Contributor

This looks reasonable, but I'm not familiar with this code, feel free to reassign if necessary.
@rustbot 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 Jun 18, 2026
@rustbot

rustbot commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

Currently, when adding liveness points to region values
in the `RegionValues` struct, the locations of the points
are checked for ranges. This is unnecessarily cautious because
they always are in range by construction.

This adds documentation (including debug assertions) to make this
clearer and removes the checks, which should have a strictly
positive impact on performance.
@amandasystems amandasystems force-pushed the region-values-point-no-range-check branch from 8441082 to dbf6d75 Compare June 18, 2026 14:20
@amandasystems

Copy link
Copy Markdown
Contributor Author

That should be all of the comments!

@rustbot ready

@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 Jun 18, 2026
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

A job failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
  IMAGE: x86_64-gnu-gcc
##[endgroup]
    Updating crates.io index
error: failed to get `adler2` as a dependency of package `miniz_oxide v0.8.8`
    ... which satisfies dependency `miniz_oxide = "^0.8.5"` of package `flate2 v1.1.9`
    ... which satisfies dependency `flate2 = "^1.1.9"` of package `citool v0.1.0 (/home/runner/work/rust/rust/src/ci/citool)`

Caused by:
  failed to load source for dependency `adler2`

Caused by:
  unable to update registry `crates-io`

Caused by:
  download of ad/le/adler2 failed

Caused by:
  curl failed

Caused by:

@petrochenkov

Copy link
Copy Markdown
Contributor

The CI failure is spurious.
@bors r+

@rust-bors

rust-bors Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

📌 Commit dbf6d75 has been approved by petrochenkov

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 Jun 18, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jun 18, 2026
…no-range-check, r=petrochenkov

`RegionValues`: disable unnecessary range check

Currently, when adding liveness points to region values in the `RegionValues` struct, the locations of the points are checked for ranges. This is unnecessarily cautious because they always are in range by construction. The docstring for the method used in the checks suggests that it was designed for underlying bit sets that currently aren't used for this.

This adds documentation (including debug assertions) to make this clearer and removes the checks, which should have a strictly positive impact on performance.
rust-bors Bot pushed a commit that referenced this pull request Jun 18, 2026
…uwer

Rollup of 6 pull requests

Successful merges:

 - #158026 (`RegionValues`: disable unnecessary range check)
 - #156795 (Handle generic reborrow in expression-use adjustment walking)
 - #157694 (Enhance documentation on wake call memory ordering)
 - #158034 (Fix reborrow source expression visits)
 - #158074 (Document transient connection errors from TcpListener::accept)
 - #158086 (renovate: Loosen dashboard approval and adopt recommended config)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jun 18, 2026
…no-range-check, r=petrochenkov

`RegionValues`: disable unnecessary range check

Currently, when adding liveness points to region values in the `RegionValues` struct, the locations of the points are checked for ranges. This is unnecessarily cautious because they always are in range by construction. The docstring for the method used in the checks suggests that it was designed for underlying bit sets that currently aren't used for this.

This adds documentation (including debug assertions) to make this clearer and removes the checks, which should have a strictly positive impact on performance.
rust-bors Bot pushed a commit that referenced this pull request Jun 18, 2026
…uwer

Rollup of 10 pull requests

Successful merges:

 - #158026 (`RegionValues`: disable unnecessary range check)
 - #156795 (Handle generic reborrow in expression-use adjustment walking)
 - #157694 (Enhance documentation on wake call memory ordering)
 - #157935 (Make `proc_macro::ConversionErrorKind` non exhaustive)
 - #158002 (Replace `unwrap` with `expect` in `get_module_children`)
 - #158034 (Fix reborrow source expression visits)
 - #158072 (Bump thin-vec to 0.2.18 to address RUSTSEC-2026-0103)
 - #158074 (Document transient connection errors from TcpListener::accept)
 - #158077 (rustdoc-json-types: Replace bincode dev-dependency with postcard)
 - #158086 (renovate: Loosen dashboard approval and adopt recommended config)
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jun 18, 2026
…eck, r=petrochenkov

`RegionValues`: disable unnecessary range check

Currently, when adding liveness points to region values in the `RegionValues` struct, the locations of the points are checked for ranges. This is unnecessarily cautious because they always are in range by construction. The docstring for the method used in the checks suggests that it was designed for underlying bit sets that currently aren't used for this.

This adds documentation (including debug assertions) to make this clearer and removes the checks, which should have a strictly positive impact on performance.
@JonathanBrouwer

Copy link
Copy Markdown
Contributor

@bors yield
Yielding to enclosing rollup

@rust-bors

rust-bors Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Auto build was cancelled. Cancelled workflows:

The next pull request likely to be tested is #158095.

rust-bors Bot pushed a commit that referenced this pull request Jun 18, 2026
…uwer

Rollup of 10 pull requests

Successful merges:

 - #158026 (`RegionValues`: disable unnecessary range check)
 - #156795 (Handle generic reborrow in expression-use adjustment walking)
 - #157694 (Enhance documentation on wake call memory ordering)
 - #157935 (Make `proc_macro::ConversionErrorKind` non exhaustive)
 - #158002 (Replace `unwrap` with `expect` in `get_module_children`)
 - #158034 (Fix reborrow source expression visits)
 - #158072 (Bump thin-vec to 0.2.18 to address RUSTSEC-2026-0103)
 - #158074 (Document transient connection errors from TcpListener::accept)
 - #158077 (rustdoc-json-types: Replace bincode dev-dependency with postcard)
 - #158086 (renovate: Loosen dashboard approval and adopt recommended config)
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jun 18, 2026
…eck, r=petrochenkov

`RegionValues`: disable unnecessary range check

Currently, when adding liveness points to region values in the `RegionValues` struct, the locations of the points are checked for ranges. This is unnecessarily cautious because they always are in range by construction. The docstring for the method used in the checks suggests that it was designed for underlying bit sets that currently aren't used for this.

This adds documentation (including debug assertions) to make this clearer and removes the checks, which should have a strictly positive impact on performance.
@rust-bors rust-bors Bot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 18, 2026
@rust-bors

rust-bors Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

💔 Test for 8509975 failed: CI. Failed job:

@JonathanBrouwer

Copy link
Copy Markdown
Contributor

@bors retry

@rust-bors rust-bors Bot 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 Jun 18, 2026
rust-bors Bot pushed a commit that referenced this pull request Jun 18, 2026
Rollup of 2 pull requests

Successful merges:

 - #158026 (`RegionValues`: disable unnecessary range check)
 - #158101 (Initialize directly in `From<T> for OnceLock<T>`)
@rust-bors rust-bors Bot merged commit 72979c1 into rust-lang:main Jun 19, 2026
2 of 14 checks passed
@rustbot rustbot added this to the 1.98.0 milestone Jun 19, 2026
rust-timer added a commit that referenced this pull request Jun 19, 2026
Rollup merge of #158026 - amandasystems:region-values-point-no-range-check, r=petrochenkov

`RegionValues`: disable unnecessary range check

Currently, when adding liveness points to region values in the `RegionValues` struct, the locations of the points are checked for ranges. This is unnecessarily cautious because they always are in range by construction. The docstring for the method used in the checks suggests that it was designed for underlying bit sets that currently aren't used for this.

This adds documentation (including debug assertions) to make this clearer and removes the checks, which should have a strictly positive impact on performance.
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.

5 participants