Skip to content

Commit 51e1c39

Browse files
committed
Add a useful comment about PromoteTemps.
This was non-obvious to me.
1 parent e26692d commit 51e1c39

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

compiler/rustc_mir_transform/src/promote_consts.rs

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ use tracing::{debug, instrument};
3636
/// newly created `Constant`.
3737
#[derive(Default)]
3838
pub(super) struct PromoteTemps<'tcx> {
39+
// Must use `Cell` because `run_pass` takes `&self`, not `&mut self`.
3940
pub promoted_fragments: Cell<IndexVec<Promoted, Body<'tcx>>>,
4041
}
4142

0 commit comments

Comments
 (0)