Skip to content

Re-expose nested bodies in rustc_borrowck::consumers #143666

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

Merged
merged 1 commit into from
Jul 10, 2025

Conversation

nilehmann
Copy link
Contributor

After #138499, it's not possible anymore to get borrowck information for nested bodies via get_body_with_borrowck_facts. This PR re-exposes nested bodies by returning a map containing the typeck root and all its nested bodies. To collect the bodies, a map is added to BorrowCheckRootCtxt, and a body is inserted every time do_mir_borrowck is called.

r? @lcnr

@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 Jul 9, 2025
@lcnr
Copy link
Contributor

lcnr commented Jul 9, 2025

👍

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Jul 9, 2025

📌 Commit 3c7bf9f has been approved by lcnr

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 Jul 9, 2025
Kobzol added a commit to Kobzol/rust that referenced this pull request Jul 9, 2025
…rs, r=lcnr

Re-expose nested bodies in rustc_borrowck::consumers

After rust-lang#138499, it's not possible anymore to get borrowck information for nested bodies via `get_body_with_borrowck_facts`. This PR re-exposes nested bodies by returning a map containing the typeck root and all its nested bodies. To collect the bodies, a map is added to `BorrowCheckRootCtxt`, and a body is inserted every time `do_mir_borrowck` is called.

r? `@lcnr`
bors added a commit that referenced this pull request Jul 9, 2025
Rollup of 6 pull requests

Successful merges:

 - #143398 (tidy: add support for `--extra-checks=auto:` feature)
 - #143446 (use `--dynamic-list` for exporting executable symbols)
 - #143644 (Add triagebot stdarch mention ping)
 - #143660 (Disable docs for `compiler-builtins` and `sysroot`)
 - #143666 (Re-expose nested bodies in rustc_borrowck::consumers)
 - #143668 (Fix VxWorks build errors)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request Jul 10, 2025
Rollup of 12 pull requests

Successful merges:

 - #136906 (Add checking for unnecessary delims in closure body)
 - #143652 (docs: document trait upcasting rules in `Unsize` trait)
 - #143657 (Resolver: refact macro map into external and local maps)
 - #143659 (Use "Innermost" & "Outermost" terminology for `AttributeOrder`)
 - #143663 (fix: correct typo in attr_parsing_previously_accepted message key)
 - #143666 (Re-expose nested bodies in rustc_borrowck::consumers)
 - #143668 (Fix VxWorks build errors)
 - #143670 (Add a new maintainer to the wasm32-wasip1 target)
 - #143675 (improve lint doc text)
 - #143683 (Assorted `run-make-support` maintenance)
 - #143695 (Auto-add `S-waiting-on-author` when the PR is/switches to draft state)
 - #143706 (triagebot.toml: ping lolbinarycat if tidy extra checks were modified)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 90ead98 into rust-lang:master Jul 10, 2025
11 checks passed
@rustbot rustbot added this to the 1.90.0 milestone Jul 10, 2025
rust-timer added a commit that referenced this pull request Jul 10, 2025
Rollup merge of #143666 - nilehmann:nested_bodies_in_consumers, r=lcnr

Re-expose nested bodies in rustc_borrowck::consumers

After #138499, it's not possible anymore to get borrowck information for nested bodies via `get_body_with_borrowck_facts`. This PR re-exposes nested bodies by returning a map containing the typeck root and all its nested bodies. To collect the bodies, a map is added to `BorrowCheckRootCtxt`, and a body is inserted every time `do_mir_borrowck` is called.

r? ``@lcnr``
@Kobzol
Copy link
Member

Kobzol commented Jul 10, 2025

@rust-timer build 85cfd4a

Checking for #143731.

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (85cfd4a): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible 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 (primary -3.1%, secondary 5.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
5.1% [3.2%, 7.0%] 2
Improvements ✅
(primary)
-3.1% [-3.1%, -3.1%] 1
Improvements ✅
(secondary)
- - 0
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: 463.013s -> 463.275s (0.06%)
Artifact size: 374.51 MiB -> 374.48 MiB (-0.01%)

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