Skip to content

Commit

Permalink
Remove unsound-mir-opts for simplify_aggregate_to_copy
Browse files Browse the repository at this point in the history
  • Loading branch information
DianQK committed Dec 4, 2024
1 parent 0171927 commit be36b65
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 1 addition & 3 deletions compiler/rustc_mir_transform/src/gvn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1081,9 +1081,7 @@ impl<'body, 'tcx> VnState<'body, 'tcx> {
}
}

// unsound: https://github.com/rust-lang/rust/issues/132353
if tcx.sess.opts.unstable_opts.unsound_mir_opts
&& let AggregateTy::Def(_, _) = ty
if let AggregateTy::Def(_, _) = ty
&& let Some(value) =
self.simplify_aggregate_to_copy(rvalue, location, &fields, variant_index)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ fn old(_1: Result<T, E>) -> Result<T, E> {
}

bb1: {
_3 = move ((_1 as Ok).0: T);
_0 = Result::<T, E>::Ok(copy _3);
_3 = copy ((_1 as Ok).0: T);
_0 = copy _1;
goto -> bb3;
}

bb2: {
_4 = move ((_1 as Err).0: E);
_0 = Result::<T, E>::Err(copy _4);
_4 = copy ((_1 as Err).0: E);
_0 = copy _1;
goto -> bb3;
}

Expand Down

0 comments on commit be36b65

Please sign in to comment.