From db7da0e476b943cf9248e2f49329a300ffbb132e Mon Sep 17 00:00:00 2001 From: csmoe <35686186+csmoe@users.noreply.github.com> Date: Sat, 1 Sep 2018 18:13:28 +0800 Subject: [PATCH] bug! instead of panic! --- src/librustc_mir/interpret/memory.rs | 2 +- src/librustc_typeck/check/mod.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 \