Skip to content

Tracking issue for removing unnecessary ty::Const::{normalize,eval} calls from the type system #130704

Open
@compiler-errors

Description

@compiler-errors

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

Metadata

Metadata

Labels

A-const-genericsArea: const generics (parameters and arguments)T-typesRelevant to the types team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions