File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
src/borrow_tracker/tree_borrows Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -28,8 +28,11 @@ impl fmt::Display for AccessCause {
2828 Self :: Explicit ( kind) => write ! ( f, "{kind}" ) ,
2929 Self :: Reborrow => write ! ( f, "reborrow" ) ,
3030 Self :: Dealloc => write ! ( f, "deallocation" ) ,
31- Self :: FnExit ( AccessKind :: Read ) => write ! ( f, "protector release read" ) ,
32- Self :: FnExit ( AccessKind :: Write ) => write ! ( f, "protector release write" ) ,
31+ // This is dead code, since the protector release access itself can never
32+ // cause UB (while the protector is active, if some other access invalidates
33+ // further use of the protected tag, that is immediate UB).
34+ // Describing the cause of UB is the only time this function is called.
35+ Self :: FnExit ( _) => unreachable ! ( "protector accesses can never be the source of UB" ) ,
3336 }
3437 }
3538}
You can’t perform that action at this time.
0 commit comments