-
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
multiple ICE's for different patterns in array lengths #51963
Comments
Update: It seems there are more versions that produces the fn main() {
[(); return while let Some(n) = Some(1) {}];
} fn main() {
[(); return for _ in 0.. {}];
} |
another update: with 3 other match expressions I also got the same ICE message: fn main() {
[(); return match 1 {
n => n,
}]
} matching a fn main() {
[(); return match loop {} {
something => 1
}]
}
fn main() {
[(); return match () {
foo => n
}]
} |
IMPOSSIBLE CASE REACHED fn main() {
[(); return match 1 {
1 => 1,
}]
} Backtrace:
|
UNEXPECTED TYPE fn main() {
[(); return match () {
'c' => 1
}];
} Backtrace:
|
…=estebank Fix various issues with control-flow statements inside anonymous constants Fixes rust-lang#51761. Fixes rust-lang#51963 (and the host of other reported issues there). (Might be easiest to review per commit, as they should be standalone.) r? @estebank
found another one that gives the 'missing binding mode' message, fn main() {
[(); return None?]
} |
@DutchGhost: can't test now, but let's see if that's also fixed when #51967 is merged (I think it should be). |
not only array constants are able to ICE: [] - MISSING BINDING MODE - [] fn main() {
const const_binding_mode_crash: () = return |crash| {};
} fn main() {
enum enum_binding_mode_crash {
t = return |crash| ()
}
} [] - UNEXPECTED TYPE - [] fn main() {
enum enum_unexpected_type_crash {
t = return match () {
'c' => 1,
},
}
} [] - IMPOSSIBLE CASE REACHED - [] fn main() {
enum enum_impossible_case_reached {
t = return match 1 {
1 => 1,
}
}
} |
@DutchGhost: let's check these after #51967 is merged, and if any are still occurring afterwards, we can open new issues for them. |
Another ICE on invalid expressions for array lengths:
this is related to #51714, but has been fixed in #51723, and that fix is active in the current nightly.
playground: https://play.rust-lang.org/?gist=6d0a811852e0f67736d2a189c5fdc0d3&version=nightly&mode=release&edition=2015
Putting a type on the closure's argument does not make any difference.
Backtrace:
The text was updated successfully, but these errors were encountered: