@@ -112,7 +112,6 @@ use rustc_hir::{
112
112
use rustc_lexer:: { TokenKind , tokenize} ;
113
113
use rustc_lint:: { LateContext , Level , Lint , LintContext } ;
114
114
use rustc_middle:: hir:: place:: PlaceBase ;
115
- use rustc_middle:: mir:: Const ;
116
115
use rustc_middle:: ty:: adjustment:: { Adjust , Adjustment , AutoBorrow } ;
117
116
use rustc_middle:: ty:: fast_reject:: SimplifiedType ;
118
117
use rustc_middle:: ty:: layout:: IntegerExt ;
@@ -1584,8 +1583,8 @@ pub fn is_range_full(cx: &LateContext<'_>, expr: &Expr<'_>, container_path: Opti
1584
1583
let start_is_none_or_min = start. is_none_or ( |start| {
1585
1584
if let rustc_ty:: Adt ( _, subst) = ty. kind ( )
1586
1585
&& let bnd_ty = subst. type_at ( 0 )
1587
- && let Some ( min_val ) = bnd_ty. numeric_min_val ( cx. tcx )
1588
- && let Some ( min_const) = mir_to_const ( cx. tcx , Const :: from_ty_const ( min_val , bnd_ty , cx . tcx ) )
1586
+ && let Some ( min_const ) = bnd_ty. numeric_min_val ( cx. tcx )
1587
+ && let Some ( min_const) = mir_to_const ( cx. tcx , min_const )
1589
1588
&& let Some ( start_const) = ConstEvalCtxt :: new ( cx) . eval ( start)
1590
1589
{
1591
1590
start_const == min_const
@@ -1597,8 +1596,8 @@ pub fn is_range_full(cx: &LateContext<'_>, expr: &Expr<'_>, container_path: Opti
1597
1596
RangeLimits :: Closed => {
1598
1597
if let rustc_ty:: Adt ( _, subst) = ty. kind ( )
1599
1598
&& let bnd_ty = subst. type_at ( 0 )
1600
- && let Some ( max_val ) = bnd_ty. numeric_max_val ( cx. tcx )
1601
- && let Some ( max_const) = mir_to_const ( cx. tcx , Const :: from_ty_const ( max_val , bnd_ty , cx . tcx ) )
1599
+ && let Some ( max_const ) = bnd_ty. numeric_max_val ( cx. tcx )
1600
+ && let Some ( max_const) = mir_to_const ( cx. tcx , max_const )
1602
1601
&& let Some ( end_const) = ConstEvalCtxt :: new ( cx) . eval ( end)
1603
1602
{
1604
1603
end_const == max_const
0 commit comments