From 7b715583d459597b6565184701327b9d6636c522 Mon Sep 17 00:00:00 2001 From: Cyril Plisko Date: Sun, 20 May 2018 09:20:01 +0300 Subject: [PATCH] rustup to nightly 2018-05-19 clippy_lints does not compile: non-primitive cast: `rustc_target::abi::Size` as `usize` Fixes #2780 --- clippy_lints/src/consts.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clippy_lints/src/consts.rs b/clippy_lints/src/consts.rs index bc57be94c..841c61717 100644 --- a/clippy_lints/src/consts.rs +++ b/clippy_lints/src/consts.rs @@ -432,7 +432,7 @@ pub fn miri_to_const<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, result: &ty::Const<' .interpret_interner .get_alloc(ptr.alloc_id) .unwrap(); - let offset = ptr.offset as usize; + let offset = ptr.offset.bytes() as usize; let n = n as usize; String::from_utf8(alloc.bytes[offset..(offset + n)].to_owned()).ok().map(Constant::Str) },