Skip to content

Commit 66b1ae4

Browse files
Add more comments to SuspensionPoint
1 parent 6896157 commit 66b1ae4

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/librustc_mir/transform/generator.rs

+9-3
Original file line numberDiff line numberDiff line change
@@ -186,18 +186,24 @@ fn self_arg() -> Local {
186186
Local::new(1)
187187
}
188188

189-
/// Generator have not been resumed yet
189+
/// Generator has not been resumed yet.
190190
const UNRESUMED: usize = GeneratorSubsts::UNRESUMED;
191-
/// Generator has returned / is completed
191+
/// Generator has returned / is completed.
192192
const RETURNED: usize = GeneratorSubsts::RETURNED;
193-
/// Generator has been poisoned
193+
/// Generator has panicked and is poisoned.
194194
const POISONED: usize = GeneratorSubsts::POISONED;
195195

196+
/// A `yield` point in the generator.
196197
struct SuspensionPoint<'tcx> {
198+
/// State discriminant used when suspending or resuming at this point.
197199
state: usize,
200+
/// The block to jump to after resumption.
198201
resume: BasicBlock,
202+
/// Where to move the resume argument after resumption.
199203
resume_arg: Place<'tcx>,
204+
/// Which block to jump to if the generator is dropped in this state.
200205
drop: Option<BasicBlock>,
206+
/// Set of locals that have live storage while at this suspension point.
201207
storage_liveness: liveness::LiveVarSet,
202208
}
203209

0 commit comments

Comments
 (0)