Skip to content

We should be enforcing constness predicates on all call-like things in HIR typeck #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
compiler-errors opened this issue Oct 24, 2024 · 2 comments

Comments

@compiler-errors
Copy link
Member

Right now we're (afaict) missing autoderefs which are applied as adjustments. Specifically interesting is the answer to the question of where do we put that enforce_context_effects call...

We're possibly also missing other things, so a full audit of HIR typeck is probably worthwhile.

@RalfJung
Copy link
Member

Can we do this in the MIR const check to be sure we don't miss anything?

@compiler-errors
Copy link
Member Author

@RalfJung: Sure, we can do it for the purposes of making sure nothing non-const leaks into the body in MIR const checking, but I'd prefer that for the purposes of diagnostics that we enforce this first in HIR typeck. This is consistent with HIR and MIR checking traits first; if something fails to satisfy a const trait predicate in MIR, we delay a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants