-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 with the @ ..
binding pattern
#74539
Comments
reduced: enum E {
A(u8),
}
fn fun(arg: E) {
match arg {
A(x @ ..) => {x}
};
} Edit: you can actually omit the enum declaration and it still crashes 🤔 fn fun(arg: E) {fn fun(arg: E) {
match arg {
A(x @ ..) => {x}
};
} |
@JohnTitor, oh, sorry, I've already got a fix. 🙂 I'll post it soon. Though it may not be the best one. |
@jakubadamw Great! You should tweak |
@JohnTitor, okay, thanks. 🙂 Better late than never… @rustbot claim |
This is caused by #72677, I believe. 1.44 emits errors w/o ICE'ing but 1.45 hits it. |
Let's keep this open to track stable/beta backports. |
The reference suggested this to be possible, which is how I came to suggest it to OP. |
here is another one: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=3f27a7faf85be38c646a6427b25b59c9 (assuming related) |
Fix ICEs with `@ ..` binding This reverts rust-lang#74557 and introduces an alternative fix while ensuring that rust-lang#74954 is not broken. The diagnostics are verbose though, it fixes three related issues. cc rust-lang#74954, rust-lang#74539, and rust-lang#74702
The stable fix is reverted, and the nightly one is also but #74963 introduced another fix. I keep this open when that PR is beta-nominated, just in case. |
We don't backport the fix in favor of this comment: #74557 (comment) |
Code
Meta
The bug exists in the beta,
rustup run beta rustc --version --verbose
nightly,
rustup run nightly rustc --version --verbose
and stable build channels.
rustc --version --verbose
:The error and the backtrace provided are produced by the stable build.
Error output
Backtrace
This issue has been assigned to @jakubadamw via this comment.
The text was updated successfully, but these errors were encountered: