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.
This commit is contained in:
Jonas Schievink 2016-07-11 01:46:56 +02:00
parent dd0505cefc
commit 37d5c06a0d
1 changed files with 6 additions and 1 deletions

View File

@ -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