Ensure codegen_fn_attrs during collection.
This commit is contained in:
parent
928d14bcd1
commit
dba1503ed3
12 changed files with 103 additions and 129 deletions
|
@ -314,6 +314,7 @@ impl<'tcx> Visitor<'tcx> for CollectItemTypesVisitor<'tcx> {
|
|||
if let hir::ExprKind::Closure { .. } = expr.kind {
|
||||
let def_id = self.tcx.hir().local_def_id(expr.hir_id);
|
||||
self.tcx.ensure().generics_of(def_id);
|
||||
self.tcx.ensure().codegen_fn_attrs(def_id);
|
||||
// We do not call `type_of` for closures here as that
|
||||
// depends on typecheck and would therefore hide
|
||||
// any further errors in case one typeck fails.
|
||||
|
@ -586,8 +587,12 @@ fn convert_item(tcx: TyCtxt<'_>, item_id: hir::ItemId) {
|
|||
tcx.ensure().type_of(item.owner_id);
|
||||
tcx.ensure().predicates_of(item.owner_id);
|
||||
match item.kind {
|
||||
hir::ForeignItemKind::Fn(..) => tcx.ensure().fn_sig(item.owner_id),
|
||||
hir::ForeignItemKind::Fn(..) => {
|
||||
tcx.ensure().codegen_fn_attrs(item.owner_id);
|
||||
tcx.ensure().fn_sig(item.owner_id)
|
||||
}
|
||||
hir::ForeignItemKind::Static(..) => {
|
||||
tcx.ensure().codegen_fn_attrs(item.owner_id);
|
||||
let mut visitor = HirPlaceholderCollector::default();
|
||||
visitor.visit_foreign_item(item);
|
||||
placeholder_type_error(
|
||||
|
@ -676,6 +681,7 @@ fn convert_item(tcx: TyCtxt<'_>, item_id: hir::ItemId) {
|
|||
tcx.ensure().type_of(def_id);
|
||||
tcx.ensure().predicates_of(def_id);
|
||||
tcx.ensure().fn_sig(def_id);
|
||||
tcx.ensure().codegen_fn_attrs(def_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -687,6 +693,7 @@ fn convert_trait_item(tcx: TyCtxt<'_>, trait_item_id: hir::TraitItemId) {
|
|||
|
||||
match trait_item.kind {
|
||||
hir::TraitItemKind::Fn(..) => {
|
||||
tcx.ensure().codegen_fn_attrs(def_id);
|
||||
tcx.ensure().type_of(def_id);
|
||||
tcx.ensure().fn_sig(def_id);
|
||||
}
|
||||
|
@ -736,6 +743,7 @@ fn convert_impl_item(tcx: TyCtxt<'_>, impl_item_id: hir::ImplItemId) {
|
|||
let impl_item = tcx.hir().impl_item(impl_item_id);
|
||||
match impl_item.kind {
|
||||
hir::ImplItemKind::Fn(..) => {
|
||||
tcx.ensure().codegen_fn_attrs(def_id);
|
||||
tcx.ensure().fn_sig(def_id);
|
||||
}
|
||||
hir::ImplItemKind::Type(_) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue