-
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 When initializing a struct with update syntax in closure #50618
Comments
Was this working before or did it never work? |
Not sure honestly. Just hit the ICE randomly and then narrowed it down to a minimal example. |
OK, don't worry, thanks! |
Looks like 1.26 doesn't ICE, but nightly does: https://godbolt.org/g/688aZ8 |
It looks like when analyzing the closuer we run |
This is actually a regression from stable to beta. |
My initial theory was wrong. The problem is actually occurring in |
typeck: Fix ICE with struct update syntax If check_expr_struct_fields fails, do not continue to record update. If we continue to record update, the struct may cause us to ICE later on indexing a field that may or may not exist. Fixes: #50618
TL;DR
When initializing a struct with update syntax inside a closure, an ICE occurs if a nonexistent or misspelled member is listed.
Example that Triggers ICE
Backtrace
Meta
The text was updated successfully, but these errors were encountered: