]> git.proxmox.com Git - rustc.git/blame - compiler/rustc_mir_transform/src/marker.rs
New upstream version 1.59.0+dfsg1
[rustc.git] / compiler / rustc_mir_transform / src / marker.rs
CommitLineData
a2a8927a
XL
1use std::borrow::Cow;
2
3use crate::MirPass;
4use rustc_middle::mir::{Body, MirPhase};
5use rustc_middle::ty::TyCtxt;
6
7/// Changes the MIR phase without changing the MIR itself.
8pub struct PhaseChange(pub MirPhase);
9
10impl<'tcx> MirPass<'tcx> for PhaseChange {
11 fn phase_change(&self) -> Option<MirPhase> {
12 Some(self.0)
13 }
14
15 fn name(&self) -> Cow<'_, str> {
16 Cow::from(format!("PhaseChange-{:?}", self.0))
17 }
18
19 fn run_pass(&self, _: TyCtxt<'tcx>, _body: &mut Body<'tcx>) {}
20}