-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 on enumerations referred to by submodules (submodule is declared before enum) #5900
Comments
Still valid. Nominating for a milestone. |
This appears to be an interaction between the |
accepted for production-ready milestone |
this still happens with 69e46f3 from master. But thx for the workaround Aatch |
#9942 looks like it might be a duplicate of this issue. |
I've been digging into this a little bit. The direct problem on the non-compiling case given is that a cast expression needs more information than is currently available when check_item is called for the Context struct. The lookup that's failing is
in the ExprCast arm of middle::const_eval::eval_const_expr_partial, which is getting called via check_struct -> check_instantiable -> is_instantiable -> subtypes_require (ty_enum case) -> enum_variants. I can make the sample code compile if I add
to the end of middle::typeck::collect::get_enum_variant_types and then pad out the inner case list on the ExprCast arm of middle::const_eval::eval_const_expr_partial to:
I'm pretty doubtful this is the right solution, it's just a hack to highlight the issue. As far as why slight variations work:
It seems like the "right" answer would be ensuring that enums are checked before things that use them, but figuring out how to do that is still a bit out of my depth. |
…phansch Fix: keep parenthesis for suggestion in `useless_conversion` lint Note: this lint was previously named `identity_conversion`. fixes: rust-lang#4750 changelog: fix parenthesis for `useless_conversion` lint suggestion
WIth rust 0.6 master, and incoming, I get an internal compile error:
This is a simple test case that reproduces the error:
Strangely, the error only happens when the enumeration is defined after the submodule.
The text was updated successfully, but these errors were encountered: