Mark simplify_aggregate_to_copy mir-opt as unsound

Co-authored-by: DianQK <dianqk@dianqk.net>
This commit is contained in:
许杰友 Jieyou Xu (Joe) 2024-10-30 21:11:37 +08:00
parent 4d8bda335e
commit 10b8ba4ecb
11 changed files with 63 additions and 43 deletions

View file

@ -1082,7 +1082,9 @@ impl<'body, 'tcx> VnState<'body, 'tcx> {
}
}
if let AggregateTy::Def(_, _) = ty
// unsound: https://github.com/rust-lang/rust/issues/132353
if tcx.sess.opts.unstable_opts.unsound_mir_opts
&& let AggregateTy::Def(_, _) = ty
&& let Some(value) =
self.simplify_aggregate_to_copy(rvalue, location, &fields, variant_index)
{