validate derefer, run derefer inside generator
This commit is contained in:
parent
abc7681a76
commit
e71913e847
39 changed files with 300 additions and 60 deletions
|
@ -172,12 +172,14 @@ pub enum MirPhase {
|
|||
/// terminator means that the auto-generated drop glue will be invoked. Also, `Copy` operands
|
||||
/// are allowed for non-`Copy` types.
|
||||
DropsLowered = 3,
|
||||
/// After this projections may only contain deref projections as the first element.
|
||||
Derefered = 4,
|
||||
/// Beginning with this phase, the following variant is disallowed:
|
||||
/// * [`Rvalue::Aggregate`] for any `AggregateKind` except `Array`
|
||||
///
|
||||
/// And the following variant is allowed:
|
||||
/// * [`StatementKind::SetDiscriminant`]
|
||||
Deaggregated = 4,
|
||||
Deaggregated = 5,
|
||||
/// Before this phase, generators are in the "source code" form, featuring `yield` statements
|
||||
/// and such. With this phase change, they are transformed into a proper state machine. Running
|
||||
/// optimizations before this change can be potentially dangerous because the source code is to
|
||||
|
@ -191,8 +193,8 @@ pub enum MirPhase {
|
|||
/// Beginning with this phase, the following variants are disallowed:
|
||||
/// * [`TerminatorKind::Yield`](terminator::TerminatorKind::Yield)
|
||||
/// * [`TerminatorKind::GeneratorDrop`](terminator::TerminatorKind::GeneratorDrop)
|
||||
GeneratorsLowered = 5,
|
||||
Optimized = 6,
|
||||
GeneratorsLowered = 6,
|
||||
Optimized = 7,
|
||||
}
|
||||
|
||||
impl MirPhase {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue