Skip to content

Commit 62bc642

Browse files
committed
Merge pull request #821 from mcarton/rustup
Rustup to 1.9.0-nightly (30a3849 2016-03-30)
2 parents 4f17633 + 4a9a4fc commit 62bc642

14 files changed

+43
-39
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "clippy"
3-
version = "0.0.58"
3+
version = "0.0.59"
44
authors = [
55
"Manish Goregaokar <[email protected]>",
66
"Andre Bogus <[email protected]>",

src/array_indexing.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
use rustc::lint::*;
2-
use rustc::middle::const_eval::EvalHint::ExprTypeChecked;
3-
use rustc::middle::const_eval::{eval_const_expr_partial, ConstVal};
2+
use rustc::middle::const_val::ConstVal;
43
use rustc::ty::TyArray;
4+
use rustc_const_eval::EvalHint::ExprTypeChecked;
5+
use rustc_const_eval::eval_const_expr_partial;
6+
use rustc_const_math::ConstInt;
57
use rustc_front::hir::*;
6-
use rustc_const_eval::ConstInt;
78
use syntax::ast::RangeLimits;
89
use utils;
910

src/bit_mask.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
use rustc::lint::*;
2-
use rustc::middle::const_eval::lookup_const_by_id;
32
use rustc::middle::def::{Def, PathResolution};
3+
use rustc_const_eval::lookup_const_by_id;
44
use rustc_front::hir::*;
55
use rustc_front::util::is_comparison_binop;
66
use syntax::ast::LitKind;
77
use syntax::codemap::Span;
8-
98
use utils::span_lint;
109

1110
/// **What it does:** This lint checks for incompatible bit masks in comparisons.

src/consts.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#![allow(cast_possible_truncation)]
22

33
use rustc::lint::LateContext;
4-
use rustc::middle::const_eval::lookup_const_by_id;
54
use rustc::middle::def::{Def, PathResolution};
5+
use rustc_const_eval::lookup_const_by_id;
6+
use rustc_const_math::{ConstInt, ConstUsize, ConstIsize};
67
use rustc_front::hir::*;
7-
use rustc_const_eval::{ConstInt, ConstUsize, ConstIsize};
88
use std::cmp::Ordering::{self, Equal};
99
use std::cmp::PartialOrd;
1010
use std::hash::{Hash, Hasher};

src/enum_clike.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
//! lint on C-like enums that are `repr(isize/usize)` and have values that don't fit into an `i32`
22
33
use rustc::lint::*;
4-
use syntax::attr::*;
4+
use rustc::middle::const_val::ConstVal;
5+
use rustc_const_math::*;
56
use rustc_front::hir::*;
6-
use rustc::middle::const_eval::{ConstVal, EvalHint, eval_const_expr_partial};
7+
use syntax::attr::*;
78
use utils::span_lint;
89

910
/// **What it does:** Lints on C-like enums that are `repr(isize/usize)` and have values that don't fit into an `i32`.

src/identity_op.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use rustc::lint::*;
33
use rustc_front::hir::*;
44
use syntax::codemap::Span;
55
use utils::{span_lint, snippet, in_macro};
6-
use rustc_const_eval::ConstInt;
6+
use rustc_const_math::ConstInt;
77

88
/// **What it does:** This lint checks for identity operations, e.g. `x + 0`.
99
///

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ extern crate quine_mc_cluskey;
4242

4343
extern crate rustc_plugin;
4444
extern crate rustc_const_eval;
45+
extern crate rustc_const_math;
4546
use rustc_plugin::Registry;
4647

4748
pub mod consts;

src/loops.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
use reexport::*;
22
use rustc::front::map::Node::NodeBlock;
33
use rustc::lint::*;
4-
use rustc::middle::const_eval::EvalHint::ExprTypeChecked;
5-
use rustc::middle::const_eval::{ConstVal, eval_const_expr_partial};
4+
use rustc::middle::const_val::ConstVal;
65
use rustc::middle::def::Def;
76
use rustc::middle::region::CodeExtent;
87
use rustc::ty;
8+
use rustc_const_eval::EvalHint::ExprTypeChecked;
9+
use rustc_const_eval::eval_const_expr_partial;
910
use rustc_front::hir::*;
1011
use rustc_front::intravisit::{Visitor, walk_expr, walk_block, walk_decl};
1112
use std::borrow::Cow;

src/matches.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
use rustc::lint::*;
2-
use rustc::middle::const_eval::EvalHint::ExprTypeChecked;
3-
use rustc::middle::const_eval::{eval_const_expr_partial, ConstVal};
2+
use rustc::middle::const_val::ConstVal;
43
use rustc::ty;
4+
use rustc_const_eval::EvalHint::ExprTypeChecked;
5+
use rustc_const_eval::eval_const_expr_partial;
6+
use rustc_const_math::ConstInt;
57
use rustc_front::hir::*;
6-
use rustc_const_eval::ConstInt;
78
use std::cmp::Ordering;
89
use syntax::ast::LitKind;
910
use syntax::codemap::Span;

src/methods.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
use rustc::lint::*;
2-
use rustc::middle::const_eval::EvalHint::ExprTypeChecked;
3-
use rustc::middle::const_eval::{ConstVal, eval_const_expr_partial};
2+
use rustc::middle::const_val::ConstVal;
43
use rustc::middle::cstore::CrateStore;
54
use rustc::ty::subst::{Subst, TypeSpace};
65
use rustc::ty;
6+
use rustc_const_eval::EvalHint::ExprTypeChecked;
7+
use rustc_const_eval::eval_const_expr_partial;
78
use rustc_front::hir::*;
89
use std::borrow::Cow;
910
use std::fmt;

src/misc.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
use reexport::*;
22
use rustc::lint::*;
3-
use rustc::middle::const_eval::ConstVal::Float;
4-
use rustc::middle::const_eval::EvalHint::ExprTypeChecked;
5-
use rustc::middle::const_eval::eval_const_expr_partial;
3+
use rustc::middle::const_val::ConstVal;
64
use rustc::ty;
5+
use rustc_const_eval::EvalHint::ExprTypeChecked;
6+
use rustc_const_eval::eval_const_expr_partial;
77
use rustc_front::hir::*;
88
use rustc_front::intravisit::FnKind;
99
use rustc_front::util::{is_comparison_binop, binop_to_string};
@@ -180,7 +180,7 @@ impl LateLintPass for FloatCmp {
180180

181181
fn is_allowed(cx: &LateContext, expr: &Expr) -> bool {
182182
let res = eval_const_expr_partial(cx.tcx, expr, ExprTypeChecked, None);
183-
if let Ok(Float(val)) = res {
183+
if let Ok(ConstVal::Float(val)) = res {
184184
val == 0.0 || val == ::std::f64::INFINITY || val == ::std::f64::NEG_INFINITY
185185
} else {
186186
false

src/regex.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
use regex_syntax;
22
use rustc::lint::*;
3-
use rustc::middle::const_eval::EvalHint::ExprTypeChecked;
4-
use rustc::middle::const_eval::{eval_const_expr_partial, ConstVal};
3+
use rustc::middle::const_val::ConstVal;
4+
use rustc_const_eval::EvalHint::ExprTypeChecked;
5+
use rustc_const_eval::eval_const_expr_partial;
56
use rustc_front::hir::*;
67
use std::collections::HashSet;
78
use std::error::Error;

src/types.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use reexport::*;
22
use rustc::lint::*;
3-
use rustc::middle::{const_eval, def};
3+
use rustc::middle::def;
44
use rustc::ty;
55
use rustc_front::hir::*;
66
use rustc_front::intravisit::{FnKind, Visitor, walk_ty};
@@ -683,10 +683,11 @@ fn detect_absurd_comparison<'a>(cx: &LateContext, op: BinOp_, lhs: &'a Expr, rhs
683683
}
684684

685685
fn detect_extreme_expr<'a>(cx: &LateContext, expr: &'a Expr) -> Option<ExtremeExpr<'a>> {
686-
use rustc::middle::const_eval::EvalHint::ExprTypeChecked;
687-
use types::ExtremeType::*;
688-
use rustc::middle::const_eval::ConstVal::*;
686+
use rustc::middle::const_val::ConstVal::*;
687+
use rustc_const_math::*;
688+
use rustc_const_eval::EvalHint::ExprTypeChecked;
689689
use rustc_const_eval::*;
690+
use types::ExtremeType::*;
690691

691692
let ty = &cx.tcx.expr_ty(expr).sty;
692693

@@ -695,7 +696,7 @@ fn detect_extreme_expr<'a>(cx: &LateContext, expr: &'a Expr) -> Option<ExtremeEx
695696
_ => return None,
696697
};
697698

698-
let cv = match const_eval::eval_const_expr_partial(cx.tcx, expr, ExprTypeChecked, None) {
699+
let cv = match eval_const_expr_partial(cx.tcx, expr, ExprTypeChecked, None) {
699700
Ok(val) => val,
700701
Err(_) => return None,
701702
};

tests/consts.rs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,19 @@
22
#![feature(rustc_private)]
33

44
extern crate clippy;
5-
extern crate syntax;
65
extern crate rustc;
7-
extern crate rustc_front;
86
extern crate rustc_const_eval;
7+
extern crate rustc_const_math;
8+
extern crate rustc_front;
9+
extern crate syntax;
910

11+
use clippy::consts::{constant_simple, Constant, FloatWidth};
12+
use rustc_const_math::ConstInt;
1013
use rustc_front::hir::*;
11-
use rustc_const_eval::ConstInt;
14+
use syntax::ast::{LitIntType, LitKind, StrStyle};
15+
use syntax::codemap::{Spanned, COMMAND_LINE_SP};
1216
use syntax::parse::token::InternedString;
1317
use syntax::ptr::P;
14-
use syntax::codemap::{Spanned, COMMAND_LINE_SP};
15-
16-
use syntax::ast::LitKind;
17-
use syntax::ast::LitIntType;
18-
use syntax::ast::StrStyle;
19-
20-
use clippy::consts::{constant_simple, Constant, FloatWidth};
2118

2219
fn spanned<T>(t: T) -> Spanned<T> {
2320
Spanned{ node: t, span: COMMAND_LINE_SP }

0 commit comments

Comments
 (0)