s/generator/coroutine/
This commit is contained in:
@@ -9,7 +9,7 @@ use crate::{AnalysisDomain, GenKill, GenKillAnalysis};
|
||||
///
|
||||
/// At present, this is used as a very limited form of alias analysis. For example,
|
||||
/// `MaybeBorrowedLocals` is used to compute which locals are live during a yield expression for
|
||||
/// immovable generators.
|
||||
/// immovable coroutines.
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct MaybeBorrowedLocals;
|
||||
|
||||
|
||||
@@ -763,7 +763,7 @@ fn switch_on_enum_discriminant<'mir, 'tcx>(
|
||||
ty::Adt(def, _) => return Some((*discriminated, *def)),
|
||||
|
||||
// `Rvalue::Discriminant` is also used to get the active yield point for a
|
||||
// generator, but we do not need edge-specific effects in that case. This may
|
||||
// coroutine, but we do not need edge-specific effects in that case. This may
|
||||
// change in the future.
|
||||
ty::Coroutine(..) => return None,
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ where
|
||||
{
|
||||
fn visit_place(&mut self, place: &mir::Place<'tcx>, context: PlaceContext, location: Location) {
|
||||
if let PlaceContext::MutatingUse(MutatingUseContext::Yield) = context {
|
||||
// The resume place is evaluated and assigned to only after generator resumes, so its
|
||||
// The resume place is evaluated and assigned to only after coroutine resumes, so its
|
||||
// effect is handled separately in `call_resume_effect`.
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -268,7 +268,7 @@ impl<'tcx> crate::GenKillAnalysis<'tcx> for MaybeRequiresStorage<'_, '_, 'tcx> {
|
||||
|
||||
// Note that we do *not* gen the `resume_arg` of `Yield` terminators. The reason for
|
||||
// that is that a `yield` will return from the function, and `resume_arg` is written
|
||||
// only when the generator is later resumed. Unlike `Call`, this doesn't require the
|
||||
// only when the coroutine is later resumed. Unlike `Call`, this doesn't require the
|
||||
// place to have storage *before* the yield, only after.
|
||||
TerminatorKind::Yield { .. } => {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user