1
Fork 0

s/generator/coroutine/

This commit is contained in:
Oli Scherer 2023-10-19 21:46:28 +00:00
parent 60956837cf
commit e96ce20b34
468 changed files with 2201 additions and 2197 deletions

View file

@ -4,8 +4,9 @@
#![cfg_attr(not(bootstrap), allow(internal_features))]
#![feature(decl_macro)]
#![feature(extract_if)]
#![feature(generators)]
#![feature(iter_from_generator)]
#![cfg_attr(bootstrap, feature(generators))]
#![cfg_attr(not(bootstrap), feature(coroutines))]
#![feature(iter_from_coroutine)]
#![feature(let_chains)]
#![feature(proc_macro_internals)]
#![feature(macro_metavar_expr)]

View file

@ -1239,7 +1239,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> {
id: DefIndex,
sess: &'a Session,
) -> impl Iterator<Item = ModChild> + 'a {
iter::from_generator(move || {
iter::from_coroutine(move || {
if let Some(data) = &self.root.proc_macro_data {
// If we are loading as a proc macro, we want to return
// the view of this crate as a proc macro crate.

View file

@ -221,7 +221,7 @@ provide! { tcx, def_id, other, cdata,
optimized_mir => { table }
mir_for_ctfe => { table }
closure_saved_names_of_captured_variables => { table }
mir_generator_witnesses => { table }
mir_coroutine_witnesses => { table }
promoted_mir => { table }
def_span => { table }
def_ident_span => { table }
@ -241,7 +241,7 @@ provide! { tcx, def_id, other, cdata,
rendered_const => { table }
asyncness => { table_direct }
fn_arg_names => { table }
generator_kind => { table }
coroutine_kind => { table }
trait_def => { table }
deduced_param_attrs => { table }
is_type_alias_impl_trait => {

View file

@ -1447,8 +1447,8 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
}
}
if let DefKind::Coroutine = def_kind {
let data = self.tcx.generator_kind(def_id).unwrap();
record!(self.tables.generator_kind[def_id] <- data);
let data = self.tcx.coroutine_kind(def_id).unwrap();
record!(self.tables.coroutine_kind[def_id] <- data);
}
if let DefKind::Enum | DefKind::Struct | DefKind::Union = def_kind {
self.encode_info_for_adt(local_id);
@ -1630,9 +1630,9 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
<- tcx.closure_saved_names_of_captured_variables(def_id));
if let DefKind::Coroutine = self.tcx.def_kind(def_id)
&& let Some(witnesses) = tcx.mir_generator_witnesses(def_id)
&& let Some(witnesses) = tcx.mir_coroutine_witnesses(def_id)
{
record!(self.tables.mir_generator_witnesses[def_id.to_def_id()] <- witnesses);
record!(self.tables.mir_coroutine_witnesses[def_id.to_def_id()] <- witnesses);
}
}
if encode_const {
@ -1657,9 +1657,9 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
record!(self.tables.promoted_mir[def_id.to_def_id()] <- tcx.promoted_mir(def_id));
if let DefKind::Coroutine = self.tcx.def_kind(def_id)
&& let Some(witnesses) = tcx.mir_generator_witnesses(def_id)
&& let Some(witnesses) = tcx.mir_coroutine_witnesses(def_id)
{
record!(self.tables.mir_generator_witnesses[def_id.to_def_id()] <- witnesses);
record!(self.tables.mir_coroutine_witnesses[def_id.to_def_id()] <- witnesses);
}
let instance = ty::InstanceDef::Item(def_id.to_def_id());

View file

@ -429,7 +429,7 @@ define_tables! {
mir_for_ctfe: Table<DefIndex, LazyValue<mir::Body<'static>>>,
cross_crate_inlinable: Table<DefIndex, bool>,
closure_saved_names_of_captured_variables: Table<DefIndex, LazyValue<IndexVec<FieldIdx, Symbol>>>,
mir_generator_witnesses: Table<DefIndex, LazyValue<mir::CoroutineLayout<'static>>>,
mir_coroutine_witnesses: Table<DefIndex, LazyValue<mir::CoroutineLayout<'static>>>,
promoted_mir: Table<DefIndex, LazyValue<IndexVec<mir::Promoted, mir::Body<'static>>>>,
thir_abstract_const: Table<DefIndex, LazyValue<ty::EarlyBinder<ty::Const<'static>>>>,
impl_parent: Table<DefIndex, RawDefId>,
@ -442,7 +442,7 @@ define_tables! {
rendered_const: Table<DefIndex, LazyValue<String>>,
asyncness: Table<DefIndex, ty::Asyncness>,
fn_arg_names: Table<DefIndex, LazyArray<Ident>>,
generator_kind: Table<DefIndex, LazyValue<hir::CoroutineKind>>,
coroutine_kind: Table<DefIndex, LazyValue<hir::CoroutineKind>>,
trait_def: Table<DefIndex, LazyValue<ty::TraitDef>>,
trait_item_def_id: Table<DefIndex, RawDefId>,
expn_that_defined: Table<DefIndex, LazyValue<ExpnId>>,