polymorphize: don't check foreign items
Foreign items do not have bodies and so cannot be polymorphized. Signed-off-by: David Wood <david.wood@huawei.com>
This commit is contained in:
parent
4e4942dfa6
commit
50433a0bf4
1 changed files with 5 additions and 0 deletions
|
@ -52,6 +52,11 @@ fn unused_generic_params(tcx: TyCtxt<'_>, def_id: DefId) -> FiniteBitSet<u32> {
|
|||
return FiniteBitSet::new_empty();
|
||||
}
|
||||
|
||||
// Exit early for foreign items, these have no bodies to analyze.
|
||||
if tcx.is_foreign_item(def_id) {
|
||||
return FiniteBitSet::new_empty();
|
||||
}
|
||||
|
||||
// Exit early when there is no MIR available.
|
||||
let context = tcx.hir().body_const_context(def_id.expect_local());
|
||||
match context {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue