You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/fail/both_borrows/buggy_split_at_mut.stack.stderr
+14-6Lines changed: 14 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,14 @@
1
1
error: Undefined Behavior: trying to retag from <TAG> for Unique permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
2
2
--> $DIR/buggy_split_at_mut.rs:LL:CC
3
3
|
4
-
LL | let (a, b) = safe::split_at_mut(&mut array, 0);
5
-
| ^
6
-
| |
7
-
| trying to retag from <TAG> for Unique permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
8
-
| this error occurs as part of retag at ALLOC[0x0..0x10]
4
+
LL | / (
5
+
LL | | from_raw_parts_mut(ptr, len - mid), // BUG: should be "mid" instead of "len - mid"
6
+
LL | | from_raw_parts_mut(ptr.offset(mid as isize), len - mid),
7
+
LL | | )
8
+
| | ^
9
+
| | |
10
+
| |_____________trying to retag from <TAG> for Unique permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
11
+
| this error occurs as part of retag at ALLOC[0x0..0x10]
9
12
|
10
13
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
11
14
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
@@ -20,7 +23,12 @@ help: <TAG> was later invalidated at offsets [0x0..0x10] by a Unique retag
20
23
LL | from_raw_parts_mut(ptr.offset(mid as isize), len - mid),
0 commit comments