1
Fork 0

validate: use the correct reveal during opts

This commit is contained in:
lcnr 2022-12-08 11:24:25 +01:00
parent f5418b09e8
commit dd9d05cec4
2 changed files with 13 additions and 1 deletions

View file

@ -6,6 +6,7 @@
use super::{BasicBlock, Constant, Field, Local, SwitchTargets, UserTypeProjection};
use crate::mir::coverage::{CodeRegion, CoverageKind};
use crate::traits::Reveal;
use crate::ty::adjustment::PointerCast;
use crate::ty::subst::SubstsRef;
use crate::ty::{self, List, Ty};
@ -100,6 +101,13 @@ impl MirPhase {
MirPhase::Runtime(RuntimePhase::Optimized) => "runtime-optimized",
}
}
pub fn reveal(&self) -> Reveal {
match *self {
MirPhase::Built | MirPhase::Analysis(_) => Reveal::UserFacing,
MirPhase::Runtime(_) => Reveal::All,
}
}
}
/// See [`MirPhase::Analysis`].