Encode coroutine_for_closure for foreign crates
This commit is contained in:
parent
6cc4843512
commit
c210fec3cb
5 changed files with 35 additions and 0 deletions
|
@ -250,6 +250,7 @@ provide! { tcx, def_id, other, cdata,
|
|||
asyncness => { table_direct }
|
||||
fn_arg_names => { table }
|
||||
coroutine_kind => { table_direct }
|
||||
coroutine_for_closure => { table }
|
||||
trait_def => { table }
|
||||
deduced_param_attrs => { table }
|
||||
is_type_alias_impl_trait => {
|
||||
|
|
|
@ -1447,6 +1447,13 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
|
|||
{
|
||||
self.tables.coroutine_kind.set(def_id.index, Some(coroutine_kind))
|
||||
}
|
||||
if def_kind == DefKind::Closure
|
||||
&& tcx.type_of(def_id).skip_binder().is_coroutine_closure()
|
||||
{
|
||||
self.tables
|
||||
.coroutine_for_closure
|
||||
.set_some(def_id.index, self.tcx.coroutine_for_closure(def_id).into());
|
||||
}
|
||||
if let DefKind::Enum | DefKind::Struct | DefKind::Union = def_kind {
|
||||
self.encode_info_for_adt(local_id);
|
||||
}
|
||||
|
|
|
@ -443,6 +443,7 @@ define_tables! {
|
|||
asyncness: Table<DefIndex, ty::Asyncness>,
|
||||
fn_arg_names: Table<DefIndex, LazyArray<Ident>>,
|
||||
coroutine_kind: Table<DefIndex, hir::CoroutineKind>,
|
||||
coroutine_for_closure: Table<DefIndex, RawDefId>,
|
||||
trait_def: Table<DefIndex, LazyValue<ty::TraitDef>>,
|
||||
trait_item_def_id: Table<DefIndex, RawDefId>,
|
||||
expn_that_defined: Table<DefIndex, LazyValue<ExpnId>>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue