Skip to content

Ignore but do not assume region obligations from unifying headers in negative coherence#117994

Merged
bors merged 1 commit intorust-lang:masterfrom
compiler-errors:throw-away-regions-in-coherence
Nov 20, 2023
Merged

Ignore but do not assume region obligations from unifying headers in negative coherence#117994
bors merged 1 commit intorust-lang:masterfrom
compiler-errors:throw-away-regions-in-coherence

Conversation

@compiler-errors
Copy link
Copy Markdown
Contributor

Partly addresses a FIXME that was added in #112875. Just as we can throw away the nested trait/projection obligations from unifying two impl headers, we can also just throw away the region obligations too.

I removed part of the FIXME that was incorrect, namely:

Given that the only region constraints we get are involving inference regions in the root, it shouldn't matter, but still sus.

This is not true when unifying fn(A) and for<'b> fn(&'b B) which ends up with placeholder region outlives from non-root universes. I'm pretty sure this is okay, though it would be nice if we were to use them as assumptions. See the explicit revision of the test I committed, which still fails.

Fixes #117986

r? lcnr, feel free to reassign tho.

Loading
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.

with_negative_coherence fails to prevent coherence_leak_check overlap error

6 participants