Skip to content

Commit ab413cf

Browse files
author
The Miri Cronjob Bot
committed
Merge ref '4c7749e8c8e5' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: 4c7749e8c8e50ad146da599eea3a250160c1bc2b Filtered ref: 9742b59 This merge was created using https://github.com/rust-lang/josh-sync.
2 parents c3eb746 + 9742b59 commit ab413cf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+101
-99
lines changed

src/intrinsics/atomic.rs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -105,27 +105,27 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
105105
}
106106

107107
"or" => {
108-
let ord = get_ord_at(1);
108+
let ord = get_ord_at(2);
109109
this.atomic_rmw_op(args, dest, AtomicOp::MirOp(BinOp::BitOr, false), rw_ord(ord))?;
110110
}
111111
"xor" => {
112-
let ord = get_ord_at(1);
112+
let ord = get_ord_at(2);
113113
this.atomic_rmw_op(args, dest, AtomicOp::MirOp(BinOp::BitXor, false), rw_ord(ord))?;
114114
}
115115
"and" => {
116-
let ord = get_ord_at(1);
116+
let ord = get_ord_at(2);
117117
this.atomic_rmw_op(args, dest, AtomicOp::MirOp(BinOp::BitAnd, false), rw_ord(ord))?;
118118
}
119119
"nand" => {
120-
let ord = get_ord_at(1);
120+
let ord = get_ord_at(2);
121121
this.atomic_rmw_op(args, dest, AtomicOp::MirOp(BinOp::BitAnd, true), rw_ord(ord))?;
122122
}
123123
"xadd" => {
124-
let ord = get_ord_at(1);
124+
let ord = get_ord_at(2);
125125
this.atomic_rmw_op(args, dest, AtomicOp::MirOp(BinOp::Add, false), rw_ord(ord))?;
126126
}
127127
"xsub" => {
128-
let ord = get_ord_at(1);
128+
let ord = get_ord_at(2);
129129
this.atomic_rmw_op(args, dest, AtomicOp::MirOp(BinOp::Sub, false), rw_ord(ord))?;
130130
}
131131
"min" => {
@@ -231,15 +231,14 @@ trait EvalContextPrivExt<'tcx>: MiriInterpCxExt<'tcx> {
231231
let place = this.deref_pointer(place)?;
232232
let rhs = this.read_immediate(rhs)?;
233233

234-
if !place.layout.ty.is_integral() && !place.layout.ty.is_raw_ptr() {
234+
if !(place.layout.ty.is_integral() || place.layout.ty.is_raw_ptr())
235+
|| !(rhs.layout.ty.is_integral() || rhs.layout.ty.is_raw_ptr())
236+
{
235237
span_bug!(
236238
this.cur_span(),
237239
"atomic arithmetic operations only work on integer and raw pointer types",
238240
);
239241
}
240-
if rhs.layout.ty != place.layout.ty {
241-
span_bug!(this.cur_span(), "atomic arithmetic operation type mismatch");
242-
}
243242

244243
let old = match atomic_op {
245244
AtomicOp::Min =>

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![cfg_attr(bootstrap, feature(strict_overflow_ops))]
12
#![feature(abort_unwind)]
23
#![feature(cfg_select)]
34
#![feature(rustc_private)]
@@ -11,7 +12,6 @@
1112
#![feature(variant_count)]
1213
#![feature(yeet_expr)]
1314
#![feature(nonzero_ops)]
14-
#![feature(strict_overflow_ops)]
1515
#![feature(pointer_is_aligned_to)]
1616
#![feature(ptr_metadata)]
1717
#![feature(unqualified_local_imports)]

src/operator.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,13 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
5050
}
5151

5252
// Some more operations are possible with atomics.
53-
// The return value always has the provenance of the *left* operand.
53+
// The RHS must be `usize`.
5454
Add | Sub | BitOr | BitAnd | BitXor => {
5555
assert!(left.layout.ty.is_raw_ptr());
56-
assert!(right.layout.ty.is_raw_ptr());
56+
assert_eq!(right.layout.ty, this.tcx.types.usize);
5757
let ptr = left.to_scalar().to_pointer(this)?;
5858
// We do the actual operation with usize-typed scalars.
5959
let left = ImmTy::from_uint(ptr.addr().bytes(), this.machine.layouts.usize);
60-
let right = ImmTy::from_uint(
61-
right.to_scalar().to_target_usize(this)?,
62-
this.machine.layouts.usize,
63-
);
6460
let result = this.binary_op(bin_op, &left, &right)?;
6561
// Construct a new pointer with the provenance of `ptr` (the LHS).
6662
let result_ptr = Pointer::new(

tests/fail/alloc/alloc_error_handler_custom.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ note: inside `_::__rg_oom`
1111
--> tests/fail/alloc/alloc_error_handler_custom.rs:LL:CC
1212
|
1313
LL | #[alloc_error_handler]
14-
| ---------------------- in this procedural macro expansion
14+
| ---------------------- in this attribute macro expansion
1515
LL | fn alloc_error_handler(layout: Layout) -> ! {
1616
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1717
= note: inside `alloc::alloc::handle_alloc_error::rt_error` at RUSTLIB/alloc/src/alloc.rs:LL:CC

tests/fail/function_calls/exported_symbol_bad_unwind1.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
thread 'main' panicked at tests/fail/function_calls/exported_symbol_bad_unwind1.rs:LL:CC:
2+
thread 'main' ($TID) panicked at tests/fail/function_calls/exported_symbol_bad_unwind1.rs:LL:CC:
33
explicit panic
44
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect

tests/fail/function_calls/exported_symbol_bad_unwind2.both.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11

2-
thread 'main' panicked at tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC:
2+
thread 'main' ($TID) panicked at tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC:
33
explicit panic
44
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
66

7-
thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
7+
thread 'main' ($TID) panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
88
panic in a function that cannot unwind
99
stack backtrace:
1010
thread caused non-unwinding panic. aborting.
@@ -18,8 +18,8 @@ LL | ABORT()
1818
= note: inside `std::sys::pal::PLATFORM::abort_internal` at RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
1919
= note: inside `std::panicking::panic_with_hook` at RUSTLIB/std/src/panicking.rs:LL:CC
2020
= note: inside closure at RUSTLIB/std/src/panicking.rs:LL:CC
21-
= note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>` at RUSTLIB/std/src/sys/backtrace.rs:LL:CC
22-
= note: inside `std::panicking::begin_panic_handler` at RUSTLIB/std/src/panicking.rs:LL:CC
21+
= note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::panic_handler::{closure#0}}, !>` at RUSTLIB/std/src/sys/backtrace.rs:LL:CC
22+
= note: inside `std::panicking::panic_handler` at RUSTLIB/std/src/panicking.rs:LL:CC
2323
= note: inside `core::panicking::panic_nounwind` at RUSTLIB/core/src/panicking.rs:LL:CC
2424
= note: inside `core::panicking::panic_cannot_unwind` at RUSTLIB/core/src/panicking.rs:LL:CC
2525
note: inside `nounwind`

tests/fail/function_calls/exported_symbol_bad_unwind2.definition.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11

2-
thread 'main' panicked at tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC:
2+
thread 'main' ($TID) panicked at tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC:
33
explicit panic
44
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
66

7-
thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
7+
thread 'main' ($TID) panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
88
panic in a function that cannot unwind
99
stack backtrace:
1010
thread caused non-unwinding panic. aborting.
@@ -18,8 +18,8 @@ LL | ABORT()
1818
= note: inside `std::sys::pal::PLATFORM::abort_internal` at RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
1919
= note: inside `std::panicking::panic_with_hook` at RUSTLIB/std/src/panicking.rs:LL:CC
2020
= note: inside closure at RUSTLIB/std/src/panicking.rs:LL:CC
21-
= note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>` at RUSTLIB/std/src/sys/backtrace.rs:LL:CC
22-
= note: inside `std::panicking::begin_panic_handler` at RUSTLIB/std/src/panicking.rs:LL:CC
21+
= note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::panic_handler::{closure#0}}, !>` at RUSTLIB/std/src/sys/backtrace.rs:LL:CC
22+
= note: inside `std::panicking::panic_handler` at RUSTLIB/std/src/panicking.rs:LL:CC
2323
= note: inside `core::panicking::panic_nounwind` at RUSTLIB/core/src/panicking.rs:LL:CC
2424
= note: inside `core::panicking::panic_cannot_unwind` at RUSTLIB/core/src/panicking.rs:LL:CC
2525
note: inside `nounwind`

tests/fail/function_calls/exported_symbol_bad_unwind2.extern_block.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
thread 'main' panicked at tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC:
2+
thread 'main' ($TID) panicked at tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC:
33
explicit panic
44
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect

tests/fail/function_calls/return_pointer_on_unwind.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
thread 'main' panicked at tests/fail/function_calls/return_pointer_on_unwind.rs:LL:CC:
2+
thread 'main' ($TID) panicked at tests/fail/function_calls/return_pointer_on_unwind.rs:LL:CC:
33
explicit panic
44
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect

tests/fail/panic/abort_unwind.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11

2-
thread 'main' panicked at tests/fail/panic/abort_unwind.rs:LL:CC:
2+
thread 'main' ($TID) panicked at tests/fail/panic/abort_unwind.rs:LL:CC:
33
PANIC!!!
44
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
55
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
66

7-
thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
7+
thread 'main' ($TID) panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
88
panic in a function that cannot unwind
99
stack backtrace:
1010
thread caused non-unwinding panic. aborting.
@@ -18,8 +18,8 @@ LL | ABORT()
1818
= note: inside `std::sys::pal::PLATFORM::abort_internal` at RUSTLIB/std/src/sys/pal/PLATFORM/mod.rs:LL:CC
1919
= note: inside `std::panicking::panic_with_hook` at RUSTLIB/std/src/panicking.rs:LL:CC
2020
= note: inside closure at RUSTLIB/std/src/panicking.rs:LL:CC
21-
= note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>` at RUSTLIB/std/src/sys/backtrace.rs:LL:CC
22-
= note: inside `std::panicking::begin_panic_handler` at RUSTLIB/std/src/panicking.rs:LL:CC
21+
= note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::panic_handler::{closure#0}}, !>` at RUSTLIB/std/src/sys/backtrace.rs:LL:CC
22+
= note: inside `std::panicking::panic_handler` at RUSTLIB/std/src/panicking.rs:LL:CC
2323
= note: inside `core::panicking::panic_nounwind` at RUSTLIB/core/src/panicking.rs:LL:CC
2424
= note: inside `core::panicking::panic_cannot_unwind` at RUSTLIB/core/src/panicking.rs:LL:CC
2525
= note: inside `std::panic::abort_unwind::<{closure@tests/fail/panic/abort_unwind.rs:LL:CC}, ()>` at RUSTLIB/core/src/panic.rs:LL:CC

0 commit comments

Comments
 (0)