You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the minimizer only supports a few const values, and it assumes they are all represented as scalars.
However what should actually happen is that it should recursively translate the const value using the API from rust-lang/rust#121396, and therefore support arbitrary types.
The text was updated successfully, but these errors were encountered:
essickmango
changed the title
Restructure const minimization
Minimize: restructure ConstValue minimization
Feb 22, 2024
So to make this a bit more concrete, this is about translate_const_val. That should start by calling let (ecx, val) = mk_eval_cx_for_const_val, and then match on the type (which it already does) and then use methods like ecx.read_scalar and ecx.project_field to recurse over the val.
Also, we should not be calling eval_to_allocation_raw. That has raw in its name for a reason. Quoting from its doc comment:
Do not use this directly, use the eval_to_const_value or eval_to_valtree instead.
Really translate_const should just call c.eval, then translate_const_uneval can be removed entirely.
Currently the minimizer only supports a few const values, and it assumes they are all represented as scalars.
However what should actually happen is that it should recursively translate the const value using the API from rust-lang/rust#121396, and therefore support arbitrary types.
The text was updated successfully, but these errors were encountered: