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

Add InferCtxt::with_opaque_type_inference to get_body_with_borrowck_facts #89615

Merged

Conversation

willcrichton
Copy link
Contributor

mir_borrowck uses with_opaque_type_inference before calling do_mir_borrowck:

let opt_closure_req = tcx.infer_ctxt().with_opaque_type_inference(def.did).enter(|infcx| {

However get_body_with_borrowck_facts does not. Therefore I get an ICE eg when calling this function on the bodies of an async function as described here: https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/.E2.9C.94.20ICE.20when.20using.20get_body_with_borrowck_facts.20with.20async

This change fixes that bug.

r? @nikomatsakis

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 7, 2021
willcrichton added a commit to willcrichton/flowistry that referenced this pull request Oct 7, 2021
@oli-obk
Copy link
Contributor

oli-obk commented Oct 7, 2021

r? @oli-obk

ah, yea I missed this call site.

independently of that, I am not convinced anymore that this is the right way to do this, it may cause problems with global caching, as it's not information tracked in the ParamEnv. But that is something I need to investigate.

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Oct 7, 2021

📌 Commit 549a68b has been approved by oli-obk

@rust-highfive rust-highfive assigned oli-obk and unassigned nikomatsakis Oct 7, 2021
@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 Oct 7, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 7, 2021
…laumeGomez

Rollup of 7 pull requests

Successful merges:

 - rust-lang#89298 (Issue 89193 - Fix ICE when using `usize` and `isize` with SIMD gathers )
 - rust-lang#89461 (Add `deref_into_dyn_supertrait` lint.)
 - rust-lang#89477 (Move items related to computing diffs to a separate file)
 - rust-lang#89559 (RustWrapper: adapt for LLVM API change)
 - rust-lang#89585 (Emit item no type error even if type inference fails)
 - rust-lang#89596 (Make cfg imply doc(cfg))
 - rust-lang#89615 (Add InferCtxt::with_opaque_type_inference to get_body_with_borrowck_facts)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 0fbb011 into rust-lang:master Oct 7, 2021
@rustbot rustbot added this to the 1.57.0 milestone Oct 7, 2021
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants