Skip to content

Commit

Permalink
Adjust stderr for #1971
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Mar 17, 2022
1 parent 08d4fdd commit d6dd8a9
Show file tree
Hide file tree
Showing 43 changed files with 219 additions and 90 deletions.
9 changes: 6 additions & 3 deletions tests/ui/box-cell-alias.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
error: Undefined Behavior: trying to reborrow for SharedReadWrite at alloc978, but parent tag <2075> does not have an appropriate item in the borrow stack
error: Undefined Behavior: trying to reborrow <2075> for SharedReadWrite permission at alloc978[0x0], but that tag does not exist in the borrow stack for this location
--> $DIR/box-cell-alias.rs:9:14
|
9 | unsafe { (*ptr).set(20); } //~ ERROR does not have an appropriate item in the borrow stack
| ^^^^^^^^^^^^^^ trying to reborrow for SharedReadWrite at alloc978, but parent tag <2075> does not have an appropriate item in the borrow stack
9 | unsafe { (*ptr).set(20); } //~ ERROR does not exist in the borrow stack
| ^^^^^^^^^^^^^^
| |
| trying to reborrow <2075> for SharedReadWrite permission at alloc978[0x0], but that tag does not exist in the borrow stack for this location
| this error occurs as part of a reborrow at alloc978[0x0..0x1]
|
= help: this indicates a potential bug in the program: it performed an invalid operation, but the rules it violated are still experimental
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
Expand Down
7 changes: 5 additions & 2 deletions tests/ui/stacked_borrows/alias_through_mutation.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
error: Undefined Behavior: no item granting read access to tag <1912> at alloc955 found in borrow stack.
error: Undefined Behavior: attempting a read access using <1912> at alloc955[0x0], but that tag does not exist in the borrow stack for this location
--> $DIR/alias_through_mutation.rs:12:16
|
12 | let _val = *target_alias; //~ ERROR borrow stack
| ^^^^^^^^^^^^^ no item granting read access to tag <1912> at alloc955 found in borrow stack.
| ^^^^^^^^^^^^^
| |
| attempting a read access using <1912> at alloc955[0x0], but that tag does not exist in the borrow stack for this location
| this error occurs as part of an access at alloc955[0x0..0x4]
|
= help: this indicates a potential bug in the program: it performed an invalid operation, but the rules it violated are still experimental
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
Expand Down
7 changes: 5 additions & 2 deletions tests/ui/stacked_borrows/aliasing_mut3.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
error: Undefined Behavior: trying to reborrow for SharedReadOnly at alloc954, but parent tag <untagged> does not have an appropriate item in the borrow stack
error: Undefined Behavior: trying to reborrow <untagged> for SharedReadOnly permission at alloc954[0x0], but that tag does not exist in the borrow stack for this location
--> $DIR/aliasing_mut3.rs:3:1
|
3 | pub fn safe(_x: &mut i32, _y: &i32) {} //~ ERROR borrow stack
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trying to reborrow for SharedReadOnly at alloc954, but parent tag <untagged> does not have an appropriate item in the borrow stack
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| trying to reborrow <untagged> for SharedReadOnly permission at alloc954[0x0], but that tag does not exist in the borrow stack for this location
| this error occurs as part of a reborrow at alloc954[0x0..0x4]
|
= help: this indicates a potential bug in the program: it performed an invalid operation, but the rules it violated are still experimental
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
Expand Down
7 changes: 5 additions & 2 deletions tests/ui/stacked_borrows/box_exclusive_violation1.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
error: Undefined Behavior: no item granting read access to tag <1990> at alloc970 found in borrow stack.
error: Undefined Behavior: attempting a read access using <1990> at alloc970[0x0], but that tag does not exist in the borrow stack for this location
--> $DIR/box_exclusive_violation1.rs:11:3
|
11 | *our //~ ERROR borrow stack
| ^^^^ no item granting read access to tag <1990> at alloc970 found in borrow stack.
| ^^^^
| |
| attempting a read access using <1990> at alloc970[0x0], but that tag does not exist in the borrow stack for this location
| this error occurs as part of an access at alloc970[0x0..0x4]
|
= help: this indicates a potential bug in the program: it performed an invalid operation, but the rules it violated are still experimental
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
Expand Down
7 changes: 5 additions & 2 deletions tests/ui/stacked_borrows/buggy_as_mut_slice.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
error: Undefined Behavior: no item granting write access to tag <2098> at alloc967+0x4 found in borrow stack.
error: Undefined Behavior: attempting a write access using <2098> at alloc967[0x4], but that tag does not exist in the borrow stack for this location
--> $DIR/buggy_as_mut_slice.rs:15:5
|
15 | v1[1] = 5;
| ^^^^^^^^^ no item granting write access to tag <2098> at alloc967+0x4 found in borrow stack.
| ^^^^^^^^^
| |
| attempting a write access using <2098> at alloc967[0x4], but that tag does not exist in the borrow stack for this location
| this error occurs as part of an access at alloc967[0x4..0x8]
|
= help: this indicates a potential bug in the program: it performed an invalid operation, but the rules it violated are still experimental
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
Expand Down
7 changes: 5 additions & 2 deletions tests/ui/stacked_borrows/buggy_split_at_mut.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
error: Undefined Behavior: trying to reborrow for Unique at alloc953, but parent tag <1931> does not have an appropriate item in the borrow stack
error: Undefined Behavior: trying to reborrow <1931> for Unique permission at alloc953[0x0], but that tag does not exist in the borrow stack for this location
--> $DIR/buggy_split_at_mut.rs:19:10
|
19 | let (a, b) = safe::split_at_mut(&mut array, 0);
| ^ trying to reborrow for Unique at alloc953, but parent tag <1931> does not have an appropriate item in the borrow stack
| ^
| |
| trying to reborrow <1931> for Unique permission at alloc953[0x0], but that tag does not exist in the borrow stack for this location
| this error occurs as part of a reborrow at alloc953[0x0..0x10]
|
= help: this indicates a potential bug in the program: it performed an invalid operation, but the rules it violated are still experimental
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
Expand Down
7 changes: 5 additions & 2 deletions tests/ui/stacked_borrows/illegal_read1.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
error: Undefined Behavior: no item granting read access to tag <1903> at alloc953 found in borrow stack.
error: Undefined Behavior: attempting a read access using <1903> at alloc953[0x0], but that tag does not exist in the borrow stack for this location
--> $DIR/illegal_read1.rs:9:16
|
9 | let _val = *xref; // ...but any use of raw will invalidate our ref.
| ^^^^^ no item granting read access to tag <1903> at alloc953 found in borrow stack.
| ^^^^^
| |
| attempting a read access using <1903> at alloc953[0x0], but that tag does not exist in the borrow stack for this location
| this error occurs as part of an access at alloc953[0x0..0x4]
|
= help: this indicates a potential bug in the program: it performed an invalid operation, but the rules it violated are still experimental
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
Expand Down
7 changes: 5 additions & 2 deletions tests/ui/stacked_borrows/illegal_read2.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
error: Undefined Behavior: no item granting read access to tag <1903> at alloc953 found in borrow stack.
error: Undefined Behavior: attempting a read access using <1903> at alloc953[0x0], but that tag does not exist in the borrow stack for this location
--> $DIR/illegal_read2.rs:9:16
|
9 | let _val = *xref; // ...but any use of raw will invalidate our ref.
| ^^^^^ no item granting read access to tag <1903> at alloc953 found in borrow stack.
| ^^^^^
| |
| attempting a read access using <1903> at alloc953[0x0], but that tag does not exist in the borrow stack for this location
| this error occurs as part of an access at alloc953[0x0..0x4]
|
= help: this indicates a potential bug in the program: it performed an invalid operation, but the rules it violated are still experimental
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
Expand Down
7 changes: 5 additions & 2 deletions tests/ui/stacked_borrows/illegal_read3.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
error: Undefined Behavior: no item granting read access to tag <1925> at alloc953 found in borrow stack.
error: Undefined Behavior: attempting a read access using <1925> at alloc953[0x0], but that tag does not exist in the borrow stack for this location
--> $DIR/illegal_read3.rs:17:16
|
17 | let _val = *xref2;
| ^^^^^^ no item granting read access to tag <1925> at alloc953 found in borrow stack.
| ^^^^^^
| |
| attempting a read access using <1925> at alloc953[0x0], but that tag does not exist in the borrow stack for this location
| this error occurs as part of an access at alloc953[0x0..0x4]
|
= help: this indicates a potential bug in the program: it performed an invalid operation, but the rules it violated are still experimental
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
Expand Down
7 changes: 5 additions & 2 deletions tests/ui/stacked_borrows/illegal_read4.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
error: Undefined Behavior: no item granting read access to tag <1903> at alloc953 found in borrow stack.
error: Undefined Behavior: attempting a read access using <1903> at alloc953[0x0], but that tag does not exist in the borrow stack for this location
--> $DIR/illegal_read4.rs:8:20
|
8 | let _illegal = *xref2; //~ ERROR borrow stack
| ^^^^^^ no item granting read access to tag <1903> at alloc953 found in borrow stack.
| ^^^^^^
| |
| attempting a read access using <1903> at alloc953[0x0], but that tag does not exist in the borrow stack for this location
| this error occurs as part of an access at alloc953[0x0..0x4]
|
= help: this indicates a potential bug in the program: it performed an invalid operation, but the rules it violated are still experimental
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
Expand Down
7 changes: 5 additions & 2 deletions tests/ui/stacked_borrows/illegal_read5.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
error: Undefined Behavior: no item granting read access to tag <1991> at alloc953+0x8 found in borrow stack.
error: Undefined Behavior: attempting a read access using <1991> at alloc953[0x8], but that tag does not exist in the borrow stack for this location
--> $DIR/illegal_read5.rs:14:16
|
14 | let _val = *xref; // the mutable one is dead and gone
| ^^^^^ no item granting read access to tag <1991> at alloc953+0x8 found in borrow stack.
| ^^^^^
| |
| attempting a read access using <1991> at alloc953[0x8], but that tag does not exist in the borrow stack for this location
| this error occurs as part of an access at alloc953[0x8..0xc]
|
= help: this indicates a potential bug in the program: it performed an invalid operation, but the rules it violated are still experimental
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
Expand Down
7 changes: 5 additions & 2 deletions tests/ui/stacked_borrows/illegal_read6.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
error: Undefined Behavior: no item granting read access to tag <untagged> at alloc953 found in borrow stack.
error: Undefined Behavior: attempting a read access using <untagged> at alloc953[0x0], but that tag does not exist in the borrow stack for this location
--> $DIR/illegal_read6.rs:7:16
|
7 | let _val = *raw; //~ ERROR borrow stack
| ^^^^ no item granting read access to tag <untagged> at alloc953 found in borrow stack.
| ^^^^
| |
| attempting a read access using <untagged> at alloc953[0x0], but that tag does not exist in the borrow stack for this location
| this error occurs as part of an access at alloc953[0x0..0x4]
|
= help: this indicates a potential bug in the program: it performed an invalid operation, but the rules it violated are still experimental
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
Expand Down
7 changes: 5 additions & 2 deletions tests/ui/stacked_borrows/illegal_read7.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
error: Undefined Behavior: trying to reborrow for SharedReadWrite at alloc953, but parent tag <1907> does not have an appropriate item in the borrow stack
error: Undefined Behavior: trying to reborrow <1907> for SharedReadWrite permission at alloc953[0x0], but that tag does not exist in the borrow stack for this location
--> $DIR/illegal_read7.rs:19:17
|
19 | let _val = *x.get_mut(); //~ ERROR borrow stack
| ^^^^^^^^^^^ trying to reborrow for SharedReadWrite at alloc953, but parent tag <1907> does not have an appropriate item in the borrow stack
| ^^^^^^^^^^^
| |
| trying to reborrow <1907> for SharedReadWrite permission at alloc953[0x0], but that tag does not exist in the borrow stack for this location
| this error occurs as part of a reborrow at alloc953[0x0..0x4]
|
= help: this indicates a potential bug in the program: it performed an invalid operation, but the rules it violated are still experimental
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
Expand Down
7 changes: 5 additions & 2 deletions tests/ui/stacked_borrows/illegal_read8.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
error: Undefined Behavior: no item granting read access to tag <1903> at alloc953 found in borrow stack.
error: Undefined Behavior: attempting a read access using <1903> at alloc953[0x0], but that tag does not exist in the borrow stack for this location
--> $DIR/illegal_read8.rs:12:17
|
12 | let _fail = *y1; //~ ERROR borrow stack
| ^^^ no item granting read access to tag <1903> at alloc953 found in borrow stack.
| ^^^
| |
| attempting a read access using <1903> at alloc953[0x0], but that tag does not exist in the borrow stack for this location
| this error occurs as part of an access at alloc953[0x0..0x4]
|
= help: this indicates a potential bug in the program: it performed an invalid operation, but the rules it violated are still experimental
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
Expand Down
7 changes: 5 additions & 2 deletions tests/ui/stacked_borrows/illegal_write1.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
error: Undefined Behavior: no item granting read access to tag <1988> at alloc968 found in borrow stack.
error: Undefined Behavior: attempting a read access using <1988> at alloc968[0x0], but that tag does not exist in the borrow stack for this location
--> $DIR/illegal_write1.rs:8:14
|
8 | let _x = *xref; //~ ERROR borrow stack
| ^^^^^ no item granting read access to tag <1988> at alloc968 found in borrow stack.
| ^^^^^
| |
| attempting a read access using <1988> at alloc968[0x0], but that tag does not exist in the borrow stack for this location
| this error occurs as part of an access at alloc968[0x0..0x4]
|
= help: this indicates a potential bug in the program: it performed an invalid operation, but the rules it violated are still experimental
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
Expand Down
7 changes: 5 additions & 2 deletions tests/ui/stacked_borrows/illegal_write2.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
error: Undefined Behavior: no item granting write access to tag <untagged> at alloc953 found in borrow stack.
error: Undefined Behavior: attempting a write access using <untagged> at alloc953[0x0], but that tag does not exist in the borrow stack for this location
--> $DIR/illegal_write2.rs:6:14
|
6 | unsafe { *target2 = 13; } //~ ERROR borrow stack
| ^^^^^^^^^^^^^ no item granting write access to tag <untagged> at alloc953 found in borrow stack.
| ^^^^^^^^^^^^^
| |
| attempting a write access using <untagged> at alloc953[0x0], but that tag does not exist in the borrow stack for this location
| this error occurs as part of an access at alloc953[0x0..0x4]
|
= help: this indicates a potential bug in the program: it performed an invalid operation, but the rules it violated are still experimental
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
Expand Down
9 changes: 6 additions & 3 deletions tests/ui/stacked_borrows/illegal_write3.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
error: Undefined Behavior: no item granting write access to tag <untagged> at alloc953 found in borrow stack.
error: Undefined Behavior: attempting a write access using <untagged> at alloc953[0x0], but that tag only grants SharedReadOnly permission for this location
--> $DIR/illegal_write3.rs:6:14
|
6 | unsafe { *ptr = 42; } //~ ERROR borrow stack
| ^^^^^^^^^ no item granting write access to tag <untagged> at alloc953 found in borrow stack.
6 | unsafe { *ptr = 42; } //~ ERROR only grants SharedReadOnly permission
| ^^^^^^^^^
| |
| attempting a write access using <untagged> at alloc953[0x0], but that tag only grants SharedReadOnly permission for this location
| this error occurs as part of an access at alloc953[0x0..0x4]
|
= help: this indicates a potential bug in the program: it performed an invalid operation, but the rules it violated are still experimental
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
Expand Down
7 changes: 5 additions & 2 deletions tests/ui/stacked_borrows/illegal_write4.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
error: Undefined Behavior: no item granting read access to tag <1902> at alloc953 found in borrow stack.
error: Undefined Behavior: attempting a read access using <1902> at alloc953[0x0], but that tag does not exist in the borrow stack for this location
--> $DIR/illegal_write4.rs:12:16
|
12 | let _val = *reference; //~ ERROR borrow stack
| ^^^^^^^^^^ no item granting read access to tag <1902> at alloc953 found in borrow stack.
| ^^^^^^^^^^
| |
| attempting a read access using <1902> at alloc953[0x0], but that tag does not exist in the borrow stack for this location
| this error occurs as part of an access at alloc953[0x0..0x4]
|
= help: this indicates a potential bug in the program: it performed an invalid operation, but the rules it violated are still experimental
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
Expand Down
7 changes: 5 additions & 2 deletions tests/ui/stacked_borrows/illegal_write5.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
error: Undefined Behavior: no item granting read access to tag <1903> at alloc953 found in borrow stack.
error: Undefined Behavior: attempting a read access using <1903> at alloc953[0x0], but that tag does not exist in the borrow stack for this location
--> $DIR/illegal_write5.rs:10:16
|
10 | let _val = *xref;
| ^^^^^ no item granting read access to tag <1903> at alloc953 found in borrow stack.
| ^^^^^
| |
| attempting a read access using <1903> at alloc953[0x0], but that tag does not exist in the borrow stack for this location
| this error occurs as part of an access at alloc953[0x0..0x4]
|
= help: this indicates a potential bug in the program: it performed an invalid operation, but the rules it violated are still experimental
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
Expand Down
Loading

0 comments on commit d6dd8a9

Please sign in to comment.