Skip to content

Commit

Permalink
Rustup to rustc 1.36.0-nightly (33fe1131c 2019-04-20)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorn3 committed Apr 21, 2019
1 parent 5d3fbdd commit cc0804e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/base.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use rustc::ty::adjustment::PointerCast;

use crate::prelude::*;

struct PrintOnPanic<F: Fn() -> String>(F);
Expand Down Expand Up @@ -530,7 +532,7 @@ fn trans_stmt<'a, 'tcx: 'a>(
};
lval.write_cvalue(fx, CValue::ByVal(res, layout));
}
Rvalue::Cast(CastKind::ReifyFnPointer, operand, ty) => {
Rvalue::Cast(CastKind::Pointer(PointerCast::ReifyFnPointer), operand, ty) => {
let layout = fx.layout_of(ty);
match fx
.monomorphize(&operand.ty(&fx.mir.local_decls, fx.tcx))
Expand All @@ -547,8 +549,8 @@ fn trans_stmt<'a, 'tcx: 'a>(
_ => bug!("Trying to ReifyFnPointer on non FnDef {:?}", ty),
}
}
Rvalue::Cast(CastKind::UnsafeFnPointer, operand, ty)
| Rvalue::Cast(CastKind::MutToConstPointer, operand, ty) => {
Rvalue::Cast(CastKind::Pointer(PointerCast::UnsafeFnPointer), operand, ty)
| Rvalue::Cast(CastKind::Pointer(PointerCast::MutToConstPointer), operand, ty) => {
let operand = trans_operand(fx, operand);
let layout = fx.layout_of(ty);
lval.write_cvalue(fx, operand.unchecked_cast_to(layout));
Expand Down Expand Up @@ -644,7 +646,7 @@ fn trans_stmt<'a, 'tcx: 'a>(
lval.write_cvalue(fx, CValue::ByVal(res, dest_layout));
}
}
Rvalue::Cast(CastKind::ClosureFnPointer(_), operand, _ty) => {
Rvalue::Cast(CastKind::Pointer(PointerCast::ClosureFnPointer(_)), operand, _ty) => {
let operand = trans_operand(fx, operand);
match operand.layout().ty.sty {
ty::Closure(def_id, substs) => {
Expand All @@ -663,7 +665,7 @@ fn trans_stmt<'a, 'tcx: 'a>(
}
}
}
Rvalue::Cast(CastKind::Unsize, operand, _ty) => {
Rvalue::Cast(CastKind::Pointer(PointerCast::Unsize), operand, _ty) => {
let operand = trans_operand(fx, operand);
operand.unsize_value(fx, lval);
}
Expand Down

0 comments on commit cc0804e

Please sign in to comment.