@@ -1624,9 +1624,7 @@ impl<'tcx> Ty<'tcx> {
1624
1624
1625
1625
#[ inline]
1626
1626
pub fn new_adt ( tcx : TyCtxt < ' tcx > , def : AdtDef < ' tcx > , args : GenericArgsRef < ' tcx > ) -> Ty < ' tcx > {
1627
- if cfg ! ( debug_assertions) {
1628
- tcx. assert_args_compatible ( def. did ( ) , args) ;
1629
- }
1627
+ tcx. debug_assert_args_compatible ( def. did ( ) , args) ;
1630
1628
Ty :: new ( tcx, Adt ( def, args) )
1631
1629
}
1632
1630
@@ -1707,9 +1705,7 @@ impl<'tcx> Ty<'tcx> {
1707
1705
def_id : DefId ,
1708
1706
closure_args : GenericArgsRef < ' tcx > ,
1709
1707
) -> Ty < ' tcx > {
1710
- if cfg ! ( debug_assertions) {
1711
- tcx. assert_args_compatible ( def_id, closure_args) ;
1712
- }
1708
+ tcx. debug_assert_args_compatible ( def_id, closure_args) ;
1713
1709
Ty :: new ( tcx, Closure ( def_id, closure_args) )
1714
1710
}
1715
1711
@@ -1719,9 +1715,7 @@ impl<'tcx> Ty<'tcx> {
1719
1715
def_id : DefId ,
1720
1716
closure_args : GenericArgsRef < ' tcx > ,
1721
1717
) -> Ty < ' tcx > {
1722
- if cfg ! ( debug_assertions) {
1723
- tcx. assert_args_compatible ( def_id, closure_args) ;
1724
- }
1718
+ tcx. debug_assert_args_compatible ( def_id, closure_args) ;
1725
1719
Ty :: new ( tcx, CoroutineClosure ( def_id, closure_args) )
1726
1720
}
1727
1721
@@ -1731,9 +1725,7 @@ impl<'tcx> Ty<'tcx> {
1731
1725
def_id : DefId ,
1732
1726
coroutine_args : GenericArgsRef < ' tcx > ,
1733
1727
) -> Ty < ' tcx > {
1734
- if cfg ! ( debug_assertions) {
1735
- tcx. assert_args_compatible ( def_id, coroutine_args) ;
1736
- }
1728
+ tcx. debug_assert_args_compatible ( def_id, coroutine_args) ;
1737
1729
Ty :: new ( tcx, Coroutine ( def_id, coroutine_args) )
1738
1730
}
1739
1731
0 commit comments