diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-09-04 13:20:20 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-09-10 08:54:45 +1000 |
| commit | 51e1c3958dd68372c4a4499d59223ccecc1a7955 (patch) | |
| tree | 5f866881a6a37dd44df4582ccb9e75024f50387b /compiler/rustc_mir_transform | |
| parent | e26692d559c3b564a3efdd5b6db316c0c67fb52e (diff) | |
| download | rust-51e1c3958dd68372c4a4499d59223ccecc1a7955.tar.gz rust-51e1c3958dd68372c4a4499d59223ccecc1a7955.zip | |
Add a useful comment about `PromoteTemps`.
This was non-obvious to me.
Diffstat (limited to 'compiler/rustc_mir_transform')
| -rw-r--r-- | compiler/rustc_mir_transform/src/promote_consts.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_mir_transform/src/promote_consts.rs b/compiler/rustc_mir_transform/src/promote_consts.rs index c968053a6d6..59df99f858d 100644 --- a/compiler/rustc_mir_transform/src/promote_consts.rs +++ b/compiler/rustc_mir_transform/src/promote_consts.rs @@ -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>>>, } |
