diff options
| author | csmoe <35686186+csmoe@users.noreply.github.com> | 2018-09-01 18:13:28 +0800 |
|---|---|---|
| committer | csmoe <35686186+csmoe@users.noreply.github.com> | 2018-09-01 18:13:28 +0800 |
| commit | db7da0e476b943cf9248e2f49329a300ffbb132e (patch) | |
| tree | d6c9018567a9a46d7946fbe351c50d459de11fd1 | |
| parent | a18a2900f3c4be97d661c2ab5ae5812106ed2833 (diff) | |
| download | rust-db7da0e476b943cf9248e2f49329a300ffbb132e.tar.gz rust-db7da0e476b943cf9248e2f49329a300ffbb132e.zip | |
bug! instead of panic!
| -rw-r--r-- | src/librustc_mir/interpret/memory.rs | 2 | ||||
| -rw-r--r-- | 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 d2edfdec906..59bebbb87a7 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 b0e8f1c8ca3..7a13d8bdd4b 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 \ |
