Fix unsafetyck disabling for custom MIR
This commit is contained in:
@@ -533,6 +533,11 @@ impl<'tcx> Body<'tcx> {
|
||||
};
|
||||
injection_phase > self.phase
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn is_custom_mir(&self) -> bool {
|
||||
self.injection_phase.is_some()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Debug, TyEncodable, TyDecodable, HashStable)]
|
||||
|
||||
@@ -500,7 +500,7 @@ fn unsafety_check_result<'tcx>(
|
||||
// `mir_built` force this.
|
||||
let body = &tcx.mir_built(def).borrow();
|
||||
|
||||
if body.should_skip() {
|
||||
if body.is_custom_mir() {
|
||||
return tcx.arena.alloc(UnsafetyCheckResult {
|
||||
violations: Vec::new(),
|
||||
used_unsafe_blocks: FxHashSet::default(),
|
||||
|
||||
Reference in New Issue
Block a user