Skip to content

Commit bc4349e

Browse files
committed
rename 'try' intrinsic to 'catch_unwind'
1 parent acefb26 commit bc4349e

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

src/shims/intrinsics/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
5454

5555
// Some intrinsics are special and need the "ret".
5656
match intrinsic_name {
57-
"try" => return this.handle_try(args, dest, ret),
57+
"catch_unwind" => return this.handle_catch_unwind(args, dest, ret),
5858
_ => {}
5959
}
6060

src/shims/panic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
6969
}
7070

7171
/// Handles the `try` intrinsic, the underlying implementation of `std::panicking::try`.
72-
fn handle_try(
72+
fn handle_catch_unwind(
7373
&mut self,
7474
args: &[OpTy<'tcx, Provenance>],
7575
dest: &PlaceTy<'tcx, Provenance>,

tests/fail/function_calls/check_callback_abi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ fn main() {
88
unsafe {
99
// Make sure we check the ABI when Miri itself invokes a function
1010
// as part of a shim implementation.
11-
std::intrinsics::r#try(
11+
std::intrinsics::catch_unwind(
1212
//~^ ERROR: calling a function with ABI C using caller ABI Rust
1313
std::mem::transmute::<extern "C" fn(*mut u8), _>(try_fn),
1414
std::ptr::null_mut(),

tests/fail/function_calls/check_callback_abi.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
error: Undefined Behavior: calling a function with ABI C using caller ABI Rust
22
--> $DIR/check_callback_abi.rs:LL:CC
33
|
4-
LL | / std::intrinsics::r#try(
4+
LL | / std::intrinsics::catch_unwind(
55
LL | |
66
LL | | std::mem::transmute::<extern "C" fn(*mut u8), _>(try_fn),
77
LL | | std::ptr::null_mut(),

tests/pass/function_calls/disable_abi_check.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ fn main() {
1515
unsafe {
1616
let _ = malloc(0);
1717
std::mem::transmute::<fn(), extern "C" fn()>(foo)();
18-
std::intrinsics::r#try(
18+
std::intrinsics::catch_unwind(
1919
std::mem::transmute::<extern "C" fn(*mut u8), _>(try_fn),
2020
std::ptr::null_mut(),
2121
|_, _| unreachable!(),

0 commit comments

Comments
 (0)