Partially revert "Do not unify dereferences in GVN."
This reverts commit 917dd82628.
This commit is contained in:
@@ -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())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user