@@ -1051,17 +1051,15 @@ fn should_encode_mir(
1051
1051
// Coroutines require optimized MIR to compute layout.
1052
1052
DefKind :: Closure if tcx. is_coroutine ( def_id. to_def_id ( ) ) => ( false , true ) ,
1053
1053
// Full-fledged functions + closures
1054
- def_kind @ ( DefKind :: AssocFn | DefKind :: Fn | DefKind :: Closure ) => {
1054
+ DefKind :: AssocFn | DefKind :: Fn | DefKind :: Closure => {
1055
1055
let generics = tcx. generics_of ( def_id) ;
1056
1056
let mut opt = tcx. sess . opts . unstable_opts . always_encode_mir
1057
1057
|| ( tcx. sess . opts . output_types . should_codegen ( )
1058
1058
&& reachable_set. contains ( & def_id)
1059
1059
&& ( generics. requires_monomorphization ( tcx)
1060
1060
|| tcx. cross_crate_inlinable ( def_id) ) ) ;
1061
- if matches ! ( def_kind, DefKind :: AssocFn | DefKind :: Fn ) {
1062
- if let Some ( intrinsic) = tcx. intrinsic ( def_id) {
1063
- opt &= !intrinsic. must_be_overridden ;
1064
- }
1061
+ if let Some ( intrinsic) = tcx. intrinsic ( def_id) {
1062
+ opt &= !intrinsic. must_be_overridden ;
1065
1063
}
1066
1064
// The function has a `const` modifier or is in a `#[const_trait]`.
1067
1065
let is_const_fn = tcx. is_const_fn_raw ( def_id. to_def_id ( ) )
@@ -1414,9 +1412,9 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
1414
1412
if let DefKind :: Fn | DefKind :: AssocFn = def_kind {
1415
1413
self . tables . asyncness . set_some ( def_id. index , tcx. asyncness ( def_id) ) ;
1416
1414
record_array ! ( self . tables. fn_arg_names[ def_id] <- tcx. fn_arg_names( def_id) ) ;
1417
- if let Some ( name ) = tcx . intrinsic ( def_id ) {
1418
- record ! ( self . tables . intrinsic[ def_id] <- name ) ;
1419
- }
1415
+ }
1416
+ if let Some ( name ) = tcx . intrinsic ( def_id) {
1417
+ record ! ( self . tables . intrinsic [ def_id ] <- name ) ;
1420
1418
}
1421
1419
if let DefKind :: TyParam = def_kind {
1422
1420
let default = self . tcx . object_lifetime_default ( def_id) ;
0 commit comments