@@ -1509,9 +1509,7 @@ pub fn is_range_full(cx: &LateContext<'_>, expr: &Expr<'_>, container_path: Opti
1509
1509
if let rustc_ty:: Adt ( _, subst) = ty. kind ( )
1510
1510
&& let bnd_ty = subst. type_at ( 0 )
1511
1511
&& let Some ( min_val) = bnd_ty. numeric_min_val ( cx. tcx )
1512
- && let const_val = cx. tcx . valtree_to_const_val ( ( bnd_ty, min_val. to_valtree ( ) ) )
1513
- && let min_const_kind = Const :: from_value ( const_val, bnd_ty)
1514
- && let Some ( min_const) = mir_to_const ( cx, min_const_kind)
1512
+ && let Some ( min_const) = mir_to_const ( cx, Const :: from_ty_const ( min_val, cx. tcx ) )
1515
1513
&& let Some ( start_const) = constant ( cx, cx. typeck_results ( ) , start)
1516
1514
{
1517
1515
start_const == min_const
@@ -1525,9 +1523,7 @@ pub fn is_range_full(cx: &LateContext<'_>, expr: &Expr<'_>, container_path: Opti
1525
1523
if let rustc_ty:: Adt ( _, subst) = ty. kind ( )
1526
1524
&& let bnd_ty = subst. type_at ( 0 )
1527
1525
&& let Some ( max_val) = bnd_ty. numeric_max_val ( cx. tcx )
1528
- && let const_val = cx. tcx . valtree_to_const_val ( ( bnd_ty, max_val. to_valtree ( ) ) )
1529
- && let max_const_kind = Const :: from_value ( const_val, bnd_ty)
1530
- && let Some ( max_const) = mir_to_const ( cx, max_const_kind)
1526
+ && let Some ( max_const) = mir_to_const ( cx, Const :: from_ty_const ( max_val, cx. tcx ) )
1531
1527
&& let Some ( end_const) = constant ( cx, cx. typeck_results ( ) , end)
1532
1528
{
1533
1529
end_const == max_const
0 commit comments