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

@ -761,9 +761,9 @@ impl<'tcx> TyCtxt<'tcx> {
self.diagnostic_items(did.krate).name_to_id.get(&name) == Some(&did)
}
/// Returns `true` if the node pointed to by `def_id` is a generator for an async construct.
pub fn generator_is_async(self, def_id: DefId) -> bool {
matches!(self.generator_kind(def_id), Some(hir::CoroutineKind::Async(_)))
/// Returns `true` if the node pointed to by `def_id` is a coroutine for an async construct.
pub fn coroutine_is_async(self, def_id: DefId) -> bool {
matches!(self.coroutine_kind(def_id), Some(hir::CoroutineKind::Async(_)))
}
pub fn stability(self) -> &'tcx stability::Index {
@ -951,7 +951,7 @@ impl<'tcx> TyCtxt<'tcx> {
self.dep_graph.read_index(DepNodeIndex::FOREVER_RED_NODE);
let definitions = &self.untracked.definitions;
std::iter::from_generator(|| {
std::iter::from_coroutine(|| {
let mut i = 0;
// Recompute the number of definitions each time, because our caller may be creating