1
Fork 0

Ensure codegen_fn_attrs during collection.

This commit is contained in:
Camille GILLOT 2022-11-06 16:28:07 +00:00
parent 928d14bcd1
commit dba1503ed3
12 changed files with 103 additions and 129 deletions

View file

@ -219,18 +219,6 @@ impl CheckAttrVisitor<'_> {
return;
}
// FIXME(@lcnr): this doesn't belong here.
if matches!(
target,
Target::Closure
| Target::Fn
| Target::Method(_)
| Target::ForeignFn
| Target::ForeignStatic
) {
self.tcx.ensure().codegen_fn_attrs(self.tcx.hir().local_def_id(hir_id));
}
self.check_repr(attrs, span, target, item, hir_id);
self.check_used(attrs, target);
}