提交 d55e7395 编写于 作者: M Mark Simulacrum

Do not use BAB after calling unreachable.

This does not make unreachable and other terminators take self by-value
because it is deemed too difficult. We would need to create by-value
methods on BAB that call into Builder, due to the Deref to builder.
上级 6fac0a1a
......@@ -385,13 +385,14 @@ fn trans_fn_once_adapter_shim<'a, 'tcx>(
if fn_ret.0.is_never() {
bcx.unreachable();
}
self_scope.trans(&bcx);
if fcx.fn_ty.ret.is_indirect() || fcx.fn_ty.ret.is_ignore() {
bcx.ret_void();
} else {
bcx.ret(llret);
self_scope.trans(&bcx);
if fcx.fn_ty.ret.is_indirect() || fcx.fn_ty.ret.is_ignore() {
bcx.ret_void();
} else {
bcx.ret(llret);
}
}
ccx.instances().borrow_mut().insert(method_instance, lloncefn);
......@@ -521,13 +522,14 @@ fn trans_fn_pointer_shim<'a, 'tcx>(
if fn_ret.0.is_never() {
bcx.unreachable();
}
if fn_ty.ret.is_indirect() || fcx.fn_ty.ret.is_ignore() {
bcx.ret_void();
} else {
bcx.ret(llret);
if fn_ty.ret.is_indirect() || fcx.fn_ty.ret.is_ignore() {
bcx.ret_void();
} else {
bcx.ret(llret);
}
}
ccx.fn_pointer_shims().borrow_mut().insert(bare_fn_ty_maybe_ref, llfn);
llfn
......
......@@ -102,12 +102,12 @@ pub fn trans_object_shim<'a, 'tcx>(ccx: &'a CrateContext<'a, 'tcx>,
if fn_ret.0.is_never() {
bcx.unreachable();
}
if fn_ty.ret.is_indirect() || fcx.fn_ty.ret.is_ignore() {
bcx.ret_void();
} else {
bcx.ret(llret);
if fn_ty.ret.is_indirect() || fcx.fn_ty.ret.is_ignore() {
bcx.ret_void();
} else {
bcx.ret(llret);
}
}
llfn
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册