Skip to content
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

Feed a span into the const eval queries in case of an error #104438

Open
oli-obk opened this issue Nov 15, 2022 · 0 comments
Open

Feed a span into the const eval queries in case of an error #104438

oli-obk opened this issue Nov 15, 2022 · 0 comments
Labels
A-const-eval Area: Constant evaluation, covers all const contexts (static, const fn, ...) A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@oli-obk
Copy link
Contributor

oli-obk commented Nov 15, 2022

Unfortunately we cannot do this on the query level, because then evaluating the same constant at different locations would re-evaluate the constant each time since an input changes.

We could do that by having an Option<Span> argument in the query key that we only set to Some if we are erroring. So basically invoke it once with None, causing no error to be emitted, but an error to be returned, if you get back an error, invoke again with Some(span) and now the query can error inside.

Originally posted by @oli-obk in #104317 (comment)

@oli-obk oli-obk added A-diagnostics Area: Messages for errors, warnings, and lints A-const-eval Area: Constant evaluation, covers all const contexts (static, const fn, ...) labels Nov 15, 2022
@Noratrieb Noratrieb added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Apr 5, 2023
@oli-obk oli-obk moved this to In Progress in query feeding May 25, 2024
@oli-obk oli-obk removed this from query feeding May 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-const-eval Area: Constant evaluation, covers all const contexts (static, const fn, ...) A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants