-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
improve error message for disallowed ptr-to-int casts in const eval #81779
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @davidtwco (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implementation and wording looks good to me, will re-assign to double check that this is an appropriate change to the error.
r? @lcnr |
📌 Commit af28c2e has been approved by |
LGTM. Cc @rust-lang/wg-const-eval
It depends on the individual case, whether this is something that could be allowed after an RFC or something that's just impossible. |
Rollup of 9 pull requests Successful merges: - rust-lang#71531 (Move treat err as bug tests to ui) - rust-lang#81356 (libtest: allow multiple filters) - rust-lang#81735 (faster few span methods) - rust-lang#81779 (improve error message for disallowed ptr-to-int casts in const eval) - rust-lang#81817 (Add option to emit compiler stderr per bitwidth.) - rust-lang#81828 (parse_format: treat r" as a literal) - rust-lang#81840 (fix formatting of std::iter::Map) - rust-lang#81861 (Show MIR bytes separately in -Zmeta-stats output) - rust-lang#81865 (Clean up weird Option mapping) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Improves an error message as suggested in #80875.
Does the wording make enough sense? I tried to follow precedent for error message style while maintaining brevity.
It seems like the rest of the
ConstEvalErrKind::NeedsRfc
error messages could be improved as well. I could give that a go if this approach works.Closes #80875