@@ -1045,7 +1045,7 @@ fn should_encode_mir(
1045
1045
| DefKind :: Static ( ..)
1046
1046
| DefKind :: Const => ( true , false ) ,
1047
1047
// Coroutines require optimized MIR to compute layout.
1048
- DefKind :: Closure if tcx. is_coroutine ( def_id. to_def_id ( ) ) => ( false , true ) ,
1048
+ DefKind :: Closure if tcx. is_coroutine ( def_id) => ( false , true ) ,
1049
1049
// Full-fledged functions + closures
1050
1050
DefKind :: AssocFn | DefKind :: Fn | DefKind :: Closure => {
1051
1051
let generics = tcx. generics_of ( def_id) ;
@@ -1345,7 +1345,7 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
1345
1345
for local_id in tcx. iter_local_def_id ( ) {
1346
1346
let def_id = local_id. to_def_id ( ) ;
1347
1347
let def_kind = tcx. def_kind ( local_id) ;
1348
- let is_coroutine = def_kind == DefKind :: Closure && tcx. is_coroutine ( def_id ) ;
1348
+ let is_coroutine = def_kind == DefKind :: Closure && tcx. is_coroutine ( local_id ) ;
1349
1349
self . tables . def_kind . set_some ( def_id. index , def_kind) ;
1350
1350
if should_encode_span ( def_kind) {
1351
1351
let def_span = tcx. def_span ( local_id) ;
@@ -1627,7 +1627,7 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
1627
1627
record ! ( self . tables. closure_saved_names_of_captured_variables[ def_id. to_def_id( ) ]
1628
1628
<- tcx. closure_saved_names_of_captured_variables( def_id) ) ;
1629
1629
1630
- if self . tcx . is_coroutine ( def_id. to_def_id ( ) )
1630
+ if self . tcx . is_coroutine ( def_id)
1631
1631
&& let Some ( witnesses) = tcx. mir_coroutine_witnesses ( def_id)
1632
1632
{
1633
1633
record ! ( self . tables. mir_coroutine_witnesses[ def_id. to_def_id( ) ] <- witnesses) ;
@@ -1654,7 +1654,7 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
1654
1654
}
1655
1655
record ! ( self . tables. promoted_mir[ def_id. to_def_id( ) ] <- tcx. promoted_mir( def_id) ) ;
1656
1656
1657
- if self . tcx . is_coroutine ( def_id. to_def_id ( ) )
1657
+ if self . tcx . is_coroutine ( def_id)
1658
1658
&& let Some ( witnesses) = tcx. mir_coroutine_witnesses ( def_id)
1659
1659
{
1660
1660
record ! ( self . tables. mir_coroutine_witnesses[ def_id. to_def_id( ) ] <- witnesses) ;
0 commit comments