@@ -112,7 +112,6 @@ use rustc_hir::{
112112use rustc_lexer:: { TokenKind , tokenize} ;
113113use rustc_lint:: { LateContext , Level , Lint , LintContext } ;
114114use rustc_middle:: hir:: place:: PlaceBase ;
115- use rustc_middle:: mir:: Const ;
116115use rustc_middle:: ty:: adjustment:: { Adjust , Adjustment , AutoBorrow } ;
117116use rustc_middle:: ty:: fast_reject:: SimplifiedType ;
118117use rustc_middle:: ty:: layout:: IntegerExt ;
@@ -1584,8 +1583,8 @@ pub fn is_range_full(cx: &LateContext<'_>, expr: &Expr<'_>, container_path: Opti
15841583 let start_is_none_or_min = start. is_none_or ( |start| {
15851584 if let rustc_ty:: Adt ( _, subst) = ty. kind ( )
15861585 && 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 )
15891588 && let Some ( start_const) = ConstEvalCtxt :: new ( cx) . eval ( start)
15901589 {
15911590 start_const == min_const
@@ -1597,8 +1596,8 @@ pub fn is_range_full(cx: &LateContext<'_>, expr: &Expr<'_>, container_path: Opti
15971596 RangeLimits :: Closed => {
15981597 if let rustc_ty:: Adt ( _, subst) = ty. kind ( )
15991598 && 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 )
16021601 && let Some ( end_const) = ConstEvalCtxt :: new ( cx) . eval ( end)
16031602 {
16041603 end_const == max_const
0 commit comments