-
Notifications
You must be signed in to change notification settings - Fork 13.4k
ICE vec iter #92100
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
|
reduced: fn main() {
match &vec![0] {
[a..1, a, a..1] | _ => {}
}
} |
Minimized this a tiny bit further, and I have a detailed explanation why this occurs:
So this bug first starts going wrong in late resolution. Specifically, Essentially, since we treat
and then resolve that as the path for
we reach a situation where we expect a variable to have been defined before it has been lowered in HIR, which leads to the ICE later on, since we expect to have lowered that path element. |
This comment has been minimized.
This comment has been minimized.
Actually, I don't think fixing this just for ranges is sufficient. I can reproduce this same issue with this:
Maybe I can just delay this panic as a span bug, since we're always gonna error out anyways. I think I would ideally like to fix this by making sure we separate bindings in patterns from affecting resolution for expressions in patterns. edit: Ended up fixing it the right way. |
@rustbot claim |
Uh oh!
There was an error while loading. Please reload this page.
Code
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
note: rustc 1.57.0 (f1edd04 2021-11-29) running on x86_64-unknown-linux-gnu
note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type bin
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
end of query stack
Meta
rustc --version --verbose
:Error output
Backtrace
The text was updated successfully, but these errors were encountered: