Skip to content

Commit 6d8bf2a

Browse files
committed
Reorder match arm for picking glue strategy for tuples
1 parent 2752229 commit 6d8bf2a

File tree

1 file changed

+3
-2
lines changed
  • compiler/rustc_mir_transform/src

1 file changed

+3
-2
lines changed

compiler/rustc_mir_transform/src/shim.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,7 +1125,8 @@ fn build_async_destructor_ctor_shim<'tcx>(
11251125
GlueStrategy::Slice { is_array: matches!(kind, ty::Array(..)), elem_ty }
11261126
}
11271127

1128-
ty::Tuple(elem_tys) if !elem_tys.is_empty() => {
1128+
ty::Tuple(elem_tys) if elem_tys.is_empty() => GlueStrategy::Empty,
1129+
ty::Tuple(elem_tys) => {
11291130
GlueStrategy::Chain { elem_tys, has_surface_async_drop: false }
11301131
}
11311132
ty::Adt(adt_def, args) if adt_def.is_struct() => {
@@ -1139,6 +1140,7 @@ fn build_async_destructor_ctor_shim<'tcx>(
11391140
}
11401141

11411142
ty::Foreign(_)
1143+
// TODO: implement enums, disallow unions
11421144
| ty::Adt(_, _)
11431145
| ty::Dynamic(_, _, _)
11441146
| ty::Closure(_, _)
@@ -1169,7 +1171,6 @@ fn build_async_destructor_ctor_shim<'tcx>(
11691171
| ty::FnDef(_, _)
11701172
| ty::FnPtr(_)
11711173
| ty::Never
1172-
| ty::Tuple(_) => GlueStrategy::Empty,
11731174
};
11741175

11751176
let return_bb;

0 commit comments

Comments
 (0)