@@ -308,7 +308,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
308
308
& generics,
309
309
id,
310
310
ImplTraitContext :: Disallowed ( ImplTraitPosition :: Generic ) ,
311
- |this| this. lower_ty ( ty, ImplTraitContext :: TypeAliasesOpaqueTy , true ) ,
311
+ |this| this. lower_ty ( ty, ImplTraitContext :: TypeAliasesOpaqueTy ) ,
312
312
) ;
313
313
hir:: ItemKind :: TyAlias ( ty, generics)
314
314
}
@@ -386,15 +386,11 @@ impl<'hir> LoweringContext<'_, 'hir> {
386
386
this. lower_trait_ref (
387
387
trait_ref,
388
388
ImplTraitContext :: Disallowed ( ImplTraitPosition :: Trait ) ,
389
- true ,
390
389
)
391
390
} ) ;
392
391
393
- let lowered_ty = this. lower_ty (
394
- ty,
395
- ImplTraitContext :: Disallowed ( ImplTraitPosition :: Type ) ,
396
- true ,
397
- ) ;
392
+ let lowered_ty = this
393
+ . lower_ty ( ty, ImplTraitContext :: Disallowed ( ImplTraitPosition :: Type ) ) ;
398
394
399
395
( trait_ref, lowered_ty)
400
396
} ) ;
@@ -438,7 +434,6 @@ impl<'hir> LoweringContext<'_, 'hir> {
438
434
let bounds = this. lower_param_bounds (
439
435
bounds,
440
436
ImplTraitContext :: Disallowed ( ImplTraitPosition :: Bound ) ,
441
- true ,
442
437
) ;
443
438
let items = this. arena . alloc_from_iter (
444
439
items. iter ( ) . map ( |item| this. lower_trait_item_ref ( item) ) ,
@@ -458,7 +453,6 @@ impl<'hir> LoweringContext<'_, 'hir> {
458
453
this. lower_param_bounds (
459
454
bounds,
460
455
ImplTraitContext :: Disallowed ( ImplTraitPosition :: Bound ) ,
461
- true ,
462
456
)
463
457
} ,
464
458
) ;
@@ -481,7 +475,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
481
475
span : Span ,
482
476
body : Option < & Expr > ,
483
477
) -> ( & ' hir hir:: Ty < ' hir > , hir:: BodyId ) {
484
- let ty = self . lower_ty ( ty, ImplTraitContext :: Disallowed ( ImplTraitPosition :: Type ) , true ) ;
478
+ let ty = self . lower_ty ( ty, ImplTraitContext :: Disallowed ( ImplTraitPosition :: Type ) ) ;
485
479
( ty, self . lower_const_body ( span, body) )
486
480
}
487
481
@@ -667,11 +661,8 @@ impl<'hir> LoweringContext<'_, 'hir> {
667
661
hir:: ForeignItemKind :: Fn ( fn_dec, fn_args, generics)
668
662
}
669
663
ForeignItemKind :: Static ( ref t, m, _) => {
670
- let ty = self . lower_ty (
671
- t,
672
- ImplTraitContext :: Disallowed ( ImplTraitPosition :: Type ) ,
673
- true ,
674
- ) ;
664
+ let ty =
665
+ self . lower_ty ( t, ImplTraitContext :: Disallowed ( ImplTraitPosition :: Type ) ) ;
675
666
hir:: ForeignItemKind :: Static ( ty, m)
676
667
}
677
668
ForeignItemKind :: TyAlias ( ..) => hir:: ForeignItemKind :: Type ,
@@ -740,11 +731,10 @@ impl<'hir> LoweringContext<'_, 'hir> {
740
731
path,
741
732
ParamMode :: ExplicitNamed , // no `'_` in declarations (Issue #61124)
742
733
ImplTraitContext :: Disallowed ( ImplTraitPosition :: Path ) ,
743
- true ,
744
734
) ;
745
735
self . arena . alloc ( t)
746
736
} else {
747
- self . lower_ty ( & f. ty , ImplTraitContext :: Disallowed ( ImplTraitPosition :: Type ) , true )
737
+ self . lower_ty ( & f. ty , ImplTraitContext :: Disallowed ( ImplTraitPosition :: Type ) )
748
738
} ;
749
739
let hir_id = self . lower_node_id ( f. id ) ;
750
740
self . lower_attrs ( hir_id, & f. attrs ) ;
@@ -767,8 +757,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
767
757
768
758
let ( generics, kind, has_default) = match i. kind {
769
759
AssocItemKind :: Const ( _, ref ty, ref default) => {
770
- let ty =
771
- self . lower_ty ( ty, ImplTraitContext :: Disallowed ( ImplTraitPosition :: Type ) , true ) ;
760
+ let ty = self . lower_ty ( ty, ImplTraitContext :: Disallowed ( ImplTraitPosition :: Type ) ) ;
772
761
let body = default. as_ref ( ) . map ( |x| self . lower_const_body ( i. span , Some ( x) ) ) ;
773
762
( hir:: Generics :: empty ( ) , hir:: TraitItemKind :: Const ( ty, body) , body. is_some ( ) )
774
763
}
@@ -806,17 +795,12 @@ impl<'hir> LoweringContext<'_, 'hir> {
806
795
ImplTraitContext :: Disallowed ( ImplTraitPosition :: Generic ) ,
807
796
|this| {
808
797
let ty = ty. as_ref ( ) . map ( |x| {
809
- this. lower_ty (
810
- x,
811
- ImplTraitContext :: Disallowed ( ImplTraitPosition :: Type ) ,
812
- true ,
813
- )
798
+ this. lower_ty ( x, ImplTraitContext :: Disallowed ( ImplTraitPosition :: Type ) )
814
799
} ) ;
815
800
hir:: TraitItemKind :: Type (
816
801
this. lower_param_bounds (
817
802
bounds,
818
803
ImplTraitContext :: Disallowed ( ImplTraitPosition :: Generic ) ,
819
- true ,
820
804
) ,
821
805
ty,
822
806
)
@@ -869,8 +853,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
869
853
870
854
let ( generics, kind) = match & i. kind {
871
855
AssocItemKind :: Const ( _, ty, expr) => {
872
- let ty =
873
- self . lower_ty ( ty, ImplTraitContext :: Disallowed ( ImplTraitPosition :: Type ) , true ) ;
856
+ let ty = self . lower_ty ( ty, ImplTraitContext :: Disallowed ( ImplTraitPosition :: Type ) ) ;
874
857
(
875
858
hir:: Generics :: empty ( ) ,
876
859
hir:: ImplItemKind :: Const ( ty, self . lower_const_body ( i. span , expr. as_deref ( ) ) ) ,
@@ -904,7 +887,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
904
887
hir:: ImplItemKind :: TyAlias ( ty)
905
888
}
906
889
Some ( ty) => {
907
- let ty = this. lower_ty ( ty, ImplTraitContext :: TypeAliasesOpaqueTy , true ) ;
890
+ let ty = this. lower_ty ( ty, ImplTraitContext :: TypeAliasesOpaqueTy ) ;
908
891
hir:: ImplItemKind :: TyAlias ( ty)
909
892
}
910
893
} ,
@@ -1429,7 +1412,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
1429
1412
return None ;
1430
1413
}
1431
1414
1432
- let bounds = self . lower_param_bounds ( bounds, itctx, true ) ;
1415
+ let bounds = self . lower_param_bounds ( bounds, itctx) ;
1433
1416
1434
1417
let ident = self . lower_ident ( ident) ;
1435
1418
let param_span = ident. span ;
@@ -1475,8 +1458,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
1475
1458
panic ! ( "Missing resolution for lifetime {:?} at {:?}" , id, ident. span)
1476
1459
} ) ;
1477
1460
let lt_id = self . next_node_id ( ) ;
1478
- let lifetime =
1479
- self . new_named_lifetime_with_res ( lt_id, ident_span, ident, res, true ) ;
1461
+ let lifetime = self . new_named_lifetime_with_res ( lt_id, ident_span, ident, res) ;
1480
1462
Some ( hir:: WherePredicate :: RegionPredicate ( hir:: WhereRegionPredicate {
1481
1463
lifetime,
1482
1464
span,
@@ -1496,16 +1478,12 @@ impl<'hir> LoweringContext<'_, 'hir> {
1496
1478
span,
1497
1479
} ) => hir:: WherePredicate :: BoundPredicate ( hir:: WhereBoundPredicate {
1498
1480
bound_generic_params : self . lower_generic_params ( bound_generic_params) ,
1499
- bounded_ty : self . lower_ty (
1500
- bounded_ty,
1501
- ImplTraitContext :: Disallowed ( ImplTraitPosition :: Type ) ,
1502
- true ,
1503
- ) ,
1481
+ bounded_ty : self
1482
+ . lower_ty ( bounded_ty, ImplTraitContext :: Disallowed ( ImplTraitPosition :: Type ) ) ,
1504
1483
bounds : self . arena . alloc_from_iter ( bounds. iter ( ) . map ( |bound| {
1505
1484
self . lower_param_bound (
1506
1485
bound,
1507
1486
ImplTraitContext :: Disallowed ( ImplTraitPosition :: Bound ) ,
1508
- true ,
1509
1487
)
1510
1488
} ) ) ,
1511
1489
span : self . lower_span ( span) ,
@@ -1517,27 +1495,20 @@ impl<'hir> LoweringContext<'_, 'hir> {
1517
1495
span,
1518
1496
} ) => hir:: WherePredicate :: RegionPredicate ( hir:: WhereRegionPredicate {
1519
1497
span : self . lower_span ( span) ,
1520
- lifetime : self . lower_lifetime ( lifetime, true ) ,
1498
+ lifetime : self . lower_lifetime ( lifetime) ,
1521
1499
bounds : self . lower_param_bounds (
1522
1500
bounds,
1523
1501
ImplTraitContext :: Disallowed ( ImplTraitPosition :: Bound ) ,
1524
- true ,
1525
1502
) ,
1526
1503
in_where_clause : true ,
1527
1504
} ) ,
1528
1505
WherePredicate :: EqPredicate ( WhereEqPredicate { id, ref lhs_ty, ref rhs_ty, span } ) => {
1529
1506
hir:: WherePredicate :: EqPredicate ( hir:: WhereEqPredicate {
1530
1507
hir_id : self . lower_node_id ( id) ,
1531
- lhs_ty : self . lower_ty (
1532
- lhs_ty,
1533
- ImplTraitContext :: Disallowed ( ImplTraitPosition :: Type ) ,
1534
- true ,
1535
- ) ,
1536
- rhs_ty : self . lower_ty (
1537
- rhs_ty,
1538
- ImplTraitContext :: Disallowed ( ImplTraitPosition :: Type ) ,
1539
- true ,
1540
- ) ,
1508
+ lhs_ty : self
1509
+ . lower_ty ( lhs_ty, ImplTraitContext :: Disallowed ( ImplTraitPosition :: Type ) ) ,
1510
+ rhs_ty : self
1511
+ . lower_ty ( rhs_ty, ImplTraitContext :: Disallowed ( ImplTraitPosition :: Type ) ) ,
1541
1512
span : self . lower_span ( span) ,
1542
1513
} )
1543
1514
}
0 commit comments