Skip to content

figure out how to integrate constants and the MIR type checker #46702

Closed
@nikomatsakis

Description

@nikomatsakis

Currently the MIR type checker has some kind of hacky code to figure out what sorts of well-formedness constraints are present on a constant. The values of constants now are "post normalization" and don't give us ready access to what we need. As the comment from the code says:

                // FIXME(#46702) -- We need some way to get the predicates
                // associated with the "pre-evaluated" form of the
                // constant. For example, consider that the constant
                // may have associated constant projections (`<Foo as
                // Trait<'a, 'b>>::SOME_CONST`) that impose
                // constraints on `'a` and `'b`. These constraints
                // would be lost if we just look at the normalized
                // value.

Metadata

Metadata

Labels

A-NLLArea: Non-lexical lifetimes (NLL)C-enhancementCategory: An issue proposing an enhancement or a PR with one.NLL-soundWorking towards the "invalid code does not compile" goalP-highHigh priorityT-compilerRelevant to the compiler 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