rustup to nightly 2018-05-19

clippy_lints does not compile: non-primitive cast: `rustc_target::abi::Size` as `usize`

Fixes #2780
This commit is contained in:
Cyril Plisko 2018-05-20 09:20:01 +03:00
parent 06f981f2e9
commit 7b715583d4
1 changed files with 1 additions and 1 deletions

View File

@ -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)
},