diff --git a/src/librustc_mir/interpret/memory.rs b/src/librustc_mir/interpret/memory.rs index d2edfdec9065..59bebbb87a77 100644 --- a/src/librustc_mir/interpret/memory.rs +++ b/src/librustc_mir/interpret/memory.rs @@ -344,7 +344,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> Memory<'a, 'mir, 'tcx, M> { if let ConstValue::ByRef(_, allocation, _) = const_val.val { allocation } else { - panic!("Matching on non-ByRef static") + bug!("Matching on non-ByRef static") } }) } diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index b0e8f1c8ca3f..7a13d8bdd4ba 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -1378,7 +1378,7 @@ fn maybe_check_static_with_link_section(tcx: TyCtxt, id: DefId, span: Span) { let alloc = if let ConstValue::ByRef(_, allocation, _) = static_.val { allocation } else { - panic!("Matching on non-ByRef static") + bug!("Matching on non-ByRef static") }; if alloc.relocations.len() != 0 { let msg = "statics with a custom `#[link_section]` must be a \