Partially revert "Do not unify dereferences in GVN."
This reverts commit 917dd82628
.
This commit is contained in:
parent
7e0463fe93
commit
fefb0dba82
1 changed files with 1 additions and 3 deletions
|
@ -642,9 +642,7 @@ impl<'body, 'tcx> VnState<'body, 'tcx> {
|
|||
let proj = match proj {
|
||||
ProjectionElem::Deref => {
|
||||
let ty = place.ty(self.local_decls, self.tcx).ty;
|
||||
// unsound: https://github.com/rust-lang/rust/issues/130853
|
||||
if self.tcx.sess.opts.unstable_opts.unsound_mir_opts
|
||||
&& let Some(Mutability::Not) = ty.ref_mutability()
|
||||
if let Some(Mutability::Not) = ty.ref_mutability()
|
||||
&& let Some(pointee_ty) = ty.builtin_deref(true)
|
||||
&& pointee_ty.is_freeze(self.tcx, self.typing_env())
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue