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

Remove body_def_id from Inherited #108960

Merged
merged 2 commits into from
Mar 10, 2023
Merged

Conversation

compiler-errors
Copy link
Member

We can just use the body id from the obligation cause.

Follow-up to #108945, only my commit is relevant.

r? @cjgillot cc @spastorino

@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 Mar 9, 2023
@rustbot
Copy link
Collaborator

rustbot commented Mar 9, 2023

Some changes occurred in need_type_info.rs

cc @lcnr

Comment on lines +406 to +408
if let Some(body_id) = self.tcx.hir().maybe_body_owned_by(
self.tcx.typeck_root_def_id(body_def_id.to_def_id()).expect_local(),
) {
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the only "interesting" part of this PR, I think.

Copy link
Member

@spastorino spastorino Mar 10, 2023

Choose a reason for hiding this comment

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

Oh oh oh :), this is what I needed :), typeck_root_def_id, I was trying something very similar in my last PR.

@cjgillot
Copy link
Contributor

Great! That's as much possible confusion removed.
@bors r+

@bors
Copy link
Contributor

bors commented Mar 10, 2023

📌 Commit fd34549 has been approved by cjgillot

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 Mar 10, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 10, 2023
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#108879 (Unconstrained terms should account for infer vars being equated)
 - rust-lang#108936 (Rustdoc: don't hide anonymous reexport)
 - rust-lang#108940 (Add myself to compiler reviewers list)
 - rust-lang#108945 (Make some report and emit errors take DefIds instead of BodyIds)
 - rust-lang#108946 (Document the resulting values produced when using `From<bool>` on floats)
 - rust-lang#108956 (Make ptr::from_ref and ptr::from_mut in rust-lang#106116 const.)
 - rust-lang#108960 (Remove `body_def_id` from `Inherited`)
 - rust-lang#108963 (only call git on git checkouts during bootstrap)
 - rust-lang#108964 (Fix the docs for pointer method with_metadata_of)

Failed merges:

 - rust-lang#108950 (Directly construct Inherited in typeck.)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 671339c into rust-lang:master Mar 10, 2023
@rustbot rustbot added this to the 1.70.0 milestone Mar 10, 2023
@compiler-errors compiler-errors deleted the no-body-def-id branch August 11, 2023 20:10
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