Skip to content

Commit 29a900d

Browse files
authored
Merge pull request #2754 from phansch/rustup20180513
Rustup to 2018-05-13
2 parents 18a5b90 + a8d7e5a commit 29a900d

File tree

8 files changed

+19
-16
lines changed

8 files changed

+19
-16
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Change Log
22
All notable changes to this project will be documented in this file.
33

4+
## 0.0.199
5+
* Rustup to *rustc 1.27.0-nightly (ff2ac35db 2018-05-12)*
6+
47
## 0.0.198
58
* Rustup to *rustc 1.27.0-nightly (acd3871ba 2018-05-10)*
69

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "clippy"
3-
version = "0.0.198"
3+
version = "0.0.199"
44
authors = [
55
"Manish Goregaokar <[email protected]>",
66
"Andre Bogus <[email protected]>",
@@ -37,7 +37,7 @@ path = "src/driver.rs"
3737

3838
[dependencies]
3939
# begin automatic update
40-
clippy_lints = { version = "0.0.198", path = "clippy_lints" }
40+
clippy_lints = { version = "0.0.199", path = "clippy_lints" }
4141
# end automatic update
4242
regex = "1"
4343
semver = "0.9"

clippy_lints/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "clippy_lints"
33
# begin automatic update
4-
version = "0.0.198"
4+
version = "0.0.199"
55
# end automatic update
66
authors = [
77
"Manish Goregaokar <[email protected]>",

clippy_lints/src/array_indexing.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ArrayIndexing {
6161
// Array with known size can be checked statically
6262
let ty = cx.tables.expr_ty(array);
6363
if let ty::TyArray(_, size) = ty.sty {
64-
let size = size.val.to_raw_bits().unwrap();
64+
let size = size.assert_usize(cx.tcx).unwrap().into();
6565

6666
// Index is a constant uint
6767
if let Some((Constant::Int(const_index), _)) = constant(cx, index) {

clippy_lints/src/consts.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> {
209209
ExprTup(ref tup) => self.multi(tup).map(Constant::Tuple),
210210
ExprRepeat(ref value, _) => {
211211
let n = match self.tables.expr_ty(e).sty {
212-
ty::TyArray(_, n) => n.val.to_raw_bits().expect("array length"),
212+
ty::TyArray(_, n) => n.assert_usize(self.tcx).expect("array length"),
213213
_ => span_bug!(e.span, "typeck error"),
214214
};
215215
self.expr(value).map(|v| Constant::Repeat(Box::new(v), n as u64))
@@ -415,17 +415,17 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> {
415415
}
416416

417417
pub fn miri_to_const<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, result: &ty::Const<'tcx>) -> Option<Constant> {
418-
use rustc::mir::interpret::{Value, PrimVal};
418+
use rustc::mir::interpret::{PrimVal, ConstValue};
419419
match result.val {
420-
ConstVal::Value(Value::ByVal(PrimVal::Bytes(b))) => match result.ty.sty {
420+
ConstVal::Value(ConstValue::ByVal(PrimVal::Bytes(b))) => match result.ty.sty {
421421
ty::TyBool => Some(Constant::Bool(b == 1)),
422422
ty::TyUint(_) | ty::TyInt(_) => Some(Constant::Int(b)),
423423
ty::TyFloat(FloatTy::F32) => Some(Constant::F32(f32::from_bits(b as u32))),
424424
ty::TyFloat(FloatTy::F64) => Some(Constant::F64(f64::from_bits(b as u64))),
425425
// FIXME: implement other conversion
426426
_ => None,
427427
},
428-
ConstVal::Value(Value::ByValPair(PrimVal::Ptr(ptr), PrimVal::Bytes(n))) => match result.ty.sty {
428+
ConstVal::Value(ConstValue::ByValPair(PrimVal::Ptr(ptr), PrimVal::Bytes(n))) => match result.ty.sty {
429429
ty::TyRef(_, tam, _) => match tam.sty {
430430
ty::TyStr => {
431431
let alloc = tcx

clippy_lints/src/loops.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,7 +1223,7 @@ fn check_for_loop_arg(cx: &LateContext, pat: &Pat, arg: &Expr, expr: &Expr) {
12231223
match cx.tables.expr_ty(&args[0]).sty {
12241224
// If the length is greater than 32 no traits are implemented for array and
12251225
// therefore we cannot use `&`.
1226-
ty::TypeVariants::TyArray(_, size) if size.val.to_raw_bits().expect("array size") > 32 => (),
1226+
ty::TypeVariants::TyArray(_, size) if size.assert_usize(cx.tcx).expect("array size") > 32 => (),
12271227
_ => lint_iter_method(cx, args, arg, method_name),
12281228
};
12291229
} else {
@@ -1784,7 +1784,7 @@ fn is_ref_iterable_type(cx: &LateContext, e: &Expr) -> bool {
17841784
// no walk_ptrs_ty: calling iter() on a reference can make sense because it
17851785
// will allow further borrows afterwards
17861786
let ty = cx.tables.expr_ty(e);
1787-
is_iterable_array(ty) ||
1787+
is_iterable_array(ty, cx) ||
17881788
match_type(cx, ty, &paths::VEC) ||
17891789
match_type(cx, ty, &paths::LINKED_LIST) ||
17901790
match_type(cx, ty, &paths::HASHMAP) ||
@@ -1795,10 +1795,10 @@ fn is_ref_iterable_type(cx: &LateContext, e: &Expr) -> bool {
17951795
match_type(cx, ty, &paths::BTREESET)
17961796
}
17971797

1798-
fn is_iterable_array(ty: Ty) -> bool {
1798+
fn is_iterable_array(ty: Ty, cx: &LateContext) -> bool {
17991799
// IntoIterator is currently only implemented for array sizes <= 32 in rustc
18001800
match ty.sty {
1801-
ty::TyArray(_, n) => (0..=32).contains(&n.val.to_raw_bits().expect("array length")),
1801+
ty::TyArray(_, n) => (0..=32).contains(&n.assert_usize(cx.tcx).expect("array length")),
18021802
_ => false,
18031803
}
18041804
}

clippy_lints/src/methods.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1299,7 +1299,7 @@ fn derefs_to_slice(cx: &LateContext, expr: &hir::Expr, ty: Ty) -> Option<sugg::S
12991299
ty::TySlice(_) => true,
13001300
ty::TyAdt(def, _) if def.is_box() => may_slice(cx, ty.boxed_ty()),
13011301
ty::TyAdt(..) => match_type(cx, ty, &paths::VEC),
1302-
ty::TyArray(_, size) => size.val.to_raw_bits().expect("array length") < 32,
1302+
ty::TyArray(_, size) => size.assert_usize(cx.tcx).expect("array length") < 32,
13031303
ty::TyRef(_, inner, _) => may_slice(cx, inner),
13041304
_ => false,
13051305
}

min_version.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
rustc 1.27.0-nightly (acd3871ba 2018-05-10)
1+
rustc 1.27.0-nightly (ff2ac35db 2018-05-12)
22
binary: rustc
3-
commit-hash: acd3871ba17316419c644e17547887787628ec2f
4-
commit-date: 2018-05-10
3+
commit-hash: ff2ac35db93a80b2de5daa4f280bf1503d62c164
4+
commit-date: 2018-05-12
55
host: x86_64-unknown-linux-gnu
66
release: 1.27.0-nightly
77
LLVM version: 6.0

0 commit comments

Comments
 (0)