Skip to content

Commit 1f40fa4

Browse files
committed
ignore rvalue not array
1 parent d11c9e2 commit 1f40fa4

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

compiler/rustc_mir_transform/src/promote_consts_local_arrays.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -180,19 +180,14 @@ impl<'tcx> Visitor<'tcx> for Collector<'_, 'tcx> {
180180
fn visit_rvalue(&mut self, rvalue: &Rvalue<'tcx>, location: Location) {
181181
self.super_rvalue(rvalue, location);
182182

183-
let rvalue_ty = rvalue.ty(&self.ccx.body.local_decls, self.ccx.tcx);
184-
if !rvalue_ty.is_array() {
185-
debug!(?rvalue);
186-
}
187-
188183
let Rvalue::Aggregate(kind, operands) = rvalue else {
184+
debug!("ignoring rvalue=`{rvalue:?}`");
189185
return;
190186
};
191187

192-
if let ty::Adt(adt, _) = rvalue_ty.kind()
193-
&& adt.repr().simd()
194-
{
195-
debug!("ignore #[repr(simd)]");
188+
let rvalue_ty = rvalue.ty(&self.ccx.body.local_decls, self.ccx.tcx);
189+
if !rvalue_ty.is_array() {
190+
debug!("ignoring rvalue=`{rvalue:?}`");
196191
if let Some(first) = operands.iter().next()
197192
&& let Operand::Copy(place) | Operand::Move(place) = first
198193
{

0 commit comments

Comments
 (0)