-
Notifications
You must be signed in to change notification settings - Fork 13k
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
ICE: compiler/rustc_mir/src/interpret/validity.rs:918:17: Unexpected error during validation: unable to turn pointer into raw bytes #79690
Comments
This comment has been minimized.
This comment has been minimized.
Compiler error on |
cc @rust-lang/wg-const-eval |
A previous (now-fixed) ICE with the same error message is #72113 |
Thanks for the report! Would be good to get a better backtrace; this one seems to be missing many frames and there are no line numbers. |
I updated the backtrace in my first post. I used rustup to get the latest trunk version, and the one I have been using does not have line numbers. If there is a flag or configuration for rustup to get rustc binaries with line numbers, I would be happy to change the settings on my testing machine. |
I think getting line numbers requires a debug build of the compiler, so it's not quite as easy as installing something via rustup. |
Labeling |
Here's a backtrace with debug info:
|
Unfortunately, this bottoms out here; more digging will be needed to determine the true underlying cause of the error. |
Here is the actual backtrace of the underlying CTFE/Miri error:
It points to this line:
|
So... I guess the fix is to make this kind of error also be permitted during validation and turn it into a proper validation error? |
Permitting it at the top-level is no good, since then we don't know "where in the value" it arose. We need a version of |
Oh... right, we should fix this in general, and not just wrap
try_validation . Maybe we should not have any automatic way to bubble up errors and require all sites to use try_validation ?
|
I think we should wrap it but put the wrapped thing into a helper function sow e can also use it for the other places.
So basically, you want to use a different error type for validation, one that excludes all the other errors? I am open to refactorings here. |
Let's start out with wrapping, and then I can experiment with the refactoring so we can have a look at the usability effect of it Instructions: wrap the
try_validation macro invocation and capture the ReadPointerAsBytes error. Emit a validation message about the fact that reading parts of a pointer is not possible during CTFE. Don't forget to add a test (the failing example from this issue works great as a test) and run the test with ./x.py test src/test/ui --test-args your_test_name --bless
|
There are quite a few |
…li-obk Fix ICE with `ReadPointerAsBytes` validation error Fixes rust-lang#79690. r? `````@oli-obk`````
Reopening this to track that |
Code
Meta
rustc --version --verbose
:Error output
Backtrace
The text was updated successfully, but these errors were encountered: