@@ -2,16 +2,13 @@ use reexport::*;
2
2
use rustc:: lint:: * ;
3
3
use rustc:: middle:: def;
4
4
use rustc:: ty;
5
- use rustc:: middle:: const_eval:: ConstVal :: Integral ;
6
- use rustc_const_eval;
7
5
use rustc_front:: hir:: * ;
8
6
use rustc_front:: intravisit:: { FnKind , Visitor , walk_ty} ;
9
7
use rustc_front:: util:: { is_comparison_binop, binop_to_string} ;
10
8
use syntax:: ast:: { IntTy , UintTy , FloatTy } ;
11
9
use syntax:: codemap:: Span ;
12
10
use utils:: * ;
13
11
14
-
15
12
/// Handles all the linting of funky types
16
13
#[ allow( missing_copy_implementations) ]
17
14
pub struct TypePass ;
@@ -845,7 +842,7 @@ impl Ord for FullInt {
845
842
846
843
847
844
fn numeric_cast_precast_bounds < ' a > ( cx : & LateContext , expr : & ' a Expr ) -> Option < ( FullInt , FullInt ) > {
848
- use rustc:: middle :: ty:: TypeVariants :: { TyInt , TyUint } ;
845
+ use rustc:: ty:: TypeVariants :: { TyInt , TyUint } ;
849
846
use syntax:: ast:: UintTy ;
850
847
use syntax:: ast:: IntTy ;
851
848
use std:: * ;
@@ -874,15 +871,17 @@ fn numeric_cast_precast_bounds<'a>(cx: &LateContext, expr: &'a Expr) -> Option<(
874
871
}
875
872
876
873
fn node_as_const_fullint ( cx : & LateContext , expr : & Expr ) -> Option < FullInt > {
877
- use rustc:: middle:: const_eval:: EvalHint :: ExprTypeChecked ;
878
- use rustc_const_eval:: * ;
874
+ use rustc:: middle:: const_val:: ConstVal :: * ;
875
+ use rustc_const_eval:: EvalHint :: ExprTypeChecked ;
876
+ use rustc_const_eval:: eval_const_expr_partial;
877
+ use rustc_const_math:: ConstInt ;
879
878
880
- match const_eval :: eval_const_expr_partial ( cx. tcx , expr, ExprTypeChecked , None ) {
879
+ match eval_const_expr_partial ( cx. tcx , expr, ExprTypeChecked , None ) {
881
880
Ok ( val) => {
882
881
if let Integral ( const_int) = val {
883
882
Some ( match const_int. erase_type ( ) {
884
- InferSigned ( x) => FullInt :: S ( x as i64 ) ,
885
- Infer ( x) => FullInt :: U ( x as u64 ) ,
883
+ ConstInt :: InferSigned ( x) => FullInt :: S ( x as i64 ) ,
884
+ ConstInt :: Infer ( x) => FullInt :: U ( x as u64 ) ,
886
885
_ => unreachable ! ( ) ,
887
886
} )
888
887
} else {
0 commit comments