We want to remove calls to ty::Const::{normalize,eval,eval_to_*} because they won't work correctly with future reformulations of GCE, and because they're unnecessary with non-GCE consts. This issue tracks doing that so I won't forget. Boxy can probably write more motivation here idk
Boxy rationale:
with min_generic_const_args and associated_const_equality featuers normalization of type system constants will be behaving much more like types. They'll return nested goals, access in scope whjere clauses such as T: Trait<ASSOC = 10> in order to normalize instead of simply "evaluating".
This means that the only correct way to normalize a ty::Const will be to use the "normal" normalization routines such as normalize_erasing_regions or infcx/ocx/fcx.normalize. With that in mind all of the eval_x and normalize methods on ty::Const become massive footguns as they are never correct to use.
More:
cc @BoxyUwU
We want to remove calls to
ty::Const::{normalize,eval,eval_to_*}because they won't work correctly with future reformulations of GCE, and because they're unnecessary with non-GCE consts. This issue tracks doing that so I won't forget. Boxy can probably write more motivation here idkBoxy rationale:
eval_bitswithtry_to_bits, which I forgot in codegen lolevalfrommir_buildandpattern_analysisin now that writeback results are normalized (Replace calls toty::Const::{try_}evalin mir build/pattern analysis #130715)structurally_resolve_constfor use inFnCtxt/hir_typeck(Introducestructurally_normalize_const, use it inrustc_hir_typeck#130714)eval_*withstructurally_resolve+try_to_*in hir typeckeva;/normalizepost-borrowck, replacing them with theirtry_to_*variants + possibly normalizing depending on the source of the const.More:
ty::Const::normalizein error reporting #130712cc @BoxyUwU