From 37d5c06a0d0d1658900636be8b66ccf4d9c4b23c Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Mon, 11 Jul 2016 01:46:56 +0200 Subject: [PATCH] Don't register reads for external items Presumably, this ICEs when translating an inlined item from another crate. There shouldn't be a need to track dependencies in that case. --- src/librustc_trans/trans_item.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/librustc_trans/trans_item.rs b/src/librustc_trans/trans_item.rs index aa0c8ba5528..ca24a270080 100644 --- a/src/librustc_trans/trans_item.rs +++ b/src/librustc_trans/trans_item.rs @@ -111,7 +111,12 @@ fn register_reads(&self, ccx: &CrateContext<'a, 'tcx>) { tcx.map.local_def_id(node_id) } TransItem::Fn(instance) => { - instance.def + if instance.def.is_local() { + instance.def + } else { + // Translating an inlined item from another crate? Don't track anything. + return; + } } TransItem::DropGlue(_) => { // Nothing to track for drop glue -- 2.44.0