Skip to content

replace ReErased with fresh region vars in opaque types #103008

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Oct 14, 2022

Conversation

aliemjay
Copy link
Member

@aliemjay aliemjay commented Oct 13, 2022

See inline comments.

Prior art #102943. cc @compiler-errors @oli-obk

Fixes #100267
Fixes #101940
Fixes #102649
Fixes #102510

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Oct 13, 2022
@rust-highfive
Copy link
Contributor

r? @compiler-errors

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 13, 2022
@compiler-errors
Copy link
Member

r? oli-obk

@compiler-errors
Copy link
Member

lol rustbot

r? @oli-obk

@@ -748,14 +746,25 @@ fn check_opaque_meets_bounds<'tcx>(
let ocx = ObligationCtxt::new(&infcx);
let opaque_ty = tcx.mk_opaque(def_id.to_def_id(), substs);

// `ReErased` regions appear in the "parent_substs" of the closures and generators.
// We're ignoring them here and replacing them with fresh region variables.
// FIXME: I think this is correct but it needs a thorough argument. -aliemjay
Copy link
Member

Choose a reason for hiding this comment

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

Can you remove this FIXME

@oli-obk
Copy link
Contributor

oli-obk commented Oct 13, 2022

Thanks!

r=me with the FIXME removed

@aliemjay aliemjay force-pushed the opaque-parent-substs branch from 9e99fa7 to d2d3d94 Compare October 13, 2022 16:06
@oli-obk
Copy link
Contributor

oli-obk commented Oct 13, 2022

@bors r+

@bors
Copy link
Collaborator

bors commented Oct 13, 2022

📌 Commit d2d3d94 has been approved by oli-obk

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 Oct 13, 2022
@aliemjay
Copy link
Member Author

aliemjay commented Oct 13, 2022

added a test that should fail with #102943 (see closure_wf_outlives::test2)

r=oli-obk

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 13, 2022
…li-obk

replace ReErased with fresh region vars in opaque types

See inline comments.

Prior art rust-lang#102943. cc `@compiler-errors` `@oli-obk`

Fixes rust-lang#100267
Fixes rust-lang#101940
Fixes rust-lang#102649
Fixes rust-lang#102510
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 14, 2022
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#103000 (Add suggestion to the "missing native library" error)
 - rust-lang#103006 (rustdoc: don't ICE on `TyKind::Typeof`)
 - rust-lang#103008 (replace ReErased with fresh region vars in opaque types)
 - rust-lang#103011 (Improve rustdoc `unsafe-fn` GUI test)
 - rust-lang#103013 (Add new bootstrap entrypoints to triagebot)
 - rust-lang#103016 (Ensure enum cast moves)
 - rust-lang#103021 (Add links to relevant pages to find constraint information)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 059bbf7 into rust-lang:master Oct 14, 2022
@rustbot rustbot added this to the 1.66.0 milestone Oct 14, 2022
@aliemjay aliemjay deleted the opaque-parent-substs branch October 14, 2022 11:44
# for free to join this conversation on GitHub. Already have an account? # 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
7 participants