There was a FIXME noting that ty::enum_variants and typeck::check:: check_enum_variants both call eval_const_expr. I tried refactoring the code so that check_enum_variants does all the work and enum_variants just looks up cached results, but this turned out not to be easy because several ty functions call enum_variants and it might get invoked on an enum before that enum item has been typechecked. Instead, I just made check_enum_variants update the enum_var_cache so that enum_variants will never call eval_const_expr twice on the same const.
This is a compiler and suite of associated libraries and documentation for the Rust programming language. See LICENSE.txt for terms of copyright and redistribution. See http://www.rust-lang.org for more information.
Description
Languages
Rust
96.2%
RenderScript
0.7%
JavaScript
0.6%
Shell
0.6%
Fluent
0.4%
Other
1.3%