Skip to content

Do not allow typeck children items to constrain outer RPITs - #99345

Merged
bors merged 2 commits into
rust-lang:masterfrom
compiler-errors:issue-99073-redux
Jul 20, 2022
Merged

Do not allow typeck children items to constrain outer RPITs#99345
bors merged 2 commits into
rust-lang:masterfrom
compiler-errors:issue-99073-redux

Conversation

@compiler-errors

@compiler-errorscompiler-errors commented Jul 16, 2022

Copy link
Copy Markdown
Contributor

Fixes#99073 in a simpler and more conservative way than #99079. Simply raise a mismatched types error if we try to constrain an RPIT in an item that isn't the RPIT's parent.

r? @oli-obk

@rustbotrustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jul 16, 2022
@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 16, 2022
Comment threadsrc/test/ui/impl-trait/issue-99073-2.stderr
Comment threadcompiler/rustc_borrowck/src/type_check/mod.rs
Comment threadcompiler/rustc_borrowck/src/type_check/mod.rs Outdated
@oli-obk

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented Jul 18, 2022

Copy link
Copy Markdown
Collaborator

📌 Commit 273b977 has been approved by oli-obk

It is now in the queue for this repository.

@borsbors 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 Jul 18, 2022
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Jul 18, 2022
…r=oli-obk
Do not allow typeck children items to constrain outer RPITs
Fixesrust-lang#99073 in a simpler and more conservative way than rust-lang#99079. Simply raise a mismatched types error if we try to constrain an RPIT in an item that isn't the RPIT's parent.
r? `@oli-obk`
@Dylan-DPCDylan-DPC mentioned this pull request Jul 18, 2022
@bors

bors commented Jul 19, 2022

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (presumably #99451) made this pull request unmergeable. Please resolve the merge conflicts.

@borsbors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 19, 2022
@compiler-errors

Copy link
Copy Markdown
ContributorAuthor

@bors r=oli-obk

@bors

bors commented Jul 19, 2022

Copy link
Copy Markdown
Collaborator

📌 Commit 5a4601f has been approved by oli-obk

It is now in the queue for this repository.

@borsbors 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 19, 2022
@Dylan-DPCDylan-DPC mentioned this pull request Jul 20, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 20, 2022
Rollup of 7 pull requests
Successful merges:
- rust-lang#98101 (stdlib support for Apple WatchOS)
- rust-lang#99345 (Do not allow typeck children items to constrain outer RPITs)
- rust-lang#99383 (Formalize defining_use_anchor)
- rust-lang#99436 (Add flag to configure `noalias` on `Box<T>`)
- rust-lang#99483 (Fix a numerical underflow in tuple wrap suggestion)
- rust-lang#99485 (Stop injecting `#[allow(unused_qualifications)]` in generated `derive` implementations)
- rust-lang#99486 (Refactor: remove a string comparison between types in `check_str_addition`)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit 3c3c5da into rust-lang:masterJul 20, 2022
@rustbotrustbot added this to the 1.64.0 milestone Jul 20, 2022
@RalfJung

Copy link
Copy Markdown
Member

I think this is at least partially responsible for an ICE in Miri -- a regression that started showing up when #99506 landed. See rust-lang/miri#2433.

@compiler-errors

compiler-errors commented Aug 23, 2022

Copy link
Copy Markdown
ContributorAuthor

@RalfJung how exactly are you testing this? Master + reverting a PR? Or bisecting nightly builds? Because the code I added in this PR I later reverted in #99079.

#99079 (or this PR, for that matter) itself should not cause any change in normalization behavior, since all it does is cause an extra error to be raised in some cases. Though I guess you could try reverting #99079 on master and see if it causes the ICE to go away. Feel free to ping me on zulip if you'd like to dig deeper together.

@RalfJung

Copy link
Copy Markdown
Member

(Continuing the discussion in rust-lang/miri#2433)

@compiler-errors
compiler-errors deleted the issue-99073-redux branch August 11, 2023 20:05
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant 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.

ICE with probably recursive opaque types and closures

6 participants

@compiler-errors@oli-obk@bors@RalfJung@rust-highfive@rustbot