1
Fork 0

Fix a couple more DefKind discrepancies between DefKind::Closure and DefKind::SyntheticCoroutineBody

This commit is contained in:
Michael Goulet 2024-09-16 21:40:14 -04:00
parent af1ca7794a
commit 4beb1cf9e5
4 changed files with 44 additions and 3 deletions

View file

@ -24,7 +24,7 @@ fn cross_crate_inlinable(tcx: TyCtxt<'_>, def_id: LocalDefId) -> bool {
// This just reproduces the logic from Instance::requires_inline.
match tcx.def_kind(def_id) {
DefKind::Ctor(..) | DefKind::Closure => return true,
DefKind::Ctor(..) | DefKind::Closure | DefKind::SyntheticCoroutineBody => return true,
DefKind::Fn | DefKind::AssocFn => {}
_ => return false,
}