Skip to content

Commit 37d5c06

Browse files
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.
1 parent dd0505c commit 37d5c06

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/librustc_trans/trans_item.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,12 @@ impl<'a, 'tcx> TransItem<'tcx> {
111111
tcx.map.local_def_id(node_id)
112112
}
113113
TransItem::Fn(instance) => {
114-
instance.def
114+
if instance.def.is_local() {
115+
instance.def
116+
} else {
117+
// Translating an inlined item from another crate? Don't track anything.
118+
return;
119+
}
115120
}
116121
TransItem::DropGlue(_) => {
117122
// Nothing to track for drop glue

0 commit comments

Comments
 (0)