Skip to content

Commit be36b65

Browse files
committed
Remove unsound-mir-opts for simplify_aggregate_to_copy
1 parent 0171927 commit be36b65

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

compiler/rustc_mir_transform/src/gvn.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1081,9 +1081,7 @@ impl<'body, 'tcx> VnState<'body, 'tcx> {
10811081
}
10821082
}
10831083

1084-
// unsound: https://github.com/rust-lang/rust/issues/132353
1085-
if tcx.sess.opts.unstable_opts.unsound_mir_opts
1086-
&& let AggregateTy::Def(_, _) = ty
1084+
if let AggregateTy::Def(_, _) = ty
10871085
&& let Some(value) =
10881086
self.simplify_aggregate_to_copy(rvalue, location, &fields, variant_index)
10891087
{

tests/mir-opt/pre-codegen/try_identity.old.PreCodegen.after.mir

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ fn old(_1: Result<T, E>) -> Result<T, E> {
1919
}
2020

2121
bb1: {
22-
_3 = move ((_1 as Ok).0: T);
23-
_0 = Result::<T, E>::Ok(copy _3);
22+
_3 = copy ((_1 as Ok).0: T);
23+
_0 = copy _1;
2424
goto -> bb3;
2525
}
2626

2727
bb2: {
28-
_4 = move ((_1 as Err).0: E);
29-
_0 = Result::<T, E>::Err(copy _4);
28+
_4 = copy ((_1 as Err).0: E);
29+
_0 = copy _1;
3030
goto -> bb3;
3131
}
3232

0 commit comments

Comments
 (0)