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
Auto merge of rust-lang#2369 - RalfJung:reborrow, r=RalfJung
reborrow error: clarify that we are reborrowing *from* that tag
`@saethlin` I found the current message not entirely clear, so what do you think about this?
Copy file name to clipboardExpand all lines: tests/fail/box-cell-alias.stderr
+2-2
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
-
error: Undefined Behavior: trying to reborrow <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
1
+
error: Undefined Behavior: trying to reborrow from <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
2
2
--> $DIR/box-cell-alias.rs:LL:CC
3
3
|
4
4
LL | unsafe { (*ptr).set(20) };
5
5
| ^^^^^^^^^^^^^^
6
6
| |
7
-
| trying to reborrow <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
7
+
| trying to reborrow from <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
8
8
| this error occurs as part of a reborrow at ALLOC[0x0..0x1]
9
9
|
10
10
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
Copy file name to clipboardExpand all lines: tests/fail/stacked_borrows/aliasing_mut3.stderr
+2-2
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
-
error: Undefined Behavior: trying to reborrow <TAG> for SharedReadOnly permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
1
+
error: Undefined Behavior: trying to reborrow from <TAG> for SharedReadOnly permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
2
2
--> $DIR/aliasing_mut3.rs:LL:CC
3
3
|
4
4
LL | pub fn safe(_x: &mut i32, _y: &i32) {}
5
5
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6
6
| |
7
-
| trying to reborrow <TAG> for SharedReadOnly permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
7
+
| trying to reborrow from <TAG> for SharedReadOnly permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
8
8
| this error occurs as part of a reborrow at ALLOC[0x0..0x4]
9
9
|
10
10
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
Copy file name to clipboardExpand all lines: tests/fail/stacked_borrows/buggy_split_at_mut.stderr
+2-2
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
-
error: Undefined Behavior: trying to reborrow <TAG> for Unique permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
1
+
error: Undefined Behavior: trying to reborrow 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
4
LL | let (a, b) = safe::split_at_mut(&mut array, 0);
5
5
| ^
6
6
| |
7
-
| trying to reborrow <TAG> for Unique permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
7
+
| trying to reborrow from <TAG> for Unique permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
8
8
| this error occurs as part of a reborrow at ALLOC[0x0..0x10]
9
9
|
10
10
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
Copy file name to clipboardExpand all lines: tests/fail/stacked_borrows/illegal_read7.stderr
+2-2
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
-
error: Undefined Behavior: trying to reborrow <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
1
+
error: Undefined Behavior: trying to reborrow from <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
2
2
--> $DIR/illegal_read7.rs:LL:CC
3
3
|
4
4
LL | let _val = *x.get_mut();
5
5
| ^^^^^^^^^^^
6
6
| |
7
-
| trying to reborrow <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
7
+
| trying to reborrow from <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
8
8
| this error occurs as part of a reborrow at ALLOC[0x0..0x4]
9
9
|
10
10
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
Copy file name to clipboardExpand all lines: tests/fail/stacked_borrows/interior_mut1.stderr
+2-2
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
-
error: Undefined Behavior: trying to reborrow <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
1
+
error: Undefined Behavior: trying to reborrow from <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
2
2
--> $DIR/interior_mut1.rs:LL:CC
3
3
|
4
4
LL | let _val = *inner_shr.get();
5
5
| ^^^^^^^^^^^^^^^
6
6
| |
7
-
| trying to reborrow <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
7
+
| trying to reborrow from <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
8
8
| this error occurs as part of a reborrow at ALLOC[0x0..0x4]
9
9
|
10
10
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
Copy file name to clipboardExpand all lines: tests/fail/stacked_borrows/interior_mut2.stderr
+2-2
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
-
error: Undefined Behavior: trying to reborrow <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
1
+
error: Undefined Behavior: trying to reborrow from <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
2
2
--> $DIR/interior_mut2.rs:LL:CC
3
3
|
4
4
LL | let _val = *inner_shr.get();
5
5
| ^^^^^^^^^^^^^^^
6
6
| |
7
-
| trying to reborrow <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
7
+
| trying to reborrow from <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
8
8
| this error occurs as part of a reborrow at ALLOC[0x0..0x4]
9
9
|
10
10
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
Copy file name to clipboardExpand all lines: tests/fail/stacked_borrows/load_invalid_mut.stderr
+2-2
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
-
error: Undefined Behavior: trying to reborrow <TAG> for Unique permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
1
+
error: Undefined Behavior: trying to reborrow from <TAG> for Unique permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
2
2
--> $DIR/load_invalid_mut.rs:LL:CC
3
3
|
4
4
LL | let _val = *xref_in_mem;
5
5
| ^^^^^^^^^^^^
6
6
| |
7
-
| trying to reborrow <TAG> for Unique permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
7
+
| trying to reborrow from <TAG> for Unique permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
8
8
| this error occurs as part of a reborrow at ALLOC[0x0..0x4]
9
9
|
10
10
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
Copy file name to clipboardExpand all lines: tests/fail/stacked_borrows/load_invalid_shr.stderr
+2-2
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
-
error: Undefined Behavior: trying to reborrow <TAG> for SharedReadOnly permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
1
+
error: Undefined Behavior: trying to reborrow from <TAG> for SharedReadOnly permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
2
2
--> $DIR/load_invalid_shr.rs:LL:CC
3
3
|
4
4
LL | let _val = *xref_in_mem;
5
5
| ^^^^^^^^^^^^
6
6
| |
7
-
| trying to reborrow <TAG> for SharedReadOnly permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
7
+
| trying to reborrow from <TAG> for SharedReadOnly permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
8
8
| this error occurs as part of a reborrow at ALLOC[0x0..0x4]
9
9
|
10
10
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
Copy file name to clipboardExpand all lines: tests/fail/stacked_borrows/pass_invalid_mut.stderr
+2-2
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
-
error: Undefined Behavior: trying to reborrow <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
1
+
error: Undefined Behavior: trying to reborrow from <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
2
2
--> $DIR/pass_invalid_mut.rs:LL:CC
3
3
|
4
4
LL | foo(xref);
5
5
| ^^^^
6
6
| |
7
-
| trying to reborrow <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
7
+
| trying to reborrow from <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
8
8
| this error occurs as part of a reborrow at ALLOC[0x0..0x4]
9
9
|
10
10
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
Copy file name to clipboardExpand all lines: tests/fail/stacked_borrows/pass_invalid_shr.stderr
+2-2
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
-
error: Undefined Behavior: trying to reborrow <TAG> for SharedReadOnly permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
1
+
error: Undefined Behavior: trying to reborrow from <TAG> for SharedReadOnly permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
2
2
--> $DIR/pass_invalid_shr.rs:LL:CC
3
3
|
4
4
LL | foo(xref);
5
5
| ^^^^
6
6
| |
7
-
| trying to reborrow <TAG> for SharedReadOnly permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
7
+
| trying to reborrow from <TAG> for SharedReadOnly permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
8
8
| this error occurs as part of a reborrow at ALLOC[0x0..0x4]
9
9
|
10
10
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
Copy file name to clipboardExpand all lines: tests/fail/stacked_borrows/return_invalid_mut.stderr
+2-2
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
-
error: Undefined Behavior: trying to reborrow <TAG> for Unique permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
1
+
error: Undefined Behavior: trying to reborrow from <TAG> for Unique permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
2
2
--> $DIR/return_invalid_mut.rs:LL:CC
3
3
|
4
4
LL | ret
5
5
| ^^^
6
6
| |
7
-
| trying to reborrow <TAG> for Unique permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
7
+
| trying to reborrow from <TAG> for Unique permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
8
8
| this error occurs as part of a reborrow at ALLOC[0x4..0x8]
9
9
|
10
10
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
Copy file name to clipboardExpand all lines: tests/fail/stacked_borrows/return_invalid_mut_option.stderr
+2-2
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
-
error: Undefined Behavior: trying to reborrow <TAG> for Unique permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
1
+
error: Undefined Behavior: trying to reborrow from <TAG> for Unique permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
2
2
--> $DIR/return_invalid_mut_option.rs:LL:CC
3
3
|
4
4
LL | Some(_x) => {}
5
5
| ^^
6
6
| |
7
-
| trying to reborrow <TAG> for Unique permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
7
+
| trying to reborrow from <TAG> for Unique permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
8
8
| this error occurs as part of a reborrow at ALLOC[0x4..0x8]
9
9
|
10
10
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
Copy file name to clipboardExpand all lines: tests/fail/stacked_borrows/return_invalid_mut_tuple.stderr
+2-2
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
-
error: Undefined Behavior: trying to reborrow <TAG> for Unique permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
1
+
error: Undefined Behavior: trying to reborrow from <TAG> for Unique permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
2
2
--> $DIR/return_invalid_mut_tuple.rs:LL:CC
3
3
|
4
4
LL | foo(&mut (1, 2)).0;
5
5
| ^^^^^^^^^^^^^^^^^^
6
6
| |
7
-
| trying to reborrow <TAG> for Unique permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
7
+
| trying to reborrow from <TAG> for Unique permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
8
8
| this error occurs as part of a reborrow at ALLOC[0x4..0x8]
9
9
|
10
10
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
Copy file name to clipboardExpand all lines: tests/fail/stacked_borrows/return_invalid_shr.stderr
+2-2
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
-
error: Undefined Behavior: trying to reborrow <TAG> for SharedReadOnly permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
1
+
error: Undefined Behavior: trying to reborrow from <TAG> for SharedReadOnly permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
2
2
--> $DIR/return_invalid_shr.rs:LL:CC
3
3
|
4
4
LL | ret
5
5
| ^^^
6
6
| |
7
-
| trying to reborrow <TAG> for SharedReadOnly permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
7
+
| trying to reborrow from <TAG> for SharedReadOnly permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
8
8
| this error occurs as part of a reborrow at ALLOC[0x4..0x8]
9
9
|
10
10
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
Copy file name to clipboardExpand all lines: tests/fail/stacked_borrows/return_invalid_shr_option.stderr
+2-2
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
-
error: Undefined Behavior: trying to reborrow <TAG> for SharedReadOnly permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
1
+
error: Undefined Behavior: trying to reborrow from <TAG> for SharedReadOnly permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
2
2
--> $DIR/return_invalid_shr_option.rs:LL:CC
3
3
|
4
4
LL | Some(_x) => {}
5
5
| ^^
6
6
| |
7
-
| trying to reborrow <TAG> for SharedReadOnly permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
7
+
| trying to reborrow from <TAG> for SharedReadOnly permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
8
8
| this error occurs as part of a reborrow at ALLOC[0x4..0x8]
9
9
|
10
10
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
Copy file name to clipboardExpand all lines: tests/fail/stacked_borrows/return_invalid_shr_tuple.stderr
+2-2
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
-
error: Undefined Behavior: trying to reborrow <TAG> for SharedReadOnly permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
1
+
error: Undefined Behavior: trying to reborrow from <TAG> for SharedReadOnly permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
2
2
--> $DIR/return_invalid_shr_tuple.rs:LL:CC
3
3
|
4
4
LL | foo(&mut (1, 2)).0;
5
5
| ^^^^^^^^^^^^^^^^^^
6
6
| |
7
-
| trying to reborrow <TAG> for SharedReadOnly permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
7
+
| trying to reborrow from <TAG> for SharedReadOnly permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
8
8
| this error occurs as part of a reborrow at ALLOC[0x4..0x8]
9
9
|
10
10
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
Copy file name to clipboardExpand all lines: tests/fail/stacked_borrows/shared_rw_borrows_are_weak1.stderr
+2-2
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
-
error: Undefined Behavior: trying to reborrow <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
1
+
error: Undefined Behavior: trying to reborrow from <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
2
2
--> $DIR/shared_rw_borrows_are_weak1.rs:LL:CC
3
3
|
4
4
LL | y.get_mut();
5
5
| ^^^^^^^^^^^
6
6
| |
7
-
| trying to reborrow <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
7
+
| trying to reborrow from <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
8
8
| this error occurs as part of a reborrow at ALLOC[0x0..0x4]
9
9
|
10
10
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
Copy file name to clipboardExpand all lines: tests/fail/stacked_borrows/zst_slice.stderr
+2-2
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
-
error: Undefined Behavior: trying to reborrow <TAG> for SharedReadOnly permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
1
+
error: Undefined Behavior: trying to reborrow from <TAG> for SharedReadOnly permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
2
2
--> RUSTLIB/core/src/slice/mod.rs:LL:CC
3
3
|
4
4
LL | unsafe { &*index.get_unchecked(self) }
5
5
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
6
6
| |
7
-
| trying to reborrow <TAG> for SharedReadOnly permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
7
+
| trying to reborrow from <TAG> for SharedReadOnly permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
8
8
| this error occurs as part of a reborrow at ALLOC[0x4..0x8]
9
9
|
10
10
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
0 commit comments