]> git.lizzy.rs Git - rust.git/commitdiff
bug! instead of panic!
authorcsmoe <35686186+csmoe@users.noreply.github.com>
Sat, 1 Sep 2018 10:13:28 +0000 (18:13 +0800)
committercsmoe <35686186+csmoe@users.noreply.github.com>
Sat, 1 Sep 2018 10:13:28 +0000 (18:13 +0800)
src/librustc_mir/interpret/memory.rs
src/librustc_typeck/check/mod.rs

index d2edfdec906582a63ae0f274da087829e1b5da49..59bebbb87a7755289ffd46041ffdce433251a61d 100644 (file)
@@ -344,7 +344,7 @@ fn get_static_alloc(
             if let ConstValue::ByRef(_, allocation, _) = const_val.val {
                 allocation
             } else {
-                panic!("Matching on non-ByRef static")
+                bug!("Matching on non-ByRef static")
             }
         })
     }
index b0e8f1c8ca3f51e9c8c069126b35f02b279f6102..7a13d8bdd4bac2508bb79d46b050b383d9165873 100644 (file)
@@ -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 \