Skip to content

Commit 33a4dd8

Browse files
committed
Remove outdated unreachable check from call_visit_glue
`call_visit_glue` is only ever called from trans_intrinsic, and the block won't be unreachable there. Also, the comment doesn't make sense anymore. When the code was introduced in 38fee95 the function was also responsible for the cleanup glue, which is no longer the case. While we're at it, also fixed the debug message to output the right function name.
1 parent 5ddc7b4 commit 33a4dd8

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/librustc/middle/trans/glue.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -180,12 +180,8 @@ pub fn lazily_emit_visit_glue(ccx: &CrateContext, ti: &tydesc_info) -> ValueRef
180180
// See [Note-arg-mode]
181181
pub fn call_visit_glue(bcx: &Block, v: ValueRef, tydesc: ValueRef,
182182
static_ti: Option<&tydesc_info>) {
183-
let _icx = push_ctxt("call_tydesc_glue_full");
183+
let _icx = push_ctxt("call_visit_glue");
184184
let ccx = bcx.ccx();
185-
// NB: Don't short-circuit even if this block is unreachable because
186-
// GC-based cleanup needs to the see that the roots are live.
187-
if bcx.unreachable.get() && !ccx.sess().no_landing_pads() { return; }
188-
189185
let static_glue_fn = static_ti.map(|sti| lazily_emit_visit_glue(ccx, sti));
190186

191187
// When static type info is available, avoid casting to a generic pointer.

0 commit comments

Comments
 (0)