Skip to content
Snippets Groups Projects
Commit b02359cc authored by David Renshaw's avatar David Renshaw
Browse files

rustup

parent 69c621fa
Branches
No related tags found
No related merge requests found
use rustc::mir;
use rustc::ty::{self, Ty};
use rustc::ty::{Ty};
use rustc_const_math::ConstFloat;
use syntax::ast::FloatTy;
use std::cmp::Ordering;
......@@ -153,7 +153,7 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
if !left_kind.is_float() && !right_kind.is_float() {
match bin_op {
Offset if left_kind == Ptr && right_kind == usize => {
let pointee_ty = left_ty.builtin_deref(true, ty::LvaluePreference::NoPreference).expect("Offset called on non-ptr type").ty;
let pointee_ty = left_ty.builtin_deref(true).expect("Offset called on non-ptr type").ty;
let ptr = self.pointer_offset(left, pointee_ty, right.to_bytes()? as i64)?;
return Ok((ptr, false));
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment