Skip to content
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

Make body_owned_by return the Body instead of just the BodyId #125711

Merged
merged 2 commits into from
May 30, 2024

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented May 29, 2024

fixes #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

Almost all callers want this anyway, and now we can use it to also return fed bodies
@rustbot
Copy link
Collaborator

rustbot commented May 29, 2024

r? @Nadrieril

rustbot has assigned @Nadrieril.
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 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
@rustbot
Copy link
Collaborator

rustbot commented May 29, 2024

Some changes occurred in need_type_info.rs

cc @lcnr

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

Some changes occurred in src/librustdoc/clean/types.rs

cc @camelid

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

@Nadrieril
Copy link
Member

LGTM

@bors r+

@bors
Copy link
Contributor

bors commented May 29, 2024

📌 Commit a34c26e has been approved by Nadrieril

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 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
@bors
Copy link
Contributor

bors commented May 30, 2024

⌛ Testing commit a34c26e with merge d43930d...

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
Copy link
Contributor

bors commented May 30, 2024

☀️ Test successful - checks-actions
Approved by: Nadrieril
Pushing d43930d to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 30, 2024
@bors bors merged commit d43930d into rust-lang:master May 30, 2024
7 checks passed
@rustbot rustbot added this to the 1.80.0 milestone May 30, 2024
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
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (d43930d): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results (primary 0.2%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
2.3% [2.3%, 2.3%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.0% [-2.0%, -2.0%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.2% [-2.0%, 2.3%] 2

Cycles

Results (primary 2.2%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
2.2% [2.2%, 2.2%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.2% [2.2%, 2.2%] 1

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 667.227s -> 665.728s (-0.22%)
Artifact size: 318.88 MiB -> 318.83 MiB (-0.02%)

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-json Area: Rustdoc JSON backend merged-by-bors This PR was explicitly merged by bors. 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICE: const: body_owned_by expr const .. has no associated body
5 participants