Merge pull request #1686 from bkchr/fix_nightly_rust_compilation_error

Fixes compilation error with latest nightly rust
This commit is contained in:
Martin Carton 2017-04-19 20:11:26 +02:00 committed by GitHub
commit 5cbe9b505e
4 changed files with 7 additions and 4 deletions

View File

@ -1,6 +1,9 @@
# Change Log
All notable changes to this project will be documented in this file.
## 0.0.125 — 2017-04-19
* Update to *rustc 1.18.0-nightly (9f2abadca 2017-04-18)*
## 0.0.124 — 2017-04-16
* Update to *rustc 1.18.0-nightly (d5cf1cb64 2017-04-15)*

View File

@ -1,6 +1,6 @@
[package]
name = "clippy"
version = "0.0.124"
version = "0.0.125"
authors = [
"Manish Goregaokar <manishsmail@gmail.com>",
"Andre Bogus <bogusandre@gmail.com>",
@ -30,7 +30,7 @@ test = false
[dependencies]
# begin automatic update
clippy_lints = { version = "0.0.124", path = "clippy_lints" }
clippy_lints = { version = "0.0.125", path = "clippy_lints" }
# end automatic update
cargo_metadata = "0.1.1"

View File

@ -1,7 +1,7 @@
[package]
name = "clippy_lints"
# begin automatic update
version = "0.0.124"
version = "0.0.125"
# end automatic update
authors = [
"Manish Goregaokar <manishsmail@gmail.com>",

View File

@ -44,7 +44,7 @@ fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item) {
let variant = &var.node;
if let Some(body_id) = variant.disr_expr {
use rustc_const_eval::*;
let constcx = ConstContext::new(cx.tcx, body_id);
let constcx = ConstContext::with_tables(cx.tcx, cx.tcx.body_tables(body_id));
let bad = match constcx.eval(&cx.tcx.hir.body(body_id).value) {
Ok(ConstVal::Integral(Usize(Us64(i)))) => i as u32 as u64 != i,
Ok(ConstVal::Integral(Isize(Is64(i)))) => i as i32 as i64 != i,