Skip to content

Commit 51e63a1

Browse files
committed
Rustup PR #802
1 parent 44ab237 commit 51e63a1

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/types.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,13 @@ use reexport::*;
22
use rustc::lint::*;
33
use rustc::middle::def;
44
use rustc::ty;
5-
use rustc::middle::const_eval::ConstVal::Integral;
6-
use rustc_const_eval;
75
use rustc_front::hir::*;
86
use rustc_front::intravisit::{FnKind, Visitor, walk_ty};
97
use rustc_front::util::{is_comparison_binop, binop_to_string};
108
use syntax::ast::{IntTy, UintTy, FloatTy};
119
use syntax::codemap::Span;
1210
use utils::*;
1311

14-
1512
/// Handles all the linting of funky types
1613
#[allow(missing_copy_implementations)]
1714
pub struct TypePass;
@@ -845,7 +842,7 @@ impl Ord for FullInt {
845842

846843

847844
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};
849846
use syntax::ast::UintTy;
850847
use syntax::ast::IntTy;
851848
use std::*;
@@ -874,15 +871,17 @@ fn numeric_cast_precast_bounds<'a>(cx: &LateContext, expr: &'a Expr) -> Option<(
874871
}
875872

876873
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;
879878

880-
match const_eval::eval_const_expr_partial(cx.tcx, expr, ExprTypeChecked, None) {
879+
match eval_const_expr_partial(cx.tcx, expr, ExprTypeChecked, None) {
881880
Ok(val) => {
882881
if let Integral(const_int) = val {
883882
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),
886885
_ => unreachable!(),
887886
})
888887
} else {

0 commit comments

Comments
 (0)