Skip to content

Commit 89d9dd6

Browse files
committed
Only format! error message on failure
1 parent 5337252 commit 89d9dd6

File tree

1 file changed

+1
-1
lines changed
  • compiler/rustc_smir/src/rustc_smir

1 file changed

+1
-1
lines changed

Diff for: compiler/rustc_smir/src/rustc_smir/alloc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub(crate) fn new_allocation<'tcx>(
2727
tables: &mut Tables<'tcx>,
2828
) -> Allocation {
2929
try_new_allocation(ty, const_value, tables)
30-
.expect(&format!("Failed to convert: {const_value:?} to {ty:?}"))
30+
.unwrap_or_else(|_| panic!("Failed to convert: {const_value:?} to {ty:?}"))
3131
}
3232

3333
#[allow(rustc::usage_of_qualified_ty)]

0 commit comments

Comments
 (0)