diff options
| author | Jonas Schievink <jonasschievink@gmail.com> | 2020-02-19 23:39:00 +0100 |
|---|---|---|
| committer | Jonas Schievink <jonasschievink@gmail.com> | 2020-02-19 23:39:00 +0100 |
| commit | 66b1ae40606ae0c07645ebc8f97e537d8d30ef73 (patch) | |
| tree | 331c2713367ca9adff7a4c6ffad0e15257b22c61 /src | |
| parent | 689615724535d00c093c6c5dff0accaf6e38d9bc (diff) | |
| download | rust-66b1ae40606ae0c07645ebc8f97e537d8d30ef73.tar.gz rust-66b1ae40606ae0c07645ebc8f97e537d8d30ef73.zip | |
Add more comments to `SuspensionPoint`
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_mir/transform/generator.rs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/librustc_mir/transform/generator.rs b/src/librustc_mir/transform/generator.rs index a94f03301f3..3621ca63209 100644 --- a/src/librustc_mir/transform/generator.rs +++ b/src/librustc_mir/transform/generator.rs @@ -186,18 +186,24 @@ fn self_arg() -> Local { Local::new(1) } -/// Generator have not been resumed yet +/// Generator has not been resumed yet. const UNRESUMED: usize = GeneratorSubsts::UNRESUMED; -/// Generator has returned / is completed +/// Generator has returned / is completed. const RETURNED: usize = GeneratorSubsts::RETURNED; -/// Generator has been poisoned +/// Generator has panicked and is poisoned. const POISONED: usize = GeneratorSubsts::POISONED; +/// A `yield` point in the generator. struct SuspensionPoint<'tcx> { + /// State discriminant used when suspending or resuming at this point. state: usize, + /// The block to jump to after resumption. resume: BasicBlock, + /// Where to move the resume argument after resumption. resume_arg: Place<'tcx>, + /// Which block to jump to if the generator is dropped in this state. drop: Option<BasicBlock>, + /// Set of locals that have live storage while at this suspension point. storage_liveness: liveness::LiveVarSet, } |
