Skip to content

Commit db7da0e

Browse files
committed
bug! instead of panic!
1 parent a18a290 commit db7da0e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Diff for: src/librustc_mir/interpret/memory.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> Memory<'a, 'mir, 'tcx, M> {
344344
if let ConstValue::ByRef(_, allocation, _) = const_val.val {
345345
allocation
346346
} else {
347-
panic!("Matching on non-ByRef static")
347+
bug!("Matching on non-ByRef static")
348348
}
349349
})
350350
}

Diff for: src/librustc_typeck/check/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1378,7 +1378,7 @@ fn maybe_check_static_with_link_section(tcx: TyCtxt, id: DefId, span: Span) {
13781378
let alloc = if let ConstValue::ByRef(_, allocation, _) = static_.val {
13791379
allocation
13801380
} else {
1381-
panic!("Matching on non-ByRef static")
1381+
bug!("Matching on non-ByRef static")
13821382
};
13831383
if alloc.relocations.len() != 0 {
13841384
let msg = "statics with a custom `#[link_section]` must be a \

0 commit comments

Comments
 (0)