Skip to content

Make BorrowSet methods public again - #160017

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
Lysxia:pub-borrow-set
Jul 28, 2026
Merged

Make BorrowSet methods public again#160017
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
Lysxia:pub-borrow-set

Conversation

@Lysxia

@Lysxia Lysxia commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

BorrowSet's methods were made private in #159449 except for a couple used by Aquascope. I'd like to make these methods public again for Creusot, which indeed makes more extensive use of BorrowSet. Technically only locals_state_at_exit exposes information that is not already available in the current API (and Creusot does make use of it to call Place::ignore_borrow). The other fields can be reconstructed via iter, but it seems unnecessary to restrict the efficient access provided by the other methods to rustc's own analyses as opposed to third-party consumers.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 27, 2026
@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jul 27, 2026
@rustbot

rustbot commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

r? @ShoyuVanilla

rustbot has assigned @ShoyuVanilla.
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 74 candidates
  • Random selection from 18 candidates

@mejrs mejrs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

r? me

This looks OK to me. r=me with proper comments.

View changes since this review

Comment thread compiler/rustc_borrowck/src/borrow_set.rs Outdated
@rustbot rustbot assigned mejrs and unassigned ShoyuVanilla Jul 27, 2026
@mejrs mejrs 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 Jul 27, 2026
@rustbot

rustbot commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

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

@mejrs mejrs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@rust-bors

rust-bors Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 36c2248 has been approved by mejrs

It is now in the queue for this repository.

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

Reason for tree closure: spurious failures

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 27, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Jul 28, 2026
Make BorrowSet methods public again

BorrowSet's methods were made private in rust-lang#159449 except for a couple used by Aquascope. I'd like to make these methods public again for Creusot, which indeed makes more extensive use of BorrowSet. Technically only `locals_state_at_exit` exposes information that is not already available in the current API (and Creusot does make use of it to call `Place::ignore_borrow`). The other fields can be reconstructed via `iter`, but it seems unnecessary to restrict the efficient access provided by the other methods to rustc's own analyses as opposed to third-party consumers.
rust-bors Bot pushed a commit that referenced this pull request Jul 28, 2026
Rollup of 9 pull requests

Successful merges:

 - #153563 (Lint against iterator functions that panic when `N` is zero )
 - #159960 (Allow `UnsafeCell` content access without `get` in `invalid_reference_casting` lint)
 - #158893 (Clarify preconditions of raw size/align methods)
 - #159220 (Don't optimize across storage markers in SimplifyComparisonIntegral)
 - #159309 (Move tests batch 18)
 - #159450 (Add codegen test for enum clone)
 - #160017 (Make BorrowSet methods public again)
 - #160022 (Refactor rustc_hir re-exports)
 - #160041 (Correct tracking issue for `casefold` feature)
@rust-bors
rust-bors Bot merged commit 0e866a4 into rust-lang:main Jul 28, 2026
2 of 13 checks passed
@rustbot rustbot added this to the 1.99.0 milestone Jul 28, 2026
rust-timer added a commit that referenced this pull request Jul 28, 2026
Rollup merge of #160017 - Lysxia:pub-borrow-set, r=mejrs

Make BorrowSet methods public again

BorrowSet's methods were made private in #159449 except for a couple used by Aquascope. I'd like to make these methods public again for Creusot, which indeed makes more extensive use of BorrowSet. Technically only `locals_state_at_exit` exposes information that is not already available in the current API (and Creusot does make use of it to call `Place::ignore_borrow`). The other fields can be reconstructed via `iter`, but it seems unnecessary to restrict the efficient access provided by the other methods to rustc's own analyses as opposed to third-party consumers.
@Lysxia
Lysxia deleted the pub-borrow-set branch July 28, 2026 12:20
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