Issue 3223: make unsafe scopes tighter
This commit is contained in:
@@ -496,14 +496,13 @@ impl Arena {
|
||||
}
|
||||
}
|
||||
|
||||
unsafe fn drop_slab_in_place(value: NonNull<AllocSlab>, tag: ArenaHeaderTag) {
|
||||
unsafe {
|
||||
unsafe fn drop_slab_in_place(value: NonNull<AllocSlab>, tag: ArenaHeaderTag) {
|
||||
macro_rules! drop_typed_slab_in_place {
|
||||
($payload: ty, $value: expr) => {
|
||||
<$payload as ArenaAllocated>::dealloc($value.cast::<TypedAllocSlab<$payload>>())
|
||||
};
|
||||
}
|
||||
|
||||
unsafe {
|
||||
match tag {
|
||||
ArenaHeaderTag::Integer => {
|
||||
drop_typed_slab_in_place!(Integer, value);
|
||||
|
||||
Reference in New Issue
Block a user