Make -Cpanic=abort imply -Zmutable-noalias
This commit is contained in:
parent
36471293e6
commit
a6dea41d64
1 changed files with 3 additions and 1 deletions
|
|
@ -37,6 +37,7 @@ use type_of;
|
|||
use rustc::hir;
|
||||
use rustc::ty::{self, Ty};
|
||||
use rustc::ty::layout::{self, Layout, LayoutTyper, TyLayout, Size};
|
||||
use rustc_back::PanicStrategy;
|
||||
|
||||
use libc::c_uint;
|
||||
use std::cmp;
|
||||
|
|
@ -761,7 +762,8 @@ impl<'a, 'tcx> FnType<'tcx> {
|
|||
let is_freeze = ccx.shared().type_is_freeze(mt.ty);
|
||||
|
||||
let no_alias_is_safe =
|
||||
if ccx.shared().tcx().sess.opts.debugging_opts.mutable_noalias {
|
||||
if ccx.shared().tcx().sess.opts.debugging_opts.mutable_noalias ||
|
||||
ccx.shared().tcx().sess.panic_strategy() == PanicStrategy::Abort {
|
||||
// Mutable refrences or immutable shared references
|
||||
mt.mutbl == hir::MutMutable || is_freeze
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue