-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
'expected fn type' compiler panic caused by wrong "if let ..." #55513
Comments
Yes, this is built up of: expr ::= "if" expr "{" statements expr_tail "}"
| expr "==" expr
| expr "?"
| ...
; so |
I hit the same ICE by accident too; I was able to shrink the triggering code (and the stack trace) a little bit: code:
trace:
|
If we implement the pattern integration of #24111 this will get fixed naturally. The code would even become legal if |
now tracked in #57240 |
The if condition in the following code causes both the stable and nightly compilers to panic:
Now I know it doesn't work like this, but still shouldn't crash the compiler.
(Just out of curiosity, does something like
if option? == some_value {...}
exist in the language?)Meta
rustc version:
rustc 1.31.0-nightly (d586d5d 2018-10-29)
binary: rustc
commit-hash: d586d5d
commit-date: 2018-10-29
host: x86_64-unknown-linux-gnu
release: 1.31.0-nightly
LLVM version: 8.0
OS is Fedora 28.
The bug also appears in the 1.30 stable release.
Backtrace:
The text was updated successfully, but these errors were encountered: