bug! instead of panic!

This commit is contained in:
csmoe 2018-09-01 18:13:28 +08:00
parent a18a2900f3
commit db7da0e476
2 changed files with 2 additions and 2 deletions

View file

@ -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")
}
})
}

View 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 \