Explain why we can encounter a Goto terminator that we want to promote
This commit is contained in:
parent
f7629eff32
commit
4dc028743d
1 changed files with 7 additions and 1 deletions
|
|
@ -332,7 +332,13 @@ impl<'a, 'tcx> Promoter<'a, 'tcx> {
|
|||
let operand = Operand::Copy(promoted_place(ty, span));
|
||||
mem::replace(&mut args[index], operand)
|
||||
}
|
||||
// already promoted out
|
||||
// We expected a `TerminatorKind::Call` for which we'd like to promote an
|
||||
// argument. Since `qualify_consts` saw a `TerminatorKind::Call` here, but
|
||||
// we are seeing a `Goto`, that means that the `promote_temps` method
|
||||
// already promoted this call away entirely. This case occurs when calling
|
||||
// a function requiring a constant argument and as that constant value
|
||||
// providing a value whose computation contains another call to a function
|
||||
// requiring a constant argument.
|
||||
TerminatorKind::Goto { .. } => return,
|
||||
_ => bug!()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue