Make `body_owned_by` return the `Body` instead of just the `BodyId` by oli-obk · Pull Request #125711 · rust-lang/rust

added 2 commits

May 29, 2024 10:04
Almost all callers want this anyway, and now we can use it to also return fed bodies

@rustbot rustbot added A-rustdoc-json

Area: Rustdoc JSON backend

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.

T-rustdoc

Relevant to the rustdoc team, which will review and decide on the PR/issue.

labels

May 29, 2024

@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

May 29, 2024

fmease added a commit to fmease/rust that referenced this pull request

May 30, 2024
Make `body_owned_by` return the `Body` instead of just the `BodyId`

fixes rust-lang#125677

Almost all `body_owned_by` callers immediately called `body`, too, so just return `Body` directly.

This makes the inline-const query feeding more robust, as all calls to `body_owned_by` will now yield a body for inline consts, too.

I have not yet figured out a good way to make `tcx.hir().body()` return an inline-const body, but that can be done as a follow-up

bors added a commit to rust-lang-ci/rust that referenced this pull request

May 30, 2024
Rollup of 6 pull requests

Successful merges:

 - rust-lang#124636 (Make `std::env::{set_var, remove_var}` unsafe in edition 2024)
 - rust-lang#125342 (Document platform-specifics for `Read` and `Write` of `File`)
 - rust-lang#125671 (Do not equate `Const`'s ty in `super_combine_const`)
 - rust-lang#125711 (Make `body_owned_by` return the `Body` instead of just the `BodyId`)
 - rust-lang#125745 (Bump the stage0 compiler to beta.7 (2024-05-26))
 - rust-lang#125753 (compiletest: Unify `cmd2procres` with `run_command_to_procres`)

r? `@ghost`
`@rustbot` modify labels: rollup

bors added a commit to rust-lang-ci/rust that referenced this pull request

May 30, 2024
Rollup of 6 pull requests

Successful merges:

 - rust-lang#124636 (Make `std::env::{set_var, remove_var}` unsafe in edition 2024)
 - rust-lang#125342 (Document platform-specifics for `Read` and `Write` of `File`)
 - rust-lang#125671 (Do not equate `Const`'s ty in `super_combine_const`)
 - rust-lang#125711 (Make `body_owned_by` return the `Body` instead of just the `BodyId`)
 - rust-lang#125745 (Bump the stage0 compiler to beta.7 (2024-05-26))
 - rust-lang#125753 (compiletest: Unify `cmd2procres` with `run_command_to_procres`)

r? `@ghost`
`@rustbot` modify labels: rollup

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

May 30, 2024
Make `body_owned_by` return the `Body` instead of just the `BodyId`

fixes rust-lang#125677

Almost all `body_owned_by` callers immediately called `body`, too, so just return `Body` directly.

This makes the inline-const query feeding more robust, as all calls to `body_owned_by` will now yield a body for inline consts, too.

I have not yet figured out a good way to make `tcx.hir().body()` return an inline-const body, but that can be done as a follow-up

bors added a commit to rust-lang-ci/rust that referenced this pull request

May 30, 2024
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#125342 (Document platform-specifics for `Read` and `Write` of `File`)
 - rust-lang#125711 (Make `body_owned_by` return the `Body` instead of just the `BodyId`)
 - rust-lang#125739 (drop_in_place: weaken the claim of equivalence with drop(ptr.read()))
 - rust-lang#125745 (Bump the stage0 compiler to beta.7 (2024-05-26))
 - rust-lang#125746 (Fix copy-paste error in `Duration::from_weeks` panic message.)
 - rust-lang#125753 (compiletest: Unify `cmd2procres` with `run_command_to_procres`)
 - rust-lang#125754 (coverage: Rename MC/DC `conditions_num` to `num_conditions`)

r? `@ghost`
`@rustbot` modify labels: rollup

@bors bors mentioned this pull request

May 30, 2024

flip1995 pushed a commit to flip1995/rust that referenced this pull request

Jun 13, 2024
Make `body_owned_by` return the `Body` instead of just the `BodyId`

fixes rust-lang#125677

Almost all `body_owned_by` callers immediately called `body`, too, so just return `Body` directly.

This makes the inline-const query feeding more robust, as all calls to `body_owned_by` will now yield a body for inline consts, too.

I have not yet figured out a good way to make `tcx.hir().body()` return an inline-const body, but that can be done as a follow-up

flip1995 pushed a commit to flip1995/rust that referenced this pull request

Jun 13, 2024
Make `body_owned_by` return the `Body` instead of just the `BodyId`

fixes rust-lang#125677

Almost all `body_owned_by` callers immediately called `body`, too, so just return `Body` directly.

This makes the inline-const query feeding more robust, as all calls to `body_owned_by` will now yield a body for inline consts, too.

I have not yet figured out a good way to make `tcx.hir().body()` return an inline-const body, but that can be done as a follow-up

flip1995 pushed a commit to flip1995/rust that referenced this pull request

Jun 13, 2024
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#125342 (Document platform-specifics for `Read` and `Write` of `File`)
 - rust-lang#125711 (Make `body_owned_by` return the `Body` instead of just the `BodyId`)
 - rust-lang#125739 (drop_in_place: weaken the claim of equivalence with drop(ptr.read()))
 - rust-lang#125745 (Bump the stage0 compiler to beta.7 (2024-05-26))
 - rust-lang#125746 (Fix copy-paste error in `Duration::from_weeks` panic message.)
 - rust-lang#125753 (compiletest: Unify `cmd2procres` with `run_command_to_procres`)
 - rust-lang#125754 (coverage: Rename MC/DC `conditions_num` to `num_conditions`)

r? `@ghost`
`@rustbot` modify labels: rollup