This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +26
-1
lines changed
src/borrow_tracker/tree_borrows Expand file tree Collapse file tree 3 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -173,7 +173,7 @@ impl<'tcx> NewPermission {
173173 pointee. is_unpin ( * cx. tcx , cx. typing_env ( ) ) . then_some ( ( ) ) . map ( |( ) | {
174174 // Regular `Unpin` box, give it `noalias` but only a weak protector
175175 // because it is valid to deallocate it within the function.
176- let ty_is_freeze = ty . is_freeze ( * cx. tcx , cx. typing_env ( ) ) ;
176+ let ty_is_freeze = pointee . is_freeze ( * cx. tcx , cx. typing_env ( ) ) ;
177177 let protected = kind == RetagKind :: FnEntry ;
178178 let initial_state = Permission :: new_reserved ( ty_is_freeze, protected) ;
179179 Self {
Original file line number Diff line number Diff line change 1+ //@compile-flags: -Zmiri-tree-borrows
2+ #![ feature( box_as_ptr) ]
3+ #[ path = "../../utils/mod.rs" ]
4+ #[ macro_use]
5+ mod utils;
6+
7+ use std:: cell:: UnsafeCell ;
8+
9+ pub fn main ( ) {
10+ let cell = UnsafeCell :: new ( 42 ) ;
11+ let mut root = Box :: new ( cell) ;
12+
13+ let a = Box :: as_mut_ptr ( & mut root) ;
14+ unsafe {
15+ name ! ( a) ;
16+ let alloc_id = alloc_id ! ( a) ;
17+ print_state ! ( alloc_id) ;
18+ }
19+ }
Original file line number Diff line number Diff line change 1+ ──────────────────────────────────────────────────
2+ Warning: this tree is indicative only. Some tags may have been hidden.
3+ 0.. 4
4+ | Act | └─┬──<TAG=root of the allocation>
5+ | ReIM| └────<TAG=a>
6+ ──────────────────────────────────────────────────
You can’t perform that action at this time.
0 commit comments