Skip to content

Commit 8672700

Browse files
committed
Remove redundant nested array checks
Already checked by 8093f11 - ignore arrays in operands
1 parent 3abc321 commit 8672700

File tree

1 file changed

+1
-15
lines changed
  • compiler/rustc_mir_transform/src

1 file changed

+1
-15
lines changed

compiler/rustc_mir_transform/src/gvn.rs

+1-15
Original file line numberDiff line numberDiff line change
@@ -383,15 +383,6 @@ impl<'body, 'tcx> VnState<'body, 'tcx> {
383383
AggregateTy::Array => {
384384
assert!(fields.len() > 0);
385385
let field_ty = fields[0].layout.ty;
386-
// FIXME: Ignore nested arrays, because arrays is large. Nested arrays are rarer and bigger
387-
// while we already process 1-dimension arrays, which is enough?
388-
if field_ty.is_array() {
389-
trace!(
390-
"ignoring nested array of type: [{field_ty}; {len}]",
391-
len = fields.len(),
392-
);
393-
return None;
394-
}
395386
Ty::new_array(self.tcx, field_ty, fields.len() as u64)
396387
}
397388
AggregateTy::Tuple => {
@@ -899,13 +890,8 @@ impl<'body, 'tcx> VnState<'body, 'tcx> {
899890
}
900891

901892
let (mut ty, variant_index) = match *kind {
902-
AggregateKind::Array(ty) => {
893+
AggregateKind::Array(_) => {
903894
assert!(!field_ops.is_empty());
904-
// FIXME: Ignore nested arrays, because arrays is large. Nested arrays are rarer and bigger
905-
// while we already process 1-dimension arrays, which is enough?
906-
if ty.is_array() {
907-
return None;
908-
}
909895
(AggregateTy::Array, FIRST_VARIANT)
910896
}
911897
AggregateKind::Tuple => {

0 commit comments

Comments
 (0)