TB: protector end semantics never causes immediate UB
This commit is contained in:
parent
0a86e79664
commit
02bec40930
@ -28,8 +28,11 @@ impl fmt::Display for AccessCause {
|
||||
Self::Explicit(kind) => write!(f, "{kind}"),
|
||||
Self::Reborrow => write!(f, "reborrow"),
|
||||
Self::Dealloc => write!(f, "deallocation"),
|
||||
Self::FnExit(AccessKind::Read) => write!(f, "protector release read"),
|
||||
Self::FnExit(AccessKind::Write) => write!(f, "protector release write"),
|
||||
// This is dead code, since the protector release access itself can never
|
||||
// cause UB (while the protector is active, if some other access invalidates
|
||||
// further use of the protected tag, that is immediate UB).
|
||||
// Describing the cause of UB is the only time this function is called.
|
||||
Self::FnExit(_) => unreachable!("protector accesses can never be the source of UB"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user