Auto merge of #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?
This commit is contained in:
bors 2022-07-14 00:04:40 +00:00
commit e16705de25
20 changed files with 37 additions and 37 deletions

View file

@ -140,7 +140,7 @@ impl AllocHistory {
stack: &Stack,
) -> InterpError<'tcx> {
let action = format!(
"trying to reborrow {derived_from:?} for {new_perm:?} permission at {alloc_id:?}[{offset:#x}]",
"trying to reborrow from {derived_from:?} for {new_perm:?} permission at {alloc_id:?}[{offset:#x}]",
new_perm = new.perm(),
offset = error_offset.bytes(),
);

View file

@ -1,10 +1,10 @@
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
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
--> $DIR/box-cell-alias.rs:LL:CC
|
LL | unsafe { (*ptr).set(20) };
| ^^^^^^^^^^^^^^
| |
| trying to reborrow <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
| trying to reborrow from <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
| this error occurs as part of a reborrow at ALLOC[0x0..0x1]
|
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental

View file

@ -1,10 +1,10 @@
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
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
--> $DIR/aliasing_mut3.rs:LL:CC
|
LL | pub fn safe(_x: &mut i32, _y: &i32) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| trying to reborrow <TAG> for SharedReadOnly permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
| trying to reborrow from <TAG> for SharedReadOnly permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
| this error occurs as part of a reborrow at ALLOC[0x0..0x4]
|
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental

View file

@ -1,10 +1,10 @@
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
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
--> $DIR/buggy_split_at_mut.rs:LL:CC
|
LL | let (a, b) = safe::split_at_mut(&mut array, 0);
| ^
| |
| trying to reborrow <TAG> for Unique permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
| trying to reborrow from <TAG> for Unique permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
| this error occurs as part of a reborrow at ALLOC[0x0..0x10]
|
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental

View file

@ -1,10 +1,10 @@
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
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
--> $DIR/illegal_read7.rs:LL:CC
|
LL | let _val = *x.get_mut();
| ^^^^^^^^^^^
| |
| trying to reborrow <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
| trying to reborrow from <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
| this error occurs as part of a reborrow at ALLOC[0x0..0x4]
|
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental

View file

@ -1,10 +1,10 @@
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
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
--> $DIR/interior_mut1.rs:LL:CC
|
LL | let _val = *inner_shr.get();
| ^^^^^^^^^^^^^^^
| |
| trying to reborrow <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
| trying to reborrow from <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
| this error occurs as part of a reborrow at ALLOC[0x0..0x4]
|
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental

View file

@ -1,10 +1,10 @@
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
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
--> $DIR/interior_mut2.rs:LL:CC
|
LL | let _val = *inner_shr.get();
| ^^^^^^^^^^^^^^^
| |
| trying to reborrow <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
| trying to reborrow from <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
| this error occurs as part of a reborrow at ALLOC[0x0..0x4]
|
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental

View file

@ -1,10 +1,10 @@
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
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
--> $DIR/load_invalid_mut.rs:LL:CC
|
LL | let _val = *xref_in_mem;
| ^^^^^^^^^^^^
| |
| trying to reborrow <TAG> for Unique permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
| trying to reborrow from <TAG> for Unique permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
| this error occurs as part of a reborrow at ALLOC[0x0..0x4]
|
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental

View file

@ -1,10 +1,10 @@
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
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
--> $DIR/load_invalid_shr.rs:LL:CC
|
LL | let _val = *xref_in_mem;
| ^^^^^^^^^^^^
| |
| trying to reborrow <TAG> for SharedReadOnly permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
| trying to reborrow from <TAG> for SharedReadOnly permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
| this error occurs as part of a reborrow at ALLOC[0x0..0x4]
|
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental

View file

@ -1,10 +1,10 @@
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
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
--> $DIR/pass_invalid_mut.rs:LL:CC
|
LL | foo(xref);
| ^^^^
| |
| trying to reborrow <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
| trying to reborrow from <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
| this error occurs as part of a reborrow at ALLOC[0x0..0x4]
|
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental

View file

@ -1,10 +1,10 @@
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
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
--> $DIR/pass_invalid_shr.rs:LL:CC
|
LL | foo(xref);
| ^^^^
| |
| trying to reborrow <TAG> for SharedReadOnly permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
| trying to reborrow from <TAG> for SharedReadOnly permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
| this error occurs as part of a reborrow at ALLOC[0x0..0x4]
|
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental

View file

@ -1,10 +1,10 @@
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
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
--> $DIR/return_invalid_mut.rs:LL:CC
|
LL | ret
| ^^^
| |
| trying to reborrow <TAG> for Unique permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
| trying to reborrow from <TAG> for Unique permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
| this error occurs as part of a reborrow at ALLOC[0x4..0x8]
|
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental

View file

@ -1,10 +1,10 @@
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
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
--> $DIR/return_invalid_mut_option.rs:LL:CC
|
LL | Some(_x) => {}
| ^^
| |
| trying to reborrow <TAG> for Unique permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
| trying to reborrow from <TAG> for Unique permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
| this error occurs as part of a reborrow at ALLOC[0x4..0x8]
|
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental

View file

@ -1,10 +1,10 @@
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
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
--> $DIR/return_invalid_mut_tuple.rs:LL:CC
|
LL | foo(&mut (1, 2)).0;
| ^^^^^^^^^^^^^^^^^^
| |
| trying to reborrow <TAG> for Unique permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
| trying to reborrow from <TAG> for Unique permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
| this error occurs as part of a reborrow at ALLOC[0x4..0x8]
|
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental

View file

@ -1,10 +1,10 @@
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
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
--> $DIR/return_invalid_shr.rs:LL:CC
|
LL | ret
| ^^^
| |
| trying to reborrow <TAG> for SharedReadOnly permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
| trying to reborrow from <TAG> for SharedReadOnly permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
| this error occurs as part of a reborrow at ALLOC[0x4..0x8]
|
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental

View file

@ -1,10 +1,10 @@
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
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
--> $DIR/return_invalid_shr_option.rs:LL:CC
|
LL | Some(_x) => {}
| ^^
| |
| trying to reborrow <TAG> for SharedReadOnly permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
| trying to reborrow from <TAG> for SharedReadOnly permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
| this error occurs as part of a reborrow at ALLOC[0x4..0x8]
|
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental

View file

@ -1,10 +1,10 @@
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
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
--> $DIR/return_invalid_shr_tuple.rs:LL:CC
|
LL | foo(&mut (1, 2)).0;
| ^^^^^^^^^^^^^^^^^^
| |
| trying to reborrow <TAG> for SharedReadOnly permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
| trying to reborrow from <TAG> for SharedReadOnly permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
| this error occurs as part of a reborrow at ALLOC[0x4..0x8]
|
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental

View file

@ -1,10 +1,10 @@
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
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
--> $DIR/shared_rw_borrows_are_weak1.rs:LL:CC
|
LL | y.get_mut();
| ^^^^^^^^^^^
| |
| trying to reborrow <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
| trying to reborrow from <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location
| this error occurs as part of a reborrow at ALLOC[0x0..0x4]
|
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental

View file

@ -1,10 +1,10 @@
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
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
--> RUSTLIB/core/src/slice/mod.rs:LL:CC
|
LL | unsafe { &*index.get_unchecked(self) }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| trying to reborrow <TAG> for SharedReadOnly permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
| trying to reborrow from <TAG> for SharedReadOnly permission at ALLOC[0x4], but that tag does not exist in the borrow stack for this location
| this error occurs as part of a reborrow at ALLOC[0x4..0x8]
|
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental