Skip to content

Commit 546c826

Browse files
committed
Auto merge of #98018 - scottmcm:miri-yeet, r=RalfJung
Try out `yeet` in the MIR interpreter Since we got a new bootstrap, we can give this a shot. r? `@oli-obk`
2 parents 4153a2e + a6c6fa0 commit 546c826

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

compiler/rustc_const_eval/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Rust MIR: a lowered representation of Rust.
2020
#![feature(trusted_len)]
2121
#![feature(trusted_step)]
2222
#![feature(try_blocks)]
23+
#![feature(yeet_expr)]
2324
#![recursion_limit = "256"]
2425
#![allow(rustc::potential_query_instability)]
2526

compiler/rustc_middle/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
#![feature(decl_macro)]
5959
#![feature(drain_filter)]
6060
#![feature(intra_doc_pointers)]
61+
#![feature(yeet_expr)]
6162
#![recursion_limit = "512"]
6263
#![allow(rustc::potential_query_instability)]
6364

compiler/rustc_middle/src/mir/interpret/mod.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ macro_rules! err_machine_stop {
5656
// In the `throw_*` macros, avoid `return` to make them work with `try {}`.
5757
#[macro_export]
5858
macro_rules! throw_unsup {
59-
($($tt:tt)*) => { Err::<!, _>(err_unsup!($($tt)*))? };
59+
($($tt:tt)*) => { do yeet err_unsup!($($tt)*) };
6060
}
6161

6262
#[macro_export]
@@ -66,12 +66,12 @@ macro_rules! throw_unsup_format {
6666

6767
#[macro_export]
6868
macro_rules! throw_inval {
69-
($($tt:tt)*) => { Err::<!, _>(err_inval!($($tt)*))? };
69+
($($tt:tt)*) => { do yeet err_inval!($($tt)*) };
7070
}
7171

7272
#[macro_export]
7373
macro_rules! throw_ub {
74-
($($tt:tt)*) => { Err::<!, _>(err_ub!($($tt)*))? };
74+
($($tt:tt)*) => { do yeet err_ub!($($tt)*) };
7575
}
7676

7777
#[macro_export]
@@ -81,12 +81,12 @@ macro_rules! throw_ub_format {
8181

8282
#[macro_export]
8383
macro_rules! throw_exhaust {
84-
($($tt:tt)*) => { Err::<!, _>(err_exhaust!($($tt)*))? };
84+
($($tt:tt)*) => { do yeet err_exhaust!($($tt)*) };
8585
}
8686

8787
#[macro_export]
8888
macro_rules! throw_machine_stop {
89-
($($tt:tt)*) => { Err::<!, _>(err_machine_stop!($($tt)*))? };
89+
($($tt:tt)*) => { do yeet err_machine_stop!($($tt)*) };
9090
}
9191

9292
mod allocation;

compiler/rustc_mir_transform/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#![feature(option_get_or_insert_default)]
1010
#![feature(trusted_step)]
1111
#![feature(try_blocks)]
12+
#![feature(yeet_expr)]
1213
#![recursion_limit = "256"]
1314

1415
#[macro_use]

0 commit comments

Comments
 (0)