- Notifications
You must be signed in to change notification settings - Fork 14.1k
interpret: on a signed deref check, mention the right pointer in the error #128482
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
Conversation
| r? @wesleywiser rustbot has assigned @wesleywiser. Use |
| Some changes occurred to the CTFE / Miri engine cc @rust-lang/miri Some changes occurred to the CTFE / Miri engine cc @rust-lang/miri The Miri subtree was changed cc @rust-lang/miri |
b31f860 to 74f6da3 Compare 74f6da3 to 399dca0 Compare This comment has been minimized.
This comment has been minimized.
399dca0 to e4bb248 Compare | @bors r+ rollup |
This comment has been minimized.
This comment has been minimized.
| @bors r- |
| r=me with CI happy |
e4bb248 to 0f15f05 Compare | @bors r=oli-obk |
This comment has been minimized.
This comment has been minimized.
| Argh. |
0f15f05 to db1652e Compare | @bors r=oli-obk |
interpret: on a signed deref check, mention the right pointer in the error When a negative offset (like `ptr.offset(-10)`) goes out-of-bounds, we currently show an error saying that we expect the *resulting* pointer to be inbounds for 10 bytes. That's confusing, so this PR makes it so that instead we say that we expect the *original* pointer `ptr` to have 10 bytes *to the left*. I also realized I can simplify the pointer arithmetic logic and handling of "staying inbounds of a target `usize`" quite a bit; the second commit does that.
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#127490 (Add target page for riscv64gc-unknown-linux-gnu) - rust-lang#128433 (fix(hermit): `deny(unsafe_op_in_unsafe_fn)`) - rust-lang#128482 (interpret: on a signed deref check, mention the right pointer in the error) - rust-lang#128496 (Fix removed `box_syntax` diagnostic if source isn't available) - rust-lang#128497 (fix dropck documentation for `[T;0]` special-case) - rust-lang#128499 (chore: refactor backtrace formatting) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#128482 - RalfJung:ptr-signed-offset, r=oli-obk interpret: on a signed deref check, mention the right pointer in the error When a negative offset (like `ptr.offset(-10)`) goes out-of-bounds, we currently show an error saying that we expect the *resulting* pointer to be inbounds for 10 bytes. That's confusing, so this PR makes it so that instead we say that we expect the *original* pointer `ptr` to have 10 bytes *to the left*. I also realized I can simplify the pointer arithmetic logic and handling of "staying inbounds of a target `usize`" quite a bit; the second commit does that.
When a negative offset (like
ptr.offset(-10)) goes out-of-bounds, we currently show an error saying that we expect the resulting pointer to be inbounds for 10 bytes. That's confusing, so this PR makes it so that instead we say that we expect the original pointerptrto have 10 bytes to the left.I also realized I can simplify the pointer arithmetic logic and handling of "staying inbounds of a target
usize" quite a bit; the second commit does that.