Skip to content

Commit a6dea41

Browse files
committed
Make -Cpanic=abort imply -Zmutable-noalias
1 parent 3647129 commit a6dea41

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/librustc_trans/abi.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ use type_of;
3737
use rustc::hir;
3838
use rustc::ty::{self, Ty};
3939
use rustc::ty::layout::{self, Layout, LayoutTyper, TyLayout, Size};
40+
use rustc_back::PanicStrategy;
4041

4142
use libc::c_uint;
4243
use std::cmp;
@@ -761,7 +762,8 @@ impl<'a, 'tcx> FnType<'tcx> {
761762
let is_freeze = ccx.shared().type_is_freeze(mt.ty);
762763

763764
let no_alias_is_safe =
764-
if ccx.shared().tcx().sess.opts.debugging_opts.mutable_noalias {
765+
if ccx.shared().tcx().sess.opts.debugging_opts.mutable_noalias ||
766+
ccx.shared().tcx().sess.panic_strategy() == PanicStrategy::Abort {
765767
// Mutable refrences or immutable shared references
766768
mt.mutbl == hir::MutMutable || is_freeze
767769
} else {

0 commit comments

Comments
 (0)