s/Generator/Coroutine/
This commit is contained in:
parent
96027d945b
commit
60956837cf
310 changed files with 1271 additions and 1271 deletions
|
@ -15,7 +15,7 @@ use crate::ty::{Region, UserTypeAnnotationIndex};
|
|||
use rustc_ast::{InlineAsmOptions, InlineAsmTemplatePiece};
|
||||
use rustc_hir::def_id::DefId;
|
||||
use rustc_hir::{self as hir};
|
||||
use rustc_hir::{self, GeneratorKind};
|
||||
use rustc_hir::{self, CoroutineKind};
|
||||
use rustc_index::IndexVec;
|
||||
use rustc_target::abi::{FieldIdx, VariantIdx};
|
||||
|
||||
|
@ -82,7 +82,7 @@ pub enum MirPhase {
|
|||
/// that Rust itself has them. Where exactly these are is generally subject to change, and so we
|
||||
/// don't document this here. Runtime MIR has most retags explicit (though implicit retags
|
||||
/// can still occur at `Rvalue::{Ref,AddrOf}`).
|
||||
/// - Generator bodies: In analysis MIR, locals may actually be behind a pointer that user code has
|
||||
/// - Coroutine bodies: In analysis MIR, locals may actually be behind a pointer that user code has
|
||||
/// access to. This occurs in generator bodies. Such locals do not behave like other locals,
|
||||
/// because they eg may be aliased in surprising ways. Runtime MIR has no such special locals -
|
||||
/// all generator bodies are lowered and so all places that look like locals really are locals.
|
||||
|
@ -137,7 +137,7 @@ pub enum RuntimePhase {
|
|||
/// In addition to the semantic changes, beginning with this phase, the following variants are
|
||||
/// disallowed:
|
||||
/// * [`TerminatorKind::Yield`]
|
||||
/// * [`TerminatorKind::GeneratorDrop`]
|
||||
/// * [`TerminatorKind::CoroutineDrop`]
|
||||
/// * [`Rvalue::Aggregate`] for any `AggregateKind` except `Array`
|
||||
/// * [`PlaceElem::OpaqueCast`]
|
||||
///
|
||||
|
@ -627,7 +627,7 @@ pub enum TerminatorKind<'tcx> {
|
|||
/// aliasing model.
|
||||
///
|
||||
/// If the body is a generator body, this has slightly different semantics; it instead causes a
|
||||
/// `GeneratorState::Returned(_0)` to be created (as if by an `Aggregate` rvalue) and assigned
|
||||
/// `CoroutineState::Returned(_0)` to be created (as if by an `Aggregate` rvalue) and assigned
|
||||
/// to the return place.
|
||||
Return,
|
||||
|
||||
|
@ -710,7 +710,7 @@ pub enum TerminatorKind<'tcx> {
|
|||
/// Marks a suspend point.
|
||||
///
|
||||
/// Like `Return` terminators in generator bodies, this computes `value` and then a
|
||||
/// `GeneratorState::Yielded(value)` as if by `Aggregate` rvalue. That value is then assigned to
|
||||
/// `CoroutineState::Yielded(value)` as if by `Aggregate` rvalue. That value is then assigned to
|
||||
/// the return place of the function calling this one, and execution continues in the calling
|
||||
/// function. When next invoked with the same first argument, execution of this function
|
||||
/// continues at the `resume` basic block, with the second argument written to the `resume_arg`
|
||||
|
@ -740,7 +740,7 @@ pub enum TerminatorKind<'tcx> {
|
|||
///
|
||||
/// **Needs clarification**: Are there type system constraints on these terminators? Should
|
||||
/// there be a "block type" like `cleanup` blocks for them?
|
||||
GeneratorDrop,
|
||||
CoroutineDrop,
|
||||
|
||||
/// A block where control flow only ever takes one real path, but borrowck needs to be more
|
||||
/// conservative.
|
||||
|
@ -815,7 +815,7 @@ impl TerminatorKind<'_> {
|
|||
TerminatorKind::Call { .. } => "Call",
|
||||
TerminatorKind::Assert { .. } => "Assert",
|
||||
TerminatorKind::Yield { .. } => "Yield",
|
||||
TerminatorKind::GeneratorDrop => "GeneratorDrop",
|
||||
TerminatorKind::CoroutineDrop => "CoroutineDrop",
|
||||
TerminatorKind::FalseEdge { .. } => "FalseEdge",
|
||||
TerminatorKind::FalseUnwind { .. } => "FalseUnwind",
|
||||
TerminatorKind::InlineAsm { .. } => "InlineAsm",
|
||||
|
@ -883,8 +883,8 @@ pub enum AssertKind<O> {
|
|||
OverflowNeg(O),
|
||||
DivisionByZero(O),
|
||||
RemainderByZero(O),
|
||||
ResumedAfterReturn(GeneratorKind),
|
||||
ResumedAfterPanic(GeneratorKind),
|
||||
ResumedAfterReturn(CoroutineKind),
|
||||
ResumedAfterPanic(CoroutineKind),
|
||||
MisalignedPointerDereference { required: O, found: O },
|
||||
}
|
||||
|
||||
|
@ -1278,8 +1278,8 @@ pub enum Rvalue<'tcx> {
|
|||
/// `dest = Foo { x: ..., y: ... }` from `dest.x = ...; dest.y = ...;` in the case that `Foo`
|
||||
/// has a destructor.
|
||||
///
|
||||
/// Disallowed after deaggregation for all aggregate kinds except `Array` and `Generator`. After
|
||||
/// generator lowering, `Generator` aggregate kinds are disallowed too.
|
||||
/// Disallowed after deaggregation for all aggregate kinds except `Array` and `Coroutine`. After
|
||||
/// generator lowering, `Coroutine` aggregate kinds are disallowed too.
|
||||
Aggregate(Box<AggregateKind<'tcx>>, IndexVec<FieldIdx, Operand<'tcx>>),
|
||||
|
||||
/// Transmutes a `*mut u8` into shallow-initialized `Box<T>`.
|
||||
|
@ -1344,7 +1344,7 @@ pub enum AggregateKind<'tcx> {
|
|||
Adt(DefId, VariantIdx, GenericArgsRef<'tcx>, Option<UserTypeAnnotationIndex>, Option<FieldIdx>),
|
||||
|
||||
Closure(DefId, GenericArgsRef<'tcx>),
|
||||
Generator(DefId, GenericArgsRef<'tcx>, hir::Movability),
|
||||
Coroutine(DefId, GenericArgsRef<'tcx>, hir::Movability),
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, TyEncodable, TyDecodable, Hash, HashStable)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue