1
Fork 0

Rollup merge of #83734 - JohnTitor:issue-83621, r=davidtwco

Catch a bad placeholder type error for statics in `extern`s

Fixes #83621
This commit is contained in:
Yuki Okushi 2021-04-06 06:24:11 +09:00 committed by GitHub
commit 76be7e2082
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 2 deletions

View file

@ -734,8 +734,14 @@ fn convert_item(tcx: TyCtxt<'_>, item_id: hir::ItemId) {
tcx.ensure().generics_of(item.def_id);
tcx.ensure().type_of(item.def_id);
tcx.ensure().predicates_of(item.def_id);
if let hir::ForeignItemKind::Fn(..) = item.kind {
tcx.ensure().fn_sig(item.def_id);
match item.kind {
hir::ForeignItemKind::Fn(..) => tcx.ensure().fn_sig(item.def_id),
hir::ForeignItemKind::Static(..) => {
let mut visitor = PlaceholderHirTyCollector::default();
visitor.visit_foreign_item(item);
placeholder_type_error(tcx, None, &[], visitor.0, false, None);
}
_ => (),
}
}
}