Skip to content

Commit fb5ed72

Browse files
committed
Auto merge of #119174 - compiler-errors:movability, r=cjgillot
Remove movability from `TyKind::Coroutine` There's no reason to store movability in the generator struct directly. It is computed from the HIR, and can be pulled into a query to access when necessary.
2 parents 3ee6710 + e24da8e commit fb5ed72

File tree

76 files changed

+195
-223
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+195
-223
lines changed

compiler/rustc_borrowck/src/diagnostics/mod.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
370370
ty::Array(ty, _) | ty::Slice(ty) => {
371371
self.describe_field_from_ty(ty, field, variant_index, including_tuple_field)
372372
}
373-
ty::Closure(def_id, _) | ty::Coroutine(def_id, _, _) => {
373+
ty::Closure(def_id, _) | ty::Coroutine(def_id, _) => {
374374
// We won't be borrowck'ing here if the closure came from another crate,
375375
// so it's safe to call `expect_local`.
376376
//
@@ -792,8 +792,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
792792

793793
debug!("move_spans: moved_place={:?} location={:?} stmt={:?}", moved_place, location, stmt);
794794
if let StatementKind::Assign(box (_, Rvalue::Aggregate(kind, places))) = &stmt.kind
795-
&& let AggregateKind::Closure(def_id, _) | AggregateKind::Coroutine(def_id, _, _) =
796-
**kind
795+
&& let AggregateKind::Closure(def_id, _) | AggregateKind::Coroutine(def_id, _) = **kind
797796
{
798797
debug!("move_spans: def_id={:?} places={:?}", def_id, places);
799798
let def_id = def_id.expect_local();
@@ -928,7 +927,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
928927
if let StatementKind::Assign(box (_, Rvalue::Aggregate(kind, places))) = &stmt.kind {
929928
let (&def_id, is_coroutine) = match kind {
930929
box AggregateKind::Closure(def_id, _) => (def_id, false),
931-
box AggregateKind::Coroutine(def_id, _, _) => (def_id, true),
930+
box AggregateKind::Coroutine(def_id, _) => (def_id, true),
932931
_ => continue,
933932
};
934933
let def_id = def_id.expect_local();

compiler/rustc_borrowck/src/lib.rs

+7-6
Original file line numberDiff line numberDiff line change
@@ -274,11 +274,12 @@ fn do_mir_borrowck<'tcx>(
274274
// The first argument is the coroutine type passed by value
275275
if let Some(local) = body.local_decls.raw.get(1)
276276
// Get the interior types and args which typeck computed
277-
&& let ty::Coroutine(_, _, hir::Movability::Static) = local.ty.kind()
277+
&& let ty::Coroutine(def_id, _) = *local.ty.kind()
278+
&& tcx.coroutine_movability(def_id) == hir::Movability::Movable
278279
{
279-
false
280-
} else {
281280
true
281+
} else {
282+
false
282283
};
283284

284285
for (idx, move_data) in promoted_move_data {
@@ -1306,7 +1307,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
13061307
// moved into the closure and subsequently used by the closure,
13071308
// in order to populate our used_mut set.
13081309
match **aggregate_kind {
1309-
AggregateKind::Closure(def_id, _) | AggregateKind::Coroutine(def_id, _, _) => {
1310+
AggregateKind::Closure(def_id, _) | AggregateKind::Coroutine(def_id, _) => {
13101311
let def_id = def_id.expect_local();
13111312
let BorrowCheckResult { used_mut_upvars, .. } =
13121313
self.infcx.tcx.mir_borrowck(def_id);
@@ -1612,7 +1613,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
16121613
| ty::FnPtr(_)
16131614
| ty::Dynamic(_, _, _)
16141615
| ty::Closure(_, _)
1615-
| ty::Coroutine(_, _, _)
1616+
| ty::Coroutine(_, _)
16161617
| ty::CoroutineWitness(..)
16171618
| ty::Never
16181619
| ty::Tuple(_)
@@ -1636,7 +1637,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
16361637
return;
16371638
}
16381639
}
1639-
ty::Closure(_, _) | ty::Coroutine(_, _, _) | ty::Tuple(_) => (),
1640+
ty::Closure(_, _) | ty::Coroutine(_, _) | ty::Tuple(_) => (),
16401641
ty::Bool
16411642
| ty::Char
16421643
| ty::Int(_)

compiler/rustc_borrowck/src/type_check/mod.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ impl<'a, 'b, 'tcx> TypeVerifier<'a, 'b, 'tcx> {
762762
let (variant, args) = match base_ty {
763763
PlaceTy { ty, variant_index: Some(variant_index) } => match *ty.kind() {
764764
ty::Adt(adt_def, args) => (adt_def.variant(variant_index), args),
765-
ty::Coroutine(def_id, args, _) => {
765+
ty::Coroutine(def_id, args) => {
766766
let mut variants = args.as_coroutine().state_tys(def_id, tcx);
767767
let Some(mut variant) = variants.nth(variant_index.into()) else {
768768
bug!(
@@ -790,7 +790,7 @@ impl<'a, 'b, 'tcx> TypeVerifier<'a, 'b, 'tcx> {
790790
}),
791791
};
792792
}
793-
ty::Coroutine(_, args, _) => {
793+
ty::Coroutine(_, args) => {
794794
// Only prefix fields (upvars and current state) are
795795
// accessible without a variant index.
796796
return match args.as_coroutine().prefix_tys().get(field.index()) {
@@ -1784,7 +1784,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
17841784
}),
17851785
}
17861786
}
1787-
AggregateKind::Coroutine(_, args, _) => {
1787+
AggregateKind::Coroutine(_, args) => {
17881788
// It doesn't make sense to look at a field beyond the prefix;
17891789
// these require a variant index, and are not initialized in
17901790
// aggregate rvalues.
@@ -2392,7 +2392,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
23922392
AggregateKind::Array(_) => None,
23932393
AggregateKind::Tuple => None,
23942394
AggregateKind::Closure(_, _) => None,
2395-
AggregateKind::Coroutine(_, _, _) => None,
2395+
AggregateKind::Coroutine(_, _) => None,
23962396
},
23972397
}
23982398
}
@@ -2620,7 +2620,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
26202620
// desugaring. A closure gets desugared to a struct, and
26212621
// these extra requirements are basically like where
26222622
// clauses on the struct.
2623-
AggregateKind::Closure(def_id, args) | AggregateKind::Coroutine(def_id, args, _) => {
2623+
AggregateKind::Closure(def_id, args) | AggregateKind::Coroutine(def_id, args) => {
26242624
(def_id, self.prove_closure_bounds(tcx, def_id.expect_local(), args, location))
26252625
}
26262626

compiler/rustc_borrowck/src/universal_regions.rs

+8-11
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
1515
use rustc_data_structures::fx::FxHashMap;
1616
use rustc_errors::Diagnostic;
17-
use rustc_hir as hir;
1817
use rustc_hir::def_id::{DefId, LocalDefId};
1918
use rustc_hir::lang_items::LangItem;
2019
use rustc_hir::BodyOwnerKind;
@@ -94,7 +93,7 @@ pub enum DefiningTy<'tcx> {
9493
/// The MIR is a coroutine. The signature is that coroutines take
9594
/// no parameters and return the result of
9695
/// `ClosureArgs::coroutine_return_ty`.
97-
Coroutine(DefId, GenericArgsRef<'tcx>, hir::Movability),
96+
Coroutine(DefId, GenericArgsRef<'tcx>),
9897

9998
/// The MIR is a fn item with the given `DefId` and args. The signature
10099
/// of the function can be bound then with the `fn_sig` query.
@@ -118,7 +117,7 @@ impl<'tcx> DefiningTy<'tcx> {
118117
pub fn upvar_tys(self) -> &'tcx ty::List<Ty<'tcx>> {
119118
match self {
120119
DefiningTy::Closure(_, args) => args.as_closure().upvar_tys(),
121-
DefiningTy::Coroutine(_, args, _) => args.as_coroutine().upvar_tys(),
120+
DefiningTy::Coroutine(_, args) => args.as_coroutine().upvar_tys(),
122121
DefiningTy::FnDef(..) | DefiningTy::Const(..) | DefiningTy::InlineConst(..) => {
123122
ty::List::empty()
124123
}
@@ -354,7 +353,7 @@ impl<'tcx> UniversalRegions<'tcx> {
354353
err.note(format!("late-bound region is {:?}", self.to_region_vid(r)));
355354
});
356355
}
357-
DefiningTy::Coroutine(def_id, args, _) => {
356+
DefiningTy::Coroutine(def_id, args) => {
358357
let v = with_no_trimmed_paths!(
359358
args[tcx.generics_of(def_id).parent_count..]
360359
.iter()
@@ -527,7 +526,7 @@ impl<'cx, 'tcx> UniversalRegionsBuilder<'cx, 'tcx> {
527526
debug!("build: local regions = {}..{}", first_local_index, num_universals);
528527

529528
let yield_ty = match defining_ty {
530-
DefiningTy::Coroutine(_, args, _) => Some(args.as_coroutine().yield_ty()),
529+
DefiningTy::Coroutine(_, args) => Some(args.as_coroutine().yield_ty()),
531530
_ => None,
532531
};
533532

@@ -562,9 +561,7 @@ impl<'cx, 'tcx> UniversalRegionsBuilder<'cx, 'tcx> {
562561

563562
match *defining_ty.kind() {
564563
ty::Closure(def_id, args) => DefiningTy::Closure(def_id, args),
565-
ty::Coroutine(def_id, args, movability) => {
566-
DefiningTy::Coroutine(def_id, args, movability)
567-
}
564+
ty::Coroutine(def_id, args) => DefiningTy::Coroutine(def_id, args),
568565
ty::FnDef(def_id, args) => DefiningTy::FnDef(def_id, args),
569566
_ => span_bug!(
570567
tcx.def_span(self.mir_def),
@@ -620,7 +617,7 @@ impl<'cx, 'tcx> UniversalRegionsBuilder<'cx, 'tcx> {
620617
let identity_args = GenericArgs::identity_for_item(tcx, typeck_root_def_id);
621618
let fr_args = match defining_ty {
622619
DefiningTy::Closure(_, args)
623-
| DefiningTy::Coroutine(_, args, _)
620+
| DefiningTy::Coroutine(_, args)
624621
| DefiningTy::InlineConst(_, args) => {
625622
// In the case of closures, we rely on the fact that
626623
// the first N elements in the ClosureArgs are
@@ -685,11 +682,11 @@ impl<'cx, 'tcx> UniversalRegionsBuilder<'cx, 'tcx> {
685682
)
686683
}
687684

688-
DefiningTy::Coroutine(def_id, args, movability) => {
685+
DefiningTy::Coroutine(def_id, args) => {
689686
assert_eq!(self.mir_def.to_def_id(), def_id);
690687
let resume_ty = args.as_coroutine().resume_ty();
691688
let output = args.as_coroutine().return_ty();
692-
let coroutine_ty = Ty::new_coroutine(tcx, def_id, args, movability);
689+
let coroutine_ty = Ty::new_coroutine(tcx, def_id, args);
693690
let inputs_and_output =
694691
self.infcx.tcx.mk_type_list(&[coroutine_ty, resume_ty, output]);
695692
ty::Binder::dummy(inputs_and_output)

compiler/rustc_codegen_cranelift/src/value_and_place.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -974,8 +974,8 @@ pub(crate) fn assert_assignable<'tcx>(
974974
}
975975
}
976976
}
977-
(&ty::Coroutine(def_id_a, args_a, mov_a), &ty::Coroutine(def_id_b, args_b, mov_b))
978-
if def_id_a == def_id_b && mov_a == mov_b =>
977+
(&ty::Coroutine(def_id_a, args_a), &ty::Coroutine(def_id_b, args_b))
978+
if def_id_a == def_id_b =>
979979
{
980980
let mut types_a = args_a.types();
981981
let mut types_b = args_b.types();

compiler/rustc_codegen_gcc/src/type_of.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ fn uncached_gcc_type<'gcc, 'tcx>(cx: &CodegenCx<'gcc, 'tcx>, layout: TyAndLayout
9898
write!(&mut name, "::{}", def.variant(index).name).unwrap();
9999
}
100100
}
101-
if let (&ty::Coroutine(_, _, _), &Variants::Single { index }) =
101+
if let (&ty::Coroutine(_, _), &Variants::Single { index }) =
102102
(layout.ty.kind(), &layout.variants)
103103
{
104104
write!(&mut name, "::{}", ty::CoroutineArgs::variant_name(index)).unwrap();

compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1066,7 +1066,7 @@ fn build_upvar_field_di_nodes<'ll, 'tcx>(
10661066
closure_or_coroutine_di_node: &'ll DIType,
10671067
) -> SmallVec<&'ll DIType> {
10681068
let (&def_id, up_var_tys) = match closure_or_coroutine_ty.kind() {
1069-
ty::Coroutine(def_id, args, _) => (def_id, args.as_coroutine().prefix_tys()),
1069+
ty::Coroutine(def_id, args) => (def_id, args.as_coroutine().prefix_tys()),
10701070
ty::Closure(def_id, args) => (def_id, args.as_closure().upvar_tys()),
10711071
_ => {
10721072
bug!(

compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/cpp_like.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ fn build_union_fields_for_direct_tag_coroutine<'ll, 'tcx>(
679679
};
680680

681681
let (coroutine_def_id, coroutine_args) = match coroutine_type_and_layout.ty.kind() {
682-
&ty::Coroutine(def_id, args, _) => (def_id, args.as_coroutine()),
682+
&ty::Coroutine(def_id, args) => (def_id, args.as_coroutine()),
683683
_ => unreachable!(),
684684
};
685685

compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ pub fn build_coroutine_variant_struct_type_di_node<'ll, 'tcx>(
336336
let variant_layout = coroutine_type_and_layout.for_variant(cx, variant_index);
337337

338338
let coroutine_args = match coroutine_type_and_layout.ty.kind() {
339-
ty::Coroutine(_, args, _) => args.as_coroutine(),
339+
ty::Coroutine(_, args) => args.as_coroutine(),
340340
_ => unreachable!(),
341341
};
342342

compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/native.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ pub(super) fn build_coroutine_di_node<'ll, 'tcx>(
135135
unique_type_id: UniqueTypeId<'tcx>,
136136
) -> DINodeCreationResult<'ll> {
137137
let coroutine_type = unique_type_id.expect_ty();
138-
let &ty::Coroutine(coroutine_def_id, _, _) = coroutine_type.kind() else {
138+
let &ty::Coroutine(coroutine_def_id, _) = coroutine_type.kind() else {
139139
bug!("build_coroutine_di_node() called with non-coroutine type: `{:?}`", coroutine_type)
140140
};
141141

compiler/rustc_codegen_llvm/src/type_of.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ fn uncached_llvm_type<'a, 'tcx>(
5454
write!(&mut name, "::{}", def.variant(index).name).unwrap();
5555
}
5656
}
57-
if let (&ty::Coroutine(_, _, _), &Variants::Single { index }) =
57+
if let (&ty::Coroutine(_, _), &Variants::Single { index }) =
5858
(layout.ty.kind(), &layout.variants)
5959
{
6060
write!(&mut name, "::{}", ty::CoroutineArgs::variant_name(index)).unwrap();

compiler/rustc_const_eval/src/interpret/discriminant.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
171171
ty::Adt(adt, _) => {
172172
adt.discriminants(*self.tcx).find(|(_, var)| var.val == discr_bits)
173173
}
174-
ty::Coroutine(def_id, args, _) => {
174+
ty::Coroutine(def_id, args) => {
175175
let args = args.as_coroutine();
176176
args.discriminants(def_id, *self.tcx).find(|(_, var)| var.val == discr_bits)
177177
}

compiler/rustc_const_eval/src/interpret/intrinsics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ pub(crate) fn eval_nullary_intrinsic<'tcx>(
8585
| ty::FnPtr(_)
8686
| ty::Dynamic(_, _, _)
8787
| ty::Closure(_, _)
88-
| ty::Coroutine(_, _, _)
88+
| ty::Coroutine(_, _)
8989
| ty::CoroutineWitness(..)
9090
| ty::Never
9191
| ty::Tuple(_)

compiler/rustc_const_eval/src/interpret/validity.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
217217
// Now we know we are projecting to a field, so figure out which one.
218218
match layout.ty.kind() {
219219
// coroutines and closures.
220-
ty::Closure(def_id, _) | ty::Coroutine(def_id, _, _) => {
220+
ty::Closure(def_id, _) | ty::Coroutine(def_id, _) => {
221221
let mut name = None;
222222
// FIXME this should be more descriptive i.e. CapturePlace instead of CapturedVar
223223
// https://github.com/rust-lang/project-rfc-2229/issues/46

compiler/rustc_const_eval/src/transform/validate.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
694694
};
695695
check_equal(self, location, f_ty);
696696
}
697-
&ty::Coroutine(def_id, args, _) => {
697+
&ty::Coroutine(def_id, args) => {
698698
let f_ty = if let Some(var) = parent_ty.variant_index {
699699
let gen_body = if def_id == self.body.source.def_id() {
700700
self.body

compiler/rustc_const_eval/src/util/type_name.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ impl<'tcx> Printer<'tcx> for AbsolutePathPrinter<'tcx> {
5151
| ty::FnDef(def_id, args)
5252
| ty::Alias(ty::Projection | ty::Opaque, ty::AliasTy { def_id, args, .. })
5353
| ty::Closure(def_id, args)
54-
| ty::Coroutine(def_id, args, _) => self.print_def_path(def_id, args),
54+
| ty::Coroutine(def_id, args) => self.print_def_path(def_id, args),
5555
ty::Foreign(def_id) => self.print_def_path(def_id, &[]),
5656

5757
ty::Alias(ty::Weak, _) => bug!("type_name: unexpected weak projection"),

compiler/rustc_hir_typeck/src/check.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,7 @@ pub(super) fn check_fn<'a, 'tcx>(
160160
));
161161

162162
let (resume_ty, yield_ty) = fcx.resume_yield_tys.unwrap();
163-
Some(CoroutineTypes {
164-
resume_ty,
165-
yield_ty,
166-
interior,
167-
movability: coroutine_kind.movability(),
168-
})
163+
Some(CoroutineTypes { resume_ty, yield_ty, interior })
169164
} else {
170165
None
171166
};

compiler/rustc_hir_typeck/src/closure.rs

+2-8
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
105105
span: self.tcx.def_span(expr_def_id),
106106
});
107107

108-
if let Some(CoroutineTypes { resume_ty, yield_ty, interior, movability }) = coroutine_types
109-
{
108+
if let Some(CoroutineTypes { resume_ty, yield_ty, interior }) = coroutine_types {
110109
let coroutine_args = ty::CoroutineArgs::new(
111110
self.tcx,
112111
ty::CoroutineArgsParts {
@@ -119,12 +118,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
119118
},
120119
);
121120

122-
return Ty::new_coroutine(
123-
self.tcx,
124-
expr_def_id.to_def_id(),
125-
coroutine_args.args,
126-
movability,
127-
);
121+
return Ty::new_coroutine(self.tcx, expr_def_id.to_def_id(), coroutine_args.args);
128122
}
129123

130124
// Tuple up the arguments and insert the resulting function type into

compiler/rustc_hir_typeck/src/lib.rs

-3
Original file line numberDiff line numberDiff line change
@@ -304,9 +304,6 @@ struct CoroutineTypes<'tcx> {
304304

305305
/// Types that are captured (see `CoroutineInterior` for more).
306306
interior: Ty<'tcx>,
307-
308-
/// Indicates if the coroutine is movable or static (immovable).
309-
movability: hir::Movability,
310307
}
311308

312309
#[derive(Copy, Clone, Debug, PartialEq, Eq)]

compiler/rustc_hir_typeck/src/upvar.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
172172
let ty = self.node_ty(closure_hir_id);
173173
let (closure_def_id, args) = match *ty.kind() {
174174
ty::Closure(def_id, args) => (def_id, UpvarArgs::Closure(args)),
175-
ty::Coroutine(def_id, args, _) => (def_id, UpvarArgs::Coroutine(args)),
175+
ty::Coroutine(def_id, args) => (def_id, UpvarArgs::Coroutine(args)),
176176
ty::Error(_) => {
177177
// #51714: skip analysis when we have already encountered type errors
178178
return;

compiler/rustc_infer/src/infer/opaque_types.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ where
456456
args.as_closure().sig_as_fn_ptr_ty().visit_with(self);
457457
}
458458

459-
ty::Coroutine(_, args, _) => {
459+
ty::Coroutine(_, args) => {
460460
// Skip lifetime parameters of the enclosing item(s)
461461
// Also skip the witness type, because that has no free regions.
462462

compiler/rustc_infer/src/infer/outlives/components.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ fn compute_components<'tcx>(
103103
compute_components(tcx, tupled_ty, out, visited);
104104
}
105105

106-
ty::Coroutine(_, args, _) => {
106+
ty::Coroutine(_, args) => {
107107
// Same as the closure case
108108
let tupled_ty = args.as_coroutine().tupled_upvars_ty();
109109
compute_components(tcx, tupled_ty, out, visited);

compiler/rustc_metadata/src/rmeta/encoder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1444,7 +1444,7 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
14441444
if def_kind == DefKind::Closure
14451445
&& let Some(coroutine_kind) = self.tcx.coroutine_kind(def_id)
14461446
{
1447-
self.tables.coroutine_kind.set(def_id.index, Some(coroutine_kind));
1447+
self.tables.coroutine_kind.set(def_id.index, Some(coroutine_kind))
14481448
}
14491449
if let DefKind::Enum | DefKind::Struct | DefKind::Union = def_kind {
14501450
self.encode_info_for_adt(local_id);

0 commit comments

Comments
 (0)