@@ -1118,18 +1118,16 @@ impl EncodeContext<'a, 'tcx> {
1118
1118
1119
1119
fn encode_optimized_mir ( & mut self , def_id : LocalDefId ) {
1120
1120
debug ! ( "EntryBuilder::encode_mir({:?})" , def_id) ;
1121
- if self . tcx . mir_keys ( LOCAL_CRATE ) . contains ( & def_id) {
1122
- record ! ( self . tables. mir[ def_id. to_def_id( ) ] <- self . tcx. optimized_mir( def_id) ) ;
1121
+ record ! ( self . tables. mir[ def_id. to_def_id( ) ] <- self . tcx. optimized_mir( def_id) ) ;
1123
1122
1124
- let unused = self . tcx . unused_generic_params ( def_id) ;
1125
- if !unused. is_empty ( ) {
1126
- record ! ( self . tables. unused_generic_params[ def_id. to_def_id( ) ] <- unused) ;
1127
- }
1123
+ let unused = self . tcx . unused_generic_params ( def_id) ;
1124
+ if !unused. is_empty ( ) {
1125
+ record ! ( self . tables. unused_generic_params[ def_id. to_def_id( ) ] <- unused) ;
1126
+ }
1128
1127
1129
- let abstract_const = self . tcx . mir_abstract_const ( def_id) ;
1130
- if let Ok ( Some ( abstract_const) ) = abstract_const {
1131
- record ! ( self . tables. mir_abstract_consts[ def_id. to_def_id( ) ] <- abstract_const) ;
1132
- }
1128
+ let abstract_const = self . tcx . mir_abstract_const ( def_id) ;
1129
+ if let Ok ( Some ( abstract_const) ) = abstract_const {
1130
+ record ! ( self . tables. mir_abstract_consts[ def_id. to_def_id( ) ] <- abstract_const) ;
1133
1131
}
1134
1132
}
1135
1133
@@ -1413,8 +1411,10 @@ impl EncodeContext<'a, 'tcx> {
1413
1411
let needs_inline = ( generics. requires_monomorphization ( tcx)
1414
1412
|| tcx. codegen_fn_attrs ( def_id) . requests_inline ( ) )
1415
1413
&& !self . metadata_output_only ( ) ;
1414
+
1415
+ let is_const_fn = sig. header . constness == hir:: Constness :: Const ;
1416
1416
let always_encode_mir = self . tcx . sess . opts . debugging_opts . always_encode_mir ;
1417
- needs_inline || sig . header . constness == hir :: Constness :: Const || always_encode_mir
1417
+ needs_inline || is_const_fn || always_encode_mir
1418
1418
}
1419
1419
_ => false ,
1420
1420
} ;
0 commit comments