interpret: on a signed deref check, mention the right pointer in the error#128482
Merged
bors merged 3 commits intorust-lang:masterfrom Aug 1, 2024
Merged
interpret: on a signed deref check, mention the right pointer in the error#128482bors merged 3 commits intorust-lang:masterfrom
bors merged 3 commits intorust-lang:masterfrom
Conversation
Collaborator
|
r? @wesleywiser rustbot has assigned @wesleywiser. Use |
Collaborator
|
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
oli-obk
reviewed
Aug 1, 2024
74f6da3 to
399dca0
Compare
This comment has been minimized.
This comment has been minimized.
399dca0 to
e4bb248
Compare
Contributor
|
@bors r+ rollup |
Collaborator
This comment has been minimized.
This comment has been minimized.
Contributor
|
@bors r- |
Contributor
|
r=me with CI happy |
e4bb248 to
0f15f05
Compare
Member
Author
|
@bors r=oli-obk |
Collaborator
This comment has been minimized.
This comment has been minimized.
Member
Author
|
Argh. |
0f15f05 to
db1652e
Compare
Member
Author
|
@bors r=oli-obk |
Collaborator
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Aug 1, 2024
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.
This was referenced Aug 1, 2024
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Aug 1, 2024
…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
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Aug 1, 2024
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.