-
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
ice: ProjectionKinds Deref and Field were mismatched
#118144
Comments
smaller struct V(&mut i32);
fn nested(v: &V) {
|| {
V(_somename) = v;
v.0 = 0;
};
} |
Regression in nightly-2022-11-06 commit[0] 2022-11-04: Auto merge of #103978 - matthiaskrgr:rollup-iym9kmg, r=matthiaskrgr |
@rustbot claim |
The above bisection may be wrong. I got this instead: Regression in nightly-2021-09-26 found 9 bors merge commits in the specified range The issue seems to be present since PR #89208 which is part of the rollup #89230 |
The ICE originates at the below code in the function rust/compiler/rustc_hir_typeck/src/upvar.rs Lines 699 to 708 in 7ceaf19
This code expects that all the captures of a given variable should have projection sequences that adhere to the following rules:
What causes the below snippet to ICE: struct V(&mut i32);
fn nested(v: &V) {
|| {
V(_somename) = v;
v.0 = 0;
};
} is that
where As these captures violate rule 2 above, an ICE ensues. The code that is ICEing was introduced PR #89208 and has been ICEing ever since. |
As for the fix, I feel there's little we can do to make these two captures:
align with each other as per rule 2. A statement like this (Worth noting that if we change A simple fix in my view would be to remove rule 2 and allow projection sequences like |
auto-reduced (treereduce-rust):
original:
Version information
Command:
/home/matthias/.rustup/toolchains/master/bin/rustc
Program output
The text was updated successfully, but these errors were encountered: