-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Delegation: fix ICE on wrong Self
instantiation
#123101
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rustbot
added
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
Mar 26, 2024
HIR ty lowering was modified cc @fmease |
fmease
reviewed
Mar 26, 2024
petrochenkov
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-review
Status: Awaiting review from the assignee but also interested parties.
labels
Mar 26, 2024
Bryanskiy
force-pushed
the
delegation-fixes-2
branch
from
March 27, 2024 12:17
1d657a5
to
eb3617b
Compare
This comment has been minimized.
This comment has been minimized.
Bryanskiy
force-pushed
the
delegation-fixes-2
branch
from
March 27, 2024 12:51
eb3617b
to
0cd9708
Compare
@rustbot ready |
rustbot
added
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
and removed
S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.
labels
Mar 27, 2024
@bors r+ |
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
Mar 27, 2024
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Mar 27, 2024
…trochenkov Delegation: fix ICE on wrong `Self` instantiation fixes rust-lang#119921 fixes rust-lang#119919 There is no way to instantiate `Self` param for caller in delegation item if 1. callee is a trait method && callee contains `Self` param 2. delegation item isn't an associative item In general, we can consider `Self` param as independent type param in these cases: ```rust trait Trait { fn foo(_: Option<&Self>) {...} } reuse Trait::foo; // will be desugared to: fn foo<T: Trait>(x: Option<&T>) { Trait::foo(x) } ``` But this requires early bound parameters support. For now, I suggest banning such cases to avoid ICE's. r? `@petrochenkov`
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Mar 27, 2024
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#121943 (Clarify atomic bit validity) - rust-lang#123089 (Add invariant to VecDeque::pop_* that len < cap if pop successful) - rust-lang#123101 (Delegation: fix ICE on wrong `Self` instantiation) - rust-lang#123130 (Load missing type of impl associated constant from trait definition) - rust-lang#123133 (chore: fix some comments) - rust-lang#123136 (Some wording improvement) - rust-lang#123139 (`num::NonZero::get` can be 1 transmute instead of 2) - rust-lang#123142 (Let nils know about changes to target docs) r? `@ghost` `@rustbot` modify labels: rollup
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Mar 28, 2024
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#121943 (Clarify atomic bit validity) - rust-lang#123075 (CFI: Fix drop and drop_in_place) - rust-lang#123101 (Delegation: fix ICE on wrong `Self` instantiation) - rust-lang#123130 (Load missing type of impl associated constant from trait definition) - rust-lang#123133 (chore: fix some comments) - rust-lang#123136 (Some wording improvement) - rust-lang#123139 (`num::NonZero::get` can be 1 transmute instead of 2) - rust-lang#123142 (Let nils know about changes to target docs) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Mar 28, 2024
Rollup merge of rust-lang#123101 - Bryanskiy:delegation-fixes-2, r=petrochenkov Delegation: fix ICE on wrong `Self` instantiation fixes rust-lang#119921 fixes rust-lang#119919 There is no way to instantiate `Self` param for caller in delegation item if 1. callee is a trait method && callee contains `Self` param 2. delegation item isn't an associative item In general, we can consider `Self` param as independent type param in these cases: ```rust trait Trait { fn foo(_: Option<&Self>) {...} } reuse Trait::foo; // will be desugared to: fn foo<T: Trait>(x: Option<&T>) { Trait::foo(x) } ``` But this requires early bound parameters support. For now, I suggest banning such cases to avoid ICE's. r? ``@petrochenkov``
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
F-fn_delegation
`#![feature(fn_delegation)]`
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fixes #119921
fixes #119919
There is no way to instantiate
Self
param for caller in delegation item ifSelf
paramIn general, we can consider
Self
param as independent type param in these cases:But this requires early bound parameters support. For now, I suggest banning such cases to avoid ICE's.
r? @petrochenkov