Skip to content

Commit

Permalink
Auto merge of rust-lang#3624 - rust-lang:rustup-2024-05-23, r=RalfJung
Browse files Browse the repository at this point in the history
Automatic Rustup
  • Loading branch information
bors committed May 23, 2024
2 parents 94b6cd6 + bf42109 commit d9b3654
Show file tree
Hide file tree
Showing 33 changed files with 83 additions and 349 deletions.
2 changes: 1 addition & 1 deletion rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
b54dd08a84f3c07efbc2aaf63c3df219ae680a03
9cdfe285ca724c801dc9f78d22b24ea69b787f26
9 changes: 3 additions & 6 deletions src/intrinsics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,15 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
if this.tcx.intrinsic(instance.def_id()).unwrap().must_be_overridden {
throw_unsup_format!("unimplemented intrinsic: `{intrinsic_name}`")
}
let intrinsic_fallback_checks_ub = Symbol::intern("intrinsic_fallback_checks_ub");
let intrinsic_fallback_is_spec = Symbol::intern("intrinsic_fallback_is_spec");
if this
.tcx
.get_attrs_by_path(
instance.def_id(),
&[sym::miri, intrinsic_fallback_checks_ub],
)
.get_attrs_by_path(instance.def_id(), &[sym::miri, intrinsic_fallback_is_spec])
.next()
.is_none()
{
throw_unsup_format!(
"miri can only use intrinsic fallback bodies that check UB. After verifying that `{intrinsic_name}` does so, add the `#[miri::intrinsic_fallback_checks_ub]` attribute to it; also ping @rust-lang/miri when you do that"
"Miri can only use intrinsic fallback bodies that exactly reflect the specification: they fully check for UB and are as non-deterministic as possible. After verifying that `{intrinsic_name}` does so, add the `#[miri::intrinsic_fallback_is_spec]` attribute to it; also ping @rust-lang/miri when you do that"
);
}
Ok(Some(ty::Instance {
Expand Down
10 changes: 0 additions & 10 deletions tests/fail/dangling_pointers/dangling_zst_deref.rs

This file was deleted.

25 changes: 0 additions & 25 deletions tests/fail/dangling_pointers/dangling_zst_deref.stderr

This file was deleted.

5 changes: 0 additions & 5 deletions tests/fail/dangling_pointers/maybe_null_pointer_deref_zst.rs

This file was deleted.

15 changes: 0 additions & 15 deletions tests/fail/dangling_pointers/maybe_null_pointer_deref_zst.stderr

This file was deleted.

8 changes: 0 additions & 8 deletions tests/fail/dangling_pointers/maybe_null_pointer_write_zst.rs

This file was deleted.

15 changes: 0 additions & 15 deletions tests/fail/dangling_pointers/maybe_null_pointer_write_zst.stderr

This file was deleted.

5 changes: 0 additions & 5 deletions tests/fail/dangling_pointers/null_pointer_deref_zst.rs

This file was deleted.

15 changes: 0 additions & 15 deletions tests/fail/dangling_pointers/null_pointer_deref_zst.stderr

This file was deleted.

8 changes: 0 additions & 8 deletions tests/fail/dangling_pointers/null_pointer_write_zst.rs

This file was deleted.

15 changes: 0 additions & 15 deletions tests/fail/dangling_pointers/null_pointer_write_zst.stderr

This file was deleted.

14 changes: 0 additions & 14 deletions tests/fail/intrinsic_fallback_checks_ub.stderr

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ pub const fn ptr_guaranteed_cmp<T>(ptr: *const T, other: *const T) -> u8 {

fn main() {
ptr_guaranteed_cmp::<()>(std::ptr::null(), std::ptr::null());
//~^ ERROR: can only use intrinsic fallback bodies that check UB.
//~^ ERROR: can only use intrinsic fallback bodies that exactly reflect the specification
}
14 changes: 14 additions & 0 deletions tests/fail/intrinsic_fallback_is_spec.stderr
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 exactly reflect the specification: they fully check for UB and are as non-deterministic as possible. After verifying that `ptr_guaranteed_cmp` does so, add the `#[miri::intrinsic_fallback_is_spec]` attribute to it; also ping @rust-lang/miri when you do that
--> $DIR/intrinsic_fallback_is_spec.rs:LL:CC
|
LL | ptr_guaranteed_cmp::<()>(std::ptr::null(), std::ptr::null());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Miri can only use intrinsic fallback bodies that exactly reflect the specification: they fully check for UB and are as non-deterministic as possible. After verifying that `ptr_guaranteed_cmp` does so, add the `#[miri::intrinsic_fallback_is_spec]` 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 Miri does not support
= note: BACKTRACE:
= note: inside `main` at $DIR/intrinsic_fallback_is_spec.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

15 changes: 0 additions & 15 deletions tests/fail/intrinsics/copy_null.rs

This file was deleted.

15 changes: 0 additions & 15 deletions tests/fail/intrinsics/copy_null.stderr

This file was deleted.

9 changes: 0 additions & 9 deletions tests/fail/intrinsics/ptr_offset_0_plus_0.rs

This file was deleted.

15 changes: 0 additions & 15 deletions tests/fail/intrinsics/ptr_offset_0_plus_0.stderr

This file was deleted.

7 changes: 0 additions & 7 deletions tests/fail/intrinsics/ptr_offset_from_oob.rs

This file was deleted.

15 changes: 0 additions & 15 deletions tests/fail/intrinsics/ptr_offset_from_oob.stderr

This file was deleted.

7 changes: 0 additions & 7 deletions tests/fail/intrinsics/ptr_offset_ptr_plus_0.rs

This file was deleted.

20 changes: 0 additions & 20 deletions tests/fail/intrinsics/ptr_offset_ptr_plus_0.stderr

This file was deleted.

10 changes: 0 additions & 10 deletions tests/fail/intrinsics/write_bytes_null.rs

This file was deleted.

15 changes: 0 additions & 15 deletions tests/fail/intrinsics/write_bytes_null.stderr

This file was deleted.

12 changes: 0 additions & 12 deletions tests/fail/zst2.rs

This file was deleted.

25 changes: 0 additions & 25 deletions tests/fail/zst2.stderr

This file was deleted.

15 changes: 0 additions & 15 deletions tests/fail/zst3.rs

This file was deleted.

Loading

0 comments on commit d9b3654

Please sign in to comment.