Skip to content

Commit 14f9284

Browse files
committed
fix tree borrows Unique test
1 parent 7383401 commit 14f9284

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

src/tools/miri/tests/pass/tree_borrows/vec_unique.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// FIXME: This test is broken since https://github.com/rust-lang/rust/pull/126793,
2-
// possibly related to the additional struct between Vec and Unique.
31
//@revisions: default uniq
42
// We disable the GC for this test because it would change what is printed.
53
//@compile-flags: -Zmiri-tree-borrows -Zmiri-provenance-gc=0
@@ -32,20 +30,20 @@ fn main() {
3230
// whether we got the distance correct:
3331
// If the output shows
3432
//
35-
// |- <XYZ: uniq>
36-
// '- <XYZ: uniq>
33+
// ├─ <TAG=base.as_ptr()>
34+
// └─ <TAG=base.as_ptr()>
3735
//
3836
// then `nth_parent` is not big enough.
3937
// The correct value for `nth_parent` should be the minimum
4038
// integer for which the output shows
4139
//
42-
// '- <XYZ: uniq, uniq>
40+
// └─ <TAG=base.as_ptr(), base.as_ptr(), ...>
4341
// )
4442
//
4543
// Ultimately we want pointers obtained through independent
4644
// calls of `as_ptr` to be able to alias, which will probably involve
4745
// a new permission that allows aliasing when there is no protector.
48-
let nth_parent = if cfg!(uniq) { 2 } else { 0 };
46+
let nth_parent = if cfg!(uniq) { 9 } else { 0 };
4947
name!(base.as_ptr()=>nth_parent);
5048
name!(base.as_ptr()=>nth_parent);
5149

src/tools/miri/tests/pass/tree_borrows/vec_unique.uniq.stderr

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
Warning: this tree is indicative only. Some tags may have been hidden.
33
0.. 2
44
| Act | └─┬──<TAG=root of the allocation>
5-
|-----| ├────<TAG=base.as_ptr()>
6-
|-----| ├────<TAG=base.as_ptr()>
7-
|-----| └─┬──<TAG=raw_parts.0>
8-
|-----| ├────<TAG=reconstructed.as_ptr()>
9-
|-----| └────<TAG=reconstructed.as_ptr()>
5+
|-----| └─┬──<TAG=base.as_ptr(), base.as_ptr()>
6+
|-----| └─┬──<TAG=raw_parts.0>
7+
|-----| └────<TAG=reconstructed.as_ptr(), reconstructed.as_ptr()>
108
──────────────────────────────────────────────────

0 commit comments

Comments
 (0)