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 Self implsource #372

Merged
merged 6 commits into from
Jan 5, 2024
Merged

Add Self implsource #372

merged 6 commits into from
Jan 5, 2024

Conversation

W95Psp
Copy link
Collaborator

@W95Psp W95Psp commented Nov 21, 2023

Fixes #370

This PR:

  • adds a Self kind for ImplSource. This is useful for generic information within a trait.
  • propagate impl on function calls.

Fixes #20

Note: this PR failing is blocking for @cmester0's #349 and #348.
Since this is a bit urgent, my plan is to make failure silent for now: any backend that relies on this feature will then possibly generate bad code if we hit the edge case that currently makes this PR fails.

@W95Psp W95Psp requested a review from cmester0 November 21, 2023 08:58
@W95Psp W95Psp force-pushed the add-self-implsource branch 2 times, most recently from 47cb709 to aea38f2 Compare November 21, 2023 11:57
Copy link
Member

@franziskuskiefer franziskuskiefer left a comment

Choose a reason for hiding this comment

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

lgtm with a few nits

tests/attributes/src/lib.rs Outdated Show resolved Hide resolved
frontend/exporter/src/traits.rs Outdated Show resolved Hide resolved
frontend/exporter/src/traits.rs Outdated Show resolved Hide resolved
frontend/exporter/src/rustc_utils.rs Outdated Show resolved Hide resolved
Copy link
Member

@franziskuskiefer franziskuskiefer left a comment

Choose a reason for hiding this comment

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

Cancelling for now, looks like there's a merge conflict and ci failing

@W95Psp W95Psp force-pushed the add-self-implsource branch 4 times, most recently from 68b5719 to 4a4249d Compare December 7, 2023 17:05
@W95Psp W95Psp added the P1 Max priority label Jan 2, 2024
Re-introduce `try_normalize_erasing_regions`, but only when we compare
two predicate for equality: Rust consider two instance to be
overlapping if they differ only in terms of lifetime, thus while trait
resolution, this information is useless. Worse, in some situation, two
predicates can end up different solely because of lifetimes.
Copy link
Member

@franziskuskiefer franziskuskiefer left a comment

Choose a reason for hiding this comment

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

Lets get this in.

@W95Psp W95Psp added this pull request to the merge queue Jan 5, 2024
Merged via the queue into main with commit 370d0cf Jan 5, 2024
9 checks passed
@W95Psp W95Psp deleted the add-self-implsource branch January 5, 2024 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 Max priority
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Impl error on type in trait. Traits: compute explicit implementation expressions
2 participants