Skip to content

Commit a69f31c

Browse files
committed
from_str_radix: outline only the panic function
1 parent 6eba9d7 commit a69f31c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

core/src/num/mod.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -1412,11 +1412,9 @@ fn from_str_radix_panic_rt(radix: u32) -> ! {
14121412
#[cfg_attr(feature = "panic_immediate_abort", inline)]
14131413
#[cold]
14141414
#[track_caller]
1415-
const fn from_str_radix_assert(radix: u32) {
1416-
if 2 > radix || radix > 36 {
1417-
// The only difference between these two functions is their panic message.
1418-
intrinsics::const_eval_select((radix,), from_str_radix_panic_ct, from_str_radix_panic_rt);
1419-
}
1415+
const fn from_str_radix_panic(radix: u32) {
1416+
// The only difference between these two functions is their panic message.
1417+
intrinsics::const_eval_select((radix,), from_str_radix_panic_ct, from_str_radix_panic_rt);
14201418
}
14211419

14221420
macro_rules! from_str_radix {
@@ -1450,7 +1448,9 @@ macro_rules! from_str_radix {
14501448
use self::IntErrorKind::*;
14511449
use self::ParseIntError as PIE;
14521450

1453-
from_str_radix_assert(radix);
1451+
if 2 > radix || radix > 36 {
1452+
from_str_radix_panic(radix);
1453+
}
14541454

14551455
if src.is_empty() {
14561456
return Err(PIE { kind: Empty });

0 commit comments

Comments
 (0)