Add a useful comment about PromoteTemps.

This was non-obvious to me.
This commit is contained in:
Nicholas Nethercote 2024-09-04 13:20:20 +10:00
parent e26692d559
commit 51e1c3958d

View File

@ -36,6 +36,7 @@ use tracing::{debug, instrument};
/// newly created `Constant`.
#[derive(Default)]
pub(super) struct PromoteTemps<'tcx> {
// Must use `Cell` because `run_pass` takes `&self`, not `&mut self`.
pub promoted_fragments: Cell<IndexVec<Promoted, Body<'tcx>>>,
}