forked from rust-lang/miri
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #124703 - matthiaskrgr:rollup-2lljptd, r=matthiaskrgr
Rollup of 8 pull requests Successful merges: - #123356 (Reduce code size of `thread::set_current`) - #124159 (Move thread parking to `sys::sync`) - #124293 (Let miri and const eval execute intrinsics' fallback bodies) - #124677 (Set non-leaf frame pointers on Fuchsia targets) - #124692 (We do not coerce `&mut &mut T -> *mut mut T`) - #124698 (Rewrite `rustdoc-determinism` test in Rust) - #124700 (Remove an unnecessary cast) - #124701 (Docs: suggest `uN::checked_sub` instead of check-then-unchecked) r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
6 changed files
with
64 additions
and
33 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#![feature(rustc_attrs, effects)] | ||
|
||
#[rustc_intrinsic] | ||
#[rustc_nounwind] | ||
#[rustc_do_not_const_check] | ||
#[inline] | ||
pub const fn ptr_guaranteed_cmp<T>(ptr: *const T, other: *const T) -> u8 { | ||
(ptr == other) as u8 | ||
} | ||
|
||
fn main() { | ||
ptr_guaranteed_cmp::<()>(std::ptr::null(), std::ptr::null()); | ||
//~^ ERROR: can only use intrinsic fallback bodies that check UB. | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
error: unsupported operation: miri can only use intrinsic fallback bodies that check UB. After verifying that `ptr_guaranteed_cmp` does so, add the `#[miri::intrinsic_fallback_checks_ub]` attribute to it; also ping @rust-lang/miri when you do that | ||
--> $DIR/intrinsic_fallback_checks_ub.rs:LL:CC | ||
| | ||
LL | ptr_guaranteed_cmp::<()>(std::ptr::null(), std::ptr::null()); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ miri can only use intrinsic fallback bodies that check UB. After verifying that `ptr_guaranteed_cmp` does so, add the `#[miri::intrinsic_fallback_checks_ub]` attribute to it; also ping @rust-lang/miri when you do that | ||
| | ||
= help: this is likely not a bug in the program; it indicates that the program performed an operation that the interpreter does not support | ||
= note: BACKTRACE: | ||
= note: inside `main` at $DIR/intrinsic_fallback_checks_ub.rs:LL:CC | ||
|
||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace | ||
|
||
error: aborting due to 1 previous error | ||
|