diff options
Diffstat (limited to 'compiler/rustc_metadata')
| -rw-r--r-- | compiler/rustc_metadata/src/rmeta/encoder.rs | 32 | ||||
| -rw-r--r-- | compiler/rustc_metadata/src/rmeta/mod.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_metadata/src/rmeta/table.rs | 2 |
3 files changed, 19 insertions, 19 deletions
diff --git a/compiler/rustc_metadata/src/rmeta/encoder.rs b/compiler/rustc_metadata/src/rmeta/encoder.rs index 345b3d5e57f..de17462130d 100644 --- a/compiler/rustc_metadata/src/rmeta/encoder.rs +++ b/compiler/rustc_metadata/src/rmeta/encoder.rs @@ -856,7 +856,7 @@ fn should_encode_span(def_kind: DefKind) -> bool { | DefKind::Field | DefKind::Impl { .. } | DefKind::Closure - | DefKind::Generator => true, + | DefKind::Coroutine => true, DefKind::ForeignMod | DefKind::GlobalAsm => false, } } @@ -897,7 +897,7 @@ fn should_encode_attrs(def_kind: DefKind) -> bool { | DefKind::OpaqueTy | DefKind::LifetimeParam | DefKind::GlobalAsm - | DefKind::Generator => false, + | DefKind::Coroutine => false, } } @@ -933,7 +933,7 @@ fn should_encode_expn_that_defined(def_kind: DefKind) -> bool { | DefKind::LifetimeParam | DefKind::GlobalAsm | DefKind::Closure - | DefKind::Generator => false, + | DefKind::Coroutine => false, } } @@ -968,7 +968,7 @@ fn should_encode_visibility(def_kind: DefKind) -> bool { | DefKind::GlobalAsm | DefKind::Impl { .. } | DefKind::Closure - | DefKind::Generator + | DefKind::Coroutine | DefKind::ExternCrate => false, } } @@ -1004,7 +1004,7 @@ fn should_encode_stability(def_kind: DefKind) -> bool { | DefKind::InlineConst | DefKind::GlobalAsm | DefKind::Closure - | DefKind::Generator + | DefKind::Coroutine | DefKind::ExternCrate => false, } } @@ -1060,8 +1060,8 @@ fn should_encode_mir( || tcx.is_const_default_method(def_id.to_def_id()); (is_const_fn, opt) } - // Generators require optimized MIR to compute layout. - DefKind::Generator => (false, true), + // Coroutines require optimized MIR to compute layout. + DefKind::Coroutine => (false, true), // The others don't have MIR. _ => (false, false), } @@ -1097,7 +1097,7 @@ fn should_encode_variances<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId, def_kind: Def | DefKind::InlineConst | DefKind::GlobalAsm | DefKind::Closure - | DefKind::Generator + | DefKind::Coroutine | DefKind::ExternCrate => false, DefKind::TyAlias => tcx.type_alias_is_lazy(def_id), } @@ -1127,7 +1127,7 @@ fn should_encode_generics(def_kind: DefKind) -> bool { | DefKind::Field | DefKind::TyParam | DefKind::Closure - | DefKind::Generator => true, + | DefKind::Coroutine => true, DefKind::Mod | DefKind::ForeignMod | DefKind::ConstParam @@ -1156,7 +1156,7 @@ fn should_encode_type(tcx: TyCtxt<'_>, def_id: LocalDefId, def_kind: DefKind) -> | DefKind::AssocFn | DefKind::AssocConst | DefKind::Closure - | DefKind::Generator + | DefKind::Coroutine | DefKind::ConstParam | DefKind::AnonConst | DefKind::InlineConst => true, @@ -1217,7 +1217,7 @@ fn should_encode_fn_sig(def_kind: DefKind) -> bool { | DefKind::Impl { .. } | DefKind::AssocConst | DefKind::Closure - | DefKind::Generator + | DefKind::Coroutine | DefKind::ConstParam | DefKind::AnonConst | DefKind::InlineConst @@ -1256,7 +1256,7 @@ fn should_encode_constness(def_kind: DefKind) -> bool { | DefKind::OpaqueTy | DefKind::Impl { of_trait: false } | DefKind::ForeignTy - | DefKind::Generator + | DefKind::Coroutine | DefKind::ConstParam | DefKind::InlineConst | DefKind::AssocTy @@ -1291,7 +1291,7 @@ fn should_encode_const(def_kind: DefKind) -> bool { | DefKind::Impl { .. } | DefKind::AssocFn | DefKind::Closure - | DefKind::Generator + | DefKind::Coroutine | DefKind::ConstParam | DefKind::AssocTy | DefKind::TyParam @@ -1446,7 +1446,7 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> { self.encode_info_for_assoc_item(def_id); } } - if let DefKind::Generator = def_kind { + if let DefKind::Coroutine = def_kind { let data = self.tcx.generator_kind(def_id).unwrap(); record!(self.tables.generator_kind[def_id] <- data); } @@ -1629,7 +1629,7 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> { record!(self.tables.closure_saved_names_of_captured_variables[def_id.to_def_id()] <- tcx.closure_saved_names_of_captured_variables(def_id)); - if let DefKind::Generator = self.tcx.def_kind(def_id) + if let DefKind::Coroutine = self.tcx.def_kind(def_id) && let Some(witnesses) = tcx.mir_generator_witnesses(def_id) { record!(self.tables.mir_generator_witnesses[def_id.to_def_id()] <- witnesses); @@ -1656,7 +1656,7 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> { } record!(self.tables.promoted_mir[def_id.to_def_id()] <- tcx.promoted_mir(def_id)); - if let DefKind::Generator = self.tcx.def_kind(def_id) + if let DefKind::Coroutine = self.tcx.def_kind(def_id) && let Some(witnesses) = tcx.mir_generator_witnesses(def_id) { record!(self.tables.mir_generator_witnesses[def_id.to_def_id()] <- witnesses); diff --git a/compiler/rustc_metadata/src/rmeta/mod.rs b/compiler/rustc_metadata/src/rmeta/mod.rs index 2609767a85c..1e0fcfa239d 100644 --- a/compiler/rustc_metadata/src/rmeta/mod.rs +++ b/compiler/rustc_metadata/src/rmeta/mod.rs @@ -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::GeneratorLayout<'static>>>, + mir_generator_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::GeneratorKind>>, + generator_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>>, diff --git a/compiler/rustc_metadata/src/rmeta/table.rs b/compiler/rustc_metadata/src/rmeta/table.rs index 34118e9e8a3..027994c40ab 100644 --- a/compiler/rustc_metadata/src/rmeta/table.rs +++ b/compiler/rustc_metadata/src/rmeta/table.rs @@ -167,7 +167,7 @@ fixed_size_enum! { ( Impl { of_trait: false } ) ( Impl { of_trait: true } ) ( Closure ) - ( Generator ) + ( Coroutine ) ( Static(ast::Mutability::Not) ) ( Static(ast::Mutability::Mut) ) ( Ctor(CtorOf::Struct, CtorKind::Fn) ) |
