about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJonas Schievink <jonas@schievink.net>2016-07-11 01:46:56 +0200
committerJonas Schievink <jonas@schievink.net>2016-07-11 01:49:38 +0200
commit37d5c06a0d0d1658900636be8b66ccf4d9c4b23c (patch)
treecbc91b770cddc6923c82f39b2b4ed92974fc2911
parentdd0505cefc2a25702cfe33d8115ed2c536dc40b8 (diff)
downloadrust-37d5c06a0d0d1658900636be8b66ccf4d9c4b23c.tar.gz
rust-37d5c06a0d0d1658900636be8b66ccf4d9c4b23c.zip
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.
-rw-r--r--src/librustc_trans/trans_item.rs7
1 files changed, 6 insertions, 1 deletions
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 @@ impl<'a, 'tcx> TransItem<'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