Skip to content

Commit a1e59d1

Browse files
committed
code review fixes
1 parent 152f0d3 commit a1e59d1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/librustc_mir/interpret/cast.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,13 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
8080
if self.tcx.has_attr(def_id, sym::rustc_args_required_const) {
8181
bug!("reifying a fn ptr that requires const arguments");
8282
}
83-
let instance: InterpResult<'tcx, _> = ty::Instance::resolve(
83+
let instance = ty::Instance::resolve(
8484
*self.tcx,
8585
self.param_env,
8686
def_id,
8787
substs,
88-
).ok_or_else(|| err_inval!(TooGeneric).into());
89-
let fn_ptr = self.memory.create_fn_alloc(FnVal::Instance(instance?));
88+
).ok_or_else(|| err_inval!(TooGeneric))?;
89+
let fn_ptr = self.memory.create_fn_alloc(FnVal::Instance(instance));
9090
self.write_scalar(Scalar::Ptr(fn_ptr.into()), dest)?;
9191
}
9292
_ => bug!("reify fn pointer on {:?}", src.layout.ty),

src/librustc_mir/interpret/memory.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> Memory<'mir, 'tcx, M> {
363363
// the "real" alignment.
364364
throw_unsup!(AlignmentCheckFailed {
365365
has: alloc_align,
366-
required: align
366+
required: align,
367367
})
368368
}
369369
check_offset_align(ptr.offset.bytes(), align)?;

0 commit comments

Comments
 (0)