@@ -1186,7 +1186,11 @@ impl<'tcx> TyCtxt<'tcx> {
11861186 } ;
11871187 debug ! ( "layout_scalar_valid_range: attr={:?}" , attr) ;
11881188 if let Some (
1189- & [ ast:: NestedMetaItem :: Literal ( ast:: Lit { kind : ast:: LitKind :: Int ( a, _) , .. } ) ] ,
1189+ & [
1190+ ast:: NestedMetaItem :: Literal ( ast:: Lit {
1191+ kind : ast:: LitKind :: Int ( a, _) , ..
1192+ } ) ,
1193+ ] ,
11901194 ) = attr. meta_item_list ( ) . as_deref ( )
11911195 {
11921196 Bound :: Included ( a)
@@ -1659,7 +1663,7 @@ macro_rules! nop_lift {
16591663 impl <' a, ' tcx> Lift <' tcx> for $ty {
16601664 type Lifted = $lifted;
16611665 fn lift_to_tcx( self , tcx: TyCtxt <' tcx>) -> Option <Self :: Lifted > {
1662- if tcx. interners. $set. contains_pointer_to( & InternedInSet ( & * self . 0 . 0 ) ) {
1666+ if tcx. interners. $set. contains_pointer_to( & InternedInSet ( & * self . 0.0 ) ) {
16631667 // SAFETY: `self` is interned and therefore valid
16641668 // for the entire lifetime of the `TyCtxt`.
16651669 Some ( unsafe { mem:: transmute( self ) } )
@@ -2244,11 +2248,7 @@ impl<'tcx> TyCtxt<'tcx> {
22442248 /// `*r == kind`.
22452249 #[ inline]
22462250 pub fn reuse_or_mk_region ( self , r : Region < ' tcx > , kind : RegionKind ) -> Region < ' tcx > {
2247- if * r == kind {
2248- r
2249- } else {
2250- self . mk_region ( kind)
2251- }
2251+ if * r == kind { r } else { self . mk_region ( kind) }
22522252 }
22532253
22542254 #[ allow( rustc:: usage_of_ty_tykind) ]
@@ -2268,11 +2268,7 @@ impl<'tcx> TyCtxt<'tcx> {
22682268 pred : Predicate < ' tcx > ,
22692269 binder : Binder < ' tcx , PredicateKind < ' tcx > > ,
22702270 ) -> Predicate < ' tcx > {
2271- if pred. kind ( ) != binder {
2272- self . mk_predicate ( binder)
2273- } else {
2274- pred
2275- }
2271+ if pred. kind ( ) != binder { self . mk_predicate ( binder) } else { pred }
22762272 }
22772273
22782274 pub fn mk_mach_int ( self , tm : IntTy ) -> Ty < ' tcx > {
@@ -2417,11 +2413,7 @@ impl<'tcx> TyCtxt<'tcx> {
24172413
24182414 #[ inline]
24192415 pub fn mk_diverging_default ( self ) -> Ty < ' tcx > {
2420- if self . features ( ) . never_type_fallback {
2421- self . types . never
2422- } else {
2423- self . types . unit
2424- }
2416+ if self . features ( ) . never_type_fallback { self . types . never } else { self . types . unit }
24252417 }
24262418
24272419 #[ inline]
@@ -2572,9 +2564,11 @@ impl<'tcx> TyCtxt<'tcx> {
25722564 eps : & [ ty:: Binder < ' tcx , ExistentialPredicate < ' tcx > > ] ,
25732565 ) -> & ' tcx List < ty:: Binder < ' tcx , ExistentialPredicate < ' tcx > > > {
25742566 assert ! ( !eps. is_empty( ) ) ;
2575- assert ! ( eps
2576- . array_windows( )
2577- . all( |[ a, b] | a. skip_binder( ) . stable_cmp( self , & b. skip_binder( ) ) != Ordering :: Greater ) ) ;
2567+ assert ! (
2568+ eps. array_windows( )
2569+ . all( |[ a, b] | a. skip_binder( ) . stable_cmp( self , & b. skip_binder( ) )
2570+ != Ordering :: Greater )
2571+ ) ;
25782572 self . _intern_poly_existential_predicates ( eps)
25792573 }
25802574
@@ -2607,49 +2601,29 @@ impl<'tcx> TyCtxt<'tcx> {
26072601 }
26082602
26092603 pub fn intern_substs ( self , ts : & [ GenericArg < ' tcx > ] ) -> & ' tcx List < GenericArg < ' tcx > > {
2610- if ts. is_empty ( ) {
2611- List :: empty ( )
2612- } else {
2613- self . _intern_substs ( ts)
2614- }
2604+ if ts. is_empty ( ) { List :: empty ( ) } else { self . _intern_substs ( ts) }
26152605 }
26162606
26172607 pub fn intern_projs ( self , ps : & [ ProjectionKind ] ) -> & ' tcx List < ProjectionKind > {
2618- if ps. is_empty ( ) {
2619- List :: empty ( )
2620- } else {
2621- self . _intern_projs ( ps)
2622- }
2608+ if ps. is_empty ( ) { List :: empty ( ) } else { self . _intern_projs ( ps) }
26232609 }
26242610
26252611 pub fn intern_place_elems ( self , ts : & [ PlaceElem < ' tcx > ] ) -> & ' tcx List < PlaceElem < ' tcx > > {
2626- if ts. is_empty ( ) {
2627- List :: empty ( )
2628- } else {
2629- self . _intern_place_elems ( ts)
2630- }
2612+ if ts. is_empty ( ) { List :: empty ( ) } else { self . _intern_place_elems ( ts) }
26312613 }
26322614
26332615 pub fn intern_canonical_var_infos (
26342616 self ,
26352617 ts : & [ CanonicalVarInfo < ' tcx > ] ,
26362618 ) -> CanonicalVarInfos < ' tcx > {
2637- if ts. is_empty ( ) {
2638- List :: empty ( )
2639- } else {
2640- self . _intern_canonical_var_infos ( ts)
2641- }
2619+ if ts. is_empty ( ) { List :: empty ( ) } else { self . _intern_canonical_var_infos ( ts) }
26422620 }
26432621
26442622 pub fn intern_bound_variable_kinds (
26452623 self ,
26462624 ts : & [ ty:: BoundVariableKind ] ,
26472625 ) -> & ' tcx List < ty:: BoundVariableKind > {
2648- if ts. is_empty ( ) {
2649- List :: empty ( )
2650- } else {
2651- self . _intern_bound_variable_kinds ( ts)
2652- }
2626+ if ts. is_empty ( ) { List :: empty ( ) } else { self . _intern_bound_variable_kinds ( ts) }
26532627 }
26542628
26552629 pub fn mk_fn_sig < I > (
0 commit comments