-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
CTFE inbounds-error-messages tweak #84972
Conversation
@@ -306,6 +306,9 @@ impl fmt::Display for UndefinedBehaviorInfo<'_> { | |||
ptr.alloc_id, | |||
allocation_size.bytes() | |||
), | |||
DanglingIntPointer(_, CheckInAllocMsg::InboundsTest) => { | |||
write!(f, "null pointer is not allowed for this operation") | |||
} |
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.
This special printing case existed before but at some point turned into dead code which was removed in #84903 -- but the code is good, it just should not be dead. :)
This comment has been minimized.
This comment has been minimized.
@@ -296,7 +296,7 @@ error[E0080]: could not evaluate static initializer | |||
--> $DIR/ub-wide-ptr.rs:135:5 | |||
| | |||
LL | mem::transmute::<_, &dyn Trait>((&92u8, 0usize)) | |||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ inbounds test failed: 0x0 is not a valid pointer | |||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ null pointer is not allowed for this operation |
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.
I wish we had more info here, like that this is about a vtable ptr in a wide pointer... but not sure what needs to be done for that. Orthogonal to this PR in any case
@bors r+ rollup |
📌 Commit bcf622b has been approved by |
Rollup of 9 pull requests Successful merges: - rust-lang#84779 (Add support for --test-args to cargotest) - rust-lang#84781 (Don't check bootstrap artifacts by default) - rust-lang#84787 (bump deps) - rust-lang#84815 (Update coverage docs and command line help) - rust-lang#84875 (Removes unneeded check of `#[no_coverage]` in mapgen) - rust-lang#84897 (Coverage instruments closure bodies in macros (not the macro body)) - rust-lang#84911 (Retry clang+llvm download) - rust-lang#84972 (CTFE inbounds-error-messages tweak) - rust-lang#84990 (Sort rustdoc-gui tests) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
fix null pointer error messages I got the `match` in rust-lang#84972 wrong, this fixes that. Also avoid redundant "inbounds test failed:" prefix. Should fix rust-lang#85027 r? `@oli-obk`
fix null pointer error messages I got the `match` in rust-lang#84972 wrong, this fixes that. Also avoid redundant "inbounds test failed:" prefix. Should fix rust-lang#85027 r? `@oli-obk`
r? @oli-obk