Skip to content

Commit b2ae77f

Browse files
committed
Auto merge of #3693 - rust-lang:rustup-2024-06-21, r=oli-obk
Automatic Rustup
2 parents cc9699d + 72ae31c commit b2ae77f

11 files changed

+64
-11
lines changed

rust-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
a1ca449981e3b8442e358026437b7bedb9a1458e
1+
7a08f84627ff3035de4d66ff3209e5fc93165dcb

tests/fail/function_calls/exported_symbol_bad_unwind1.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(c_unwind)]
2-
31
#[no_mangle]
42
extern "C-unwind" fn unwind() {
53
panic!();

tests/fail/function_calls/exported_symbol_bad_unwind2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//@normalize-stderr-test: "\n +[0-9]+:[^\n]+" -> ""
55
//@normalize-stderr-test: "\n +at [^\n]+" -> ""
66
//@[definition,both]error-in-other-file: aborted execution
7-
#![feature(rustc_attrs, c_unwind)]
7+
#![feature(rustc_attrs)]
88

99
#[cfg_attr(any(definition, both), rustc_nounwind)]
1010
#[no_mangle]

tests/fail/panic/bad_unwind.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(c_unwind)]
2-
31
//! Unwinding when the caller ABI is "C" (without "-unwind") is UB.
42
// The opposite version (callee does not allow unwinding) is impossible to
53
// even write: MIR validation catches functions that have `UnwindContinue` but

tests/fail/storage-live-dead-var.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#![feature(core_intrinsics, custom_mir)]
2+
use std::intrinsics::mir::*;
3+
4+
#[custom_mir(dialect = "runtime")]
5+
fn main() {
6+
mir! {
7+
let val: i32;
8+
{
9+
val = 42; //~ERROR: accessing a dead local variable
10+
StorageLive(val); // too late... (but needs to be here to make `val` not implicitly live)
11+
Return()
12+
}
13+
}
14+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
error: Undefined Behavior: accessing a dead local variable
2+
--> $DIR/storage-live-dead-var.rs:LL:CC
3+
|
4+
LL | val = 42;
5+
| ^^^^^^^^ accessing a dead local variable
6+
|
7+
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
8+
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
9+
= note: BACKTRACE:
10+
= note: inside `main` at $DIR/storage-live-dead-var.rs:LL:CC
11+
12+
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
13+
14+
error: aborting due to 1 previous error
15+

tests/fail/storage-live-resets-var.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#![feature(core_intrinsics, custom_mir)]
2+
use std::intrinsics::mir::*;
3+
4+
#[custom_mir(dialect = "runtime")]
5+
fn main() {
6+
mir! {
7+
let val: i32;
8+
let _val2: i32;
9+
{
10+
StorageLive(val);
11+
val = 42;
12+
StorageLive(val); // reset val to `uninit`
13+
_val2 = val; //~ERROR: uninitialized
14+
Return()
15+
}
16+
}
17+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
error: Undefined Behavior: constructing invalid value: encountered uninitialized memory, but expected an integer
2+
--> $DIR/storage-live-resets-var.rs:LL:CC
3+
|
4+
LL | _val2 = val;
5+
| ^^^^^^^^^^^ constructing invalid value: encountered uninitialized memory, but expected an integer
6+
|
7+
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
8+
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
9+
= note: BACKTRACE:
10+
= note: inside `main` at $DIR/storage-live-resets-var.rs:LL:CC
11+
12+
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
13+
14+
error: aborting due to 1 previous error
15+

tests/fail/terminate-terminator.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
// Enable MIR inlining to ensure that `TerminatorKind::UnwindTerminate` is generated
88
// instead of just `UnwindAction::Terminate`.
99

10-
#![feature(c_unwind)]
11-
1210
struct Foo;
1311

1412
impl Drop for Foo {

tests/fail/unwind-action-terminate.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
//@normalize-stderr-test: "\| +\^+" -> "| ^"
44
//@normalize-stderr-test: "\n +[0-9]+:[^\n]+" -> ""
55
//@normalize-stderr-test: "\n +at [^\n]+" -> ""
6-
#![feature(c_unwind)]
7-
86
extern "C" fn panic_abort() {
97
panic!()
108
}

0 commit comments

Comments
 (0)