Merge pull request #2781 from imp/2780

rustup to nightly 2018-05-19
This commit is contained in:
Oliver Schneider 2018-05-20 09:42:54 +02:00 committed by GitHub
commit 26423dc392
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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