From d6dd8a9aa8a756c6474c65ad29faf68a93d0adfb Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Thu, 17 Mar 2022 13:52:17 +0000 Subject: [PATCH] Adjust stderr for #1971 --- tests/ui/box-cell-alias.stderr | 9 ++++++--- tests/ui/stacked_borrows/alias_through_mutation.stderr | 7 +++++-- tests/ui/stacked_borrows/aliasing_mut3.stderr | 7 +++++-- tests/ui/stacked_borrows/box_exclusive_violation1.stderr | 7 +++++-- tests/ui/stacked_borrows/buggy_as_mut_slice.stderr | 7 +++++-- tests/ui/stacked_borrows/buggy_split_at_mut.stderr | 7 +++++-- tests/ui/stacked_borrows/illegal_read1.stderr | 7 +++++-- tests/ui/stacked_borrows/illegal_read2.stderr | 7 +++++-- tests/ui/stacked_borrows/illegal_read3.stderr | 7 +++++-- tests/ui/stacked_borrows/illegal_read4.stderr | 7 +++++-- tests/ui/stacked_borrows/illegal_read5.stderr | 7 +++++-- tests/ui/stacked_borrows/illegal_read6.stderr | 7 +++++-- tests/ui/stacked_borrows/illegal_read7.stderr | 7 +++++-- tests/ui/stacked_borrows/illegal_read8.stderr | 7 +++++-- tests/ui/stacked_borrows/illegal_write1.stderr | 7 +++++-- tests/ui/stacked_borrows/illegal_write2.stderr | 7 +++++-- tests/ui/stacked_borrows/illegal_write3.stderr | 9 ++++++--- tests/ui/stacked_borrows/illegal_write4.stderr | 7 +++++-- tests/ui/stacked_borrows/illegal_write5.stderr | 7 +++++-- tests/ui/stacked_borrows/interior_mut1.stderr | 7 +++++-- tests/ui/stacked_borrows/interior_mut2.stderr | 7 +++++-- tests/ui/stacked_borrows/load_invalid_mut.stderr | 7 +++++-- tests/ui/stacked_borrows/load_invalid_shr.stderr | 7 +++++-- tests/ui/stacked_borrows/mut_exclusive_violation1.stderr | 7 +++++-- tests/ui/stacked_borrows/mut_exclusive_violation2.stderr | 7 +++++-- tests/ui/stacked_borrows/outdated_local.stderr | 7 +++++-- tests/ui/stacked_borrows/pass_invalid_mut.stderr | 7 +++++-- tests/ui/stacked_borrows/pass_invalid_shr.stderr | 7 +++++-- tests/ui/stacked_borrows/pointer_smuggling.stderr | 7 +++++-- tests/ui/stacked_borrows/raw_tracking.stderr | 9 ++++++--- tests/ui/stacked_borrows/return_invalid_mut.stderr | 7 +++++-- .../ui/stacked_borrows/return_invalid_mut_option.stderr | 7 +++++-- tests/ui/stacked_borrows/return_invalid_mut_tuple.stderr | 7 +++++-- tests/ui/stacked_borrows/return_invalid_shr.stderr | 7 +++++-- .../ui/stacked_borrows/return_invalid_shr_option.stderr | 7 +++++-- tests/ui/stacked_borrows/return_invalid_shr_tuple.stderr | 7 +++++-- .../stacked_borrows/shared_rw_borrows_are_weak1.stderr | 7 +++++-- .../stacked_borrows/shared_rw_borrows_are_weak2.stderr | 7 +++++-- tests/ui/stacked_borrows/shr_frozen_violation1.stderr | 9 ++++++--- tests/ui/stacked_borrows/transmute-is-no-escape.stderr | 7 +++++-- tests/ui/stacked_borrows/unescaped_local.stderr | 7 +++++-- tests/ui/stacked_borrows/unescaped_static.stderr | 7 +++++-- tests/ui/stacked_borrows/zst_slice.stderr | 7 +++++-- 43 files changed, 219 insertions(+), 90 deletions(-) diff --git a/tests/ui/box-cell-alias.stderr b/tests/ui/box-cell-alias.stderr index dda4437d51..b45ffe9aab 100644 --- a/tests/ui/box-cell-alias.stderr +++ b/tests/ui/box-cell-alias.stderr @@ -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 diff --git a/tests/ui/stacked_borrows/alias_through_mutation.stderr b/tests/ui/stacked_borrows/alias_through_mutation.stderr index a128fa67a6..8687874007 100644 --- a/tests/ui/stacked_borrows/alias_through_mutation.stderr +++ b/tests/ui/stacked_borrows/alias_through_mutation.stderr @@ -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 diff --git a/tests/ui/stacked_borrows/aliasing_mut3.stderr b/tests/ui/stacked_borrows/aliasing_mut3.stderr index 690be0641c..e5ee782253 100644 --- a/tests/ui/stacked_borrows/aliasing_mut3.stderr +++ b/tests/ui/stacked_borrows/aliasing_mut3.stderr @@ -1,8 +1,11 @@ -error: Undefined Behavior: trying to reborrow for SharedReadOnly at alloc954, but parent tag does not have an appropriate item in the borrow stack +error: Undefined Behavior: trying to reborrow 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 does not have an appropriate item in the borrow stack + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | | + | trying to reborrow 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 diff --git a/tests/ui/stacked_borrows/box_exclusive_violation1.stderr b/tests/ui/stacked_borrows/box_exclusive_violation1.stderr index e72bf07bce..cb1f4b76eb 100644 --- a/tests/ui/stacked_borrows/box_exclusive_violation1.stderr +++ b/tests/ui/stacked_borrows/box_exclusive_violation1.stderr @@ -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 diff --git a/tests/ui/stacked_borrows/buggy_as_mut_slice.stderr b/tests/ui/stacked_borrows/buggy_as_mut_slice.stderr index 4a13e711e6..7c96b20f6c 100644 --- a/tests/ui/stacked_borrows/buggy_as_mut_slice.stderr +++ b/tests/ui/stacked_borrows/buggy_as_mut_slice.stderr @@ -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 diff --git a/tests/ui/stacked_borrows/buggy_split_at_mut.stderr b/tests/ui/stacked_borrows/buggy_split_at_mut.stderr index edb0fc67c0..2e1b6ed72e 100644 --- a/tests/ui/stacked_borrows/buggy_split_at_mut.stderr +++ b/tests/ui/stacked_borrows/buggy_split_at_mut.stderr @@ -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 diff --git a/tests/ui/stacked_borrows/illegal_read1.stderr b/tests/ui/stacked_borrows/illegal_read1.stderr index 045c529359..adee34fdf5 100644 --- a/tests/ui/stacked_borrows/illegal_read1.stderr +++ b/tests/ui/stacked_borrows/illegal_read1.stderr @@ -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 diff --git a/tests/ui/stacked_borrows/illegal_read2.stderr b/tests/ui/stacked_borrows/illegal_read2.stderr index 7846dad9bf..c2b9c8decd 100644 --- a/tests/ui/stacked_borrows/illegal_read2.stderr +++ b/tests/ui/stacked_borrows/illegal_read2.stderr @@ -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 diff --git a/tests/ui/stacked_borrows/illegal_read3.stderr b/tests/ui/stacked_borrows/illegal_read3.stderr index c647c17c2d..25772a8e12 100644 --- a/tests/ui/stacked_borrows/illegal_read3.stderr +++ b/tests/ui/stacked_borrows/illegal_read3.stderr @@ -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 diff --git a/tests/ui/stacked_borrows/illegal_read4.stderr b/tests/ui/stacked_borrows/illegal_read4.stderr index ccfe4ea609..14631c137c 100644 --- a/tests/ui/stacked_borrows/illegal_read4.stderr +++ b/tests/ui/stacked_borrows/illegal_read4.stderr @@ -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 diff --git a/tests/ui/stacked_borrows/illegal_read5.stderr b/tests/ui/stacked_borrows/illegal_read5.stderr index d9c6d9de77..d3b237eb32 100644 --- a/tests/ui/stacked_borrows/illegal_read5.stderr +++ b/tests/ui/stacked_borrows/illegal_read5.stderr @@ -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 diff --git a/tests/ui/stacked_borrows/illegal_read6.stderr b/tests/ui/stacked_borrows/illegal_read6.stderr index 1d1d5029b6..1d579925e6 100644 --- a/tests/ui/stacked_borrows/illegal_read6.stderr +++ b/tests/ui/stacked_borrows/illegal_read6.stderr @@ -1,8 +1,11 @@ -error: Undefined Behavior: no item granting read access to tag at alloc953 found in borrow stack. +error: Undefined Behavior: attempting a read access using 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 at alloc953 found in borrow stack. + | ^^^^ + | | + | attempting a read access using 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 diff --git a/tests/ui/stacked_borrows/illegal_read7.stderr b/tests/ui/stacked_borrows/illegal_read7.stderr index f17460453d..a1456cd82d 100644 --- a/tests/ui/stacked_borrows/illegal_read7.stderr +++ b/tests/ui/stacked_borrows/illegal_read7.stderr @@ -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 diff --git a/tests/ui/stacked_borrows/illegal_read8.stderr b/tests/ui/stacked_borrows/illegal_read8.stderr index 4390fc8600..caf02ed9b4 100644 --- a/tests/ui/stacked_borrows/illegal_read8.stderr +++ b/tests/ui/stacked_borrows/illegal_read8.stderr @@ -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 diff --git a/tests/ui/stacked_borrows/illegal_write1.stderr b/tests/ui/stacked_borrows/illegal_write1.stderr index 3020c6226e..7c6a940bf1 100644 --- a/tests/ui/stacked_borrows/illegal_write1.stderr +++ b/tests/ui/stacked_borrows/illegal_write1.stderr @@ -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 diff --git a/tests/ui/stacked_borrows/illegal_write2.stderr b/tests/ui/stacked_borrows/illegal_write2.stderr index 9c083c591b..96f4dc313a 100644 --- a/tests/ui/stacked_borrows/illegal_write2.stderr +++ b/tests/ui/stacked_borrows/illegal_write2.stderr @@ -1,8 +1,11 @@ -error: Undefined Behavior: no item granting write access to tag at alloc953 found in borrow stack. +error: Undefined Behavior: attempting a write access using 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 at alloc953 found in borrow stack. + | ^^^^^^^^^^^^^ + | | + | attempting a write access using 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 diff --git a/tests/ui/stacked_borrows/illegal_write3.stderr b/tests/ui/stacked_borrows/illegal_write3.stderr index 7a202c1edc..635ab822ef 100644 --- a/tests/ui/stacked_borrows/illegal_write3.stderr +++ b/tests/ui/stacked_borrows/illegal_write3.stderr @@ -1,8 +1,11 @@ -error: Undefined Behavior: no item granting write access to tag at alloc953 found in borrow stack. +error: Undefined Behavior: attempting a write access using 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 at alloc953 found in borrow stack. +6 | unsafe { *ptr = 42; } //~ ERROR only grants SharedReadOnly permission + | ^^^^^^^^^ + | | + | attempting a write access using 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 diff --git a/tests/ui/stacked_borrows/illegal_write4.stderr b/tests/ui/stacked_borrows/illegal_write4.stderr index 53046e5601..e64a7cbac5 100644 --- a/tests/ui/stacked_borrows/illegal_write4.stderr +++ b/tests/ui/stacked_borrows/illegal_write4.stderr @@ -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 diff --git a/tests/ui/stacked_borrows/illegal_write5.stderr b/tests/ui/stacked_borrows/illegal_write5.stderr index 57d0ab046b..0ffe28c33b 100644 --- a/tests/ui/stacked_borrows/illegal_write5.stderr +++ b/tests/ui/stacked_borrows/illegal_write5.stderr @@ -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 diff --git a/tests/ui/stacked_borrows/interior_mut1.stderr b/tests/ui/stacked_borrows/interior_mut1.stderr index 0d7f8ce51e..8ae8e7afef 100644 --- a/tests/ui/stacked_borrows/interior_mut1.stderr +++ b/tests/ui/stacked_borrows/interior_mut1.stderr @@ -1,8 +1,11 @@ -error: Undefined Behavior: trying to reborrow for SharedReadWrite at alloc955, but parent tag <1912> does not have an appropriate item in the borrow stack +error: Undefined Behavior: trying to reborrow <1912> for SharedReadWrite permission at alloc955[0x0], but that tag does not exist in the borrow stack for this location --> $DIR/interior_mut1.rs:14:17 | 14 | let _val = *inner_shr.get(); //~ ERROR borrow stack - | ^^^^^^^^^^^^^^^ trying to reborrow for SharedReadWrite at alloc955, but parent tag <1912> does not have an appropriate item in the borrow stack + | ^^^^^^^^^^^^^^^ + | | + | trying to reborrow <1912> for SharedReadWrite permission at alloc955[0x0], but that tag does not exist in the borrow stack for this location + | this error occurs as part of a reborrow 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 diff --git a/tests/ui/stacked_borrows/interior_mut2.stderr b/tests/ui/stacked_borrows/interior_mut2.stderr index 5f13e8b6bd..b95adc1e48 100644 --- a/tests/ui/stacked_borrows/interior_mut2.stderr +++ b/tests/ui/stacked_borrows/interior_mut2.stderr @@ -1,8 +1,11 @@ -error: Undefined Behavior: trying to reborrow for SharedReadWrite at alloc955, but parent tag <1912> does not have an appropriate item in the borrow stack +error: Undefined Behavior: trying to reborrow <1912> for SharedReadWrite permission at alloc955[0x0], but that tag does not exist in the borrow stack for this location --> $DIR/interior_mut2.rs:27:17 | 27 | let _val = *inner_shr.get(); //~ ERROR borrow stack - | ^^^^^^^^^^^^^^^ trying to reborrow for SharedReadWrite at alloc955, but parent tag <1912> does not have an appropriate item in the borrow stack + | ^^^^^^^^^^^^^^^ + | | + | trying to reborrow <1912> for SharedReadWrite permission at alloc955[0x0], but that tag does not exist in the borrow stack for this location + | this error occurs as part of a reborrow 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 diff --git a/tests/ui/stacked_borrows/load_invalid_mut.stderr b/tests/ui/stacked_borrows/load_invalid_mut.stderr index 38da1260bb..0068c43b19 100644 --- a/tests/ui/stacked_borrows/load_invalid_mut.stderr +++ b/tests/ui/stacked_borrows/load_invalid_mut.stderr @@ -1,8 +1,11 @@ -error: Undefined Behavior: trying to reborrow for Unique at alloc953, but parent tag <1907> does not have an appropriate item in the borrow stack +error: Undefined Behavior: trying to reborrow <1907> for Unique permission at alloc953[0x0], but that tag does not exist in the borrow stack for this location --> $DIR/load_invalid_mut.rs:11:16 | 11 | let _val = *xref_in_mem; //~ ERROR borrow stack - | ^^^^^^^^^^^^ trying to reborrow for Unique at alloc953, but parent tag <1907> does not have an appropriate item in the borrow stack + | ^^^^^^^^^^^^ + | | + | trying to reborrow <1907> 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..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 diff --git a/tests/ui/stacked_borrows/load_invalid_shr.stderr b/tests/ui/stacked_borrows/load_invalid_shr.stderr index ede8295932..9e8b1dfc05 100644 --- a/tests/ui/stacked_borrows/load_invalid_shr.stderr +++ b/tests/ui/stacked_borrows/load_invalid_shr.stderr @@ -1,8 +1,11 @@ -error: Undefined Behavior: trying to reborrow for SharedReadOnly at alloc953, but parent tag <1906> does not have an appropriate item in the borrow stack +error: Undefined Behavior: trying to reborrow <1906> for SharedReadOnly permission at alloc953[0x0], but that tag does not exist in the borrow stack for this location --> $DIR/load_invalid_shr.rs:11:16 | 11 | let _val = *xref_in_mem; //~ ERROR borrow stack - | ^^^^^^^^^^^^ trying to reborrow for SharedReadOnly at alloc953, but parent tag <1906> does not have an appropriate item in the borrow stack + | ^^^^^^^^^^^^ + | | + | trying to reborrow <1906> for SharedReadOnly 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 diff --git a/tests/ui/stacked_borrows/mut_exclusive_violation1.stderr b/tests/ui/stacked_borrows/mut_exclusive_violation1.stderr index daa8742d86..f0a2d31edd 100644 --- a/tests/ui/stacked_borrows/mut_exclusive_violation1.stderr +++ b/tests/ui/stacked_borrows/mut_exclusive_violation1.stderr @@ -1,8 +1,11 @@ -error: Undefined Behavior: no item granting write access to tag at alloc955 found in borrow stack. +error: Undefined Behavior: attempting a write access using at alloc955[0x0], but that tag does not exist in the borrow stack for this location --> $DIR/mut_exclusive_violation1.rs:24:5 | 24 | *LEAK = 7; //~ ERROR borrow stack - | ^^^^^^^^^ no item granting write access to tag at alloc955 found in borrow stack. + | ^^^^^^^^^ + | | + | attempting a write access using 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 diff --git a/tests/ui/stacked_borrows/mut_exclusive_violation2.stderr b/tests/ui/stacked_borrows/mut_exclusive_violation2.stderr index 7dd4e7607f..959e0bd0b3 100644 --- a/tests/ui/stacked_borrows/mut_exclusive_violation2.stderr +++ b/tests/ui/stacked_borrows/mut_exclusive_violation2.stderr @@ -1,8 +1,11 @@ -error: Undefined Behavior: no item granting read access to tag <1921> at alloc953 found in borrow stack. +error: Undefined Behavior: attempting a read access using <1921> at alloc953[0x0], but that tag does not exist in the borrow stack for this location --> $DIR/mut_exclusive_violation2.rs:9:16 | 9 | let _val = *raw1; //~ ERROR borrow stack - | ^^^^^ no item granting read access to tag <1921> at alloc953 found in borrow stack. + | ^^^^^ + | | + | attempting a read access using <1921> 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 diff --git a/tests/ui/stacked_borrows/outdated_local.stderr b/tests/ui/stacked_borrows/outdated_local.stderr index 352c8005ed..5d09d4b362 100644 --- a/tests/ui/stacked_borrows/outdated_local.stderr +++ b/tests/ui/stacked_borrows/outdated_local.stderr @@ -1,8 +1,11 @@ -error: Undefined Behavior: no item granting read access to tag at alloc965 found in borrow stack. +error: Undefined Behavior: attempting a read access using at alloc965[0x0], but that tag does not exist in the borrow stack for this location --> $DIR/outdated_local.rs:6:25 | 6 | assert_eq!(unsafe { *y }, 1); //~ ERROR borrow stack - | ^^ no item granting read access to tag at alloc965 found in borrow stack. + | ^^ + | | + | attempting a read access using at alloc965[0x0], but that tag does not exist in the borrow stack for this location + | this error occurs as part of an access at alloc965[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 diff --git a/tests/ui/stacked_borrows/pass_invalid_mut.stderr b/tests/ui/stacked_borrows/pass_invalid_mut.stderr index 29d4332ae6..7820feb139 100644 --- a/tests/ui/stacked_borrows/pass_invalid_mut.stderr +++ b/tests/ui/stacked_borrows/pass_invalid_mut.stderr @@ -1,8 +1,11 @@ -error: Undefined Behavior: trying to reborrow for SharedReadWrite at alloc953, but parent tag <1903> does not have an appropriate item in the borrow stack +error: Undefined Behavior: trying to reborrow <1903> for SharedReadWrite permission at alloc953[0x0], but that tag does not exist in the borrow stack for this location --> $DIR/pass_invalid_mut.rs:9:9 | 9 | foo(xref); //~ ERROR borrow stack - | ^^^^ trying to reborrow for SharedReadWrite at alloc953, but parent tag <1903> does not have an appropriate item in the borrow stack + | ^^^^ + | | + | trying to reborrow <1903> 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 diff --git a/tests/ui/stacked_borrows/pass_invalid_shr.stderr b/tests/ui/stacked_borrows/pass_invalid_shr.stderr index bcd8985c28..17460751ea 100644 --- a/tests/ui/stacked_borrows/pass_invalid_shr.stderr +++ b/tests/ui/stacked_borrows/pass_invalid_shr.stderr @@ -1,8 +1,11 @@ -error: Undefined Behavior: trying to reborrow for SharedReadOnly at alloc953, but parent tag <1902> does not have an appropriate item in the borrow stack +error: Undefined Behavior: trying to reborrow <1902> for SharedReadOnly permission at alloc953[0x0], but that tag does not exist in the borrow stack for this location --> $DIR/pass_invalid_shr.rs:9:9 | 9 | foo(xref); //~ ERROR borrow stack - | ^^^^ trying to reborrow for SharedReadOnly at alloc953, but parent tag <1902> does not have an appropriate item in the borrow stack + | ^^^^ + | | + | trying to reborrow <1902> for SharedReadOnly 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 diff --git a/tests/ui/stacked_borrows/pointer_smuggling.stderr b/tests/ui/stacked_borrows/pointer_smuggling.stderr index 974574b95f..96421170c6 100644 --- a/tests/ui/stacked_borrows/pointer_smuggling.stderr +++ b/tests/ui/stacked_borrows/pointer_smuggling.stderr @@ -1,8 +1,11 @@ -error: Undefined Behavior: no item granting read access to tag at alloc955 found in borrow stack. +error: Undefined Behavior: attempting a read access using at alloc955[0x0], but that tag does not exist in the borrow stack for this location --> $DIR/pointer_smuggling.rs:11:23 | 11 | let _x = unsafe { *PTR }; //~ ERROR borrow stack - | ^^^^ no item granting read access to tag at alloc955 found in borrow stack. + | ^^^^ + | | + | attempting a read access using 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..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 diff --git a/tests/ui/stacked_borrows/raw_tracking.stderr b/tests/ui/stacked_borrows/raw_tracking.stderr index 3ac5e7f323..11217e35bc 100644 --- a/tests/ui/stacked_borrows/raw_tracking.stderr +++ b/tests/ui/stacked_borrows/raw_tracking.stderr @@ -1,8 +1,11 @@ -error: Undefined Behavior: no item granting write access to tag <1981> at alloc953 found in borrow stack. +error: Undefined Behavior: attempting a write access using <1981> at alloc953[0x0], but that tag does not exist in the borrow stack for this location --> $DIR/raw_tracking.rs:10:14 | -10 | unsafe { *raw1 = 13; } //~ ERROR no item granting write access to tag - | ^^^^^^^^^^ no item granting write access to tag <1981> at alloc953 found in borrow stack. +10 | unsafe { *raw1 = 13; } //~ ERROR does not exist in the borrow stack + | ^^^^^^^^^^ + | | + | attempting a write access using <1981> 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 diff --git a/tests/ui/stacked_borrows/return_invalid_mut.stderr b/tests/ui/stacked_borrows/return_invalid_mut.stderr index 956fb53d7d..d8a3462b39 100644 --- a/tests/ui/stacked_borrows/return_invalid_mut.stderr +++ b/tests/ui/stacked_borrows/return_invalid_mut.stderr @@ -1,8 +1,11 @@ -error: Undefined Behavior: trying to reborrow for Unique at alloc953+0x4, but parent tag <1907> does not have an appropriate item in the borrow stack +error: Undefined Behavior: trying to reborrow <1907> for Unique permission at alloc953[0x4], but that tag does not exist in the borrow stack for this location --> $DIR/return_invalid_mut.rs:6:5 | 6 | ret //~ ERROR borrow stack - | ^^^ trying to reborrow for Unique at alloc953+0x4, but parent tag <1907> does not have an appropriate item in the borrow stack + | ^^^ + | | + | trying to reborrow <1907> for Unique permission at alloc953[0x4], but that tag does not exist in the borrow stack for this location + | this error occurs as part of a reborrow at alloc953[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 diff --git a/tests/ui/stacked_borrows/return_invalid_mut_option.stderr b/tests/ui/stacked_borrows/return_invalid_mut_option.stderr index a9146fc916..9083fd7e94 100644 --- a/tests/ui/stacked_borrows/return_invalid_mut_option.stderr +++ b/tests/ui/stacked_borrows/return_invalid_mut_option.stderr @@ -1,8 +1,11 @@ -error: Undefined Behavior: trying to reborrow for Unique at alloc953+0x4, but parent tag <1908> does not have an appropriate item in the borrow stack +error: Undefined Behavior: trying to reborrow <1908> for Unique permission at alloc953[0x4], but that tag does not exist in the borrow stack for this location --> $DIR/return_invalid_mut_option.rs:13:14 | 13 | Some(_x) => {}, //~ ERROR borrow stack - | ^^ trying to reborrow for Unique at alloc953+0x4, but parent tag <1908> does not have an appropriate item in the borrow stack + | ^^ + | | + | trying to reborrow <1908> for Unique permission at alloc953[0x4], but that tag does not exist in the borrow stack for this location + | this error occurs as part of a reborrow at alloc953[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 diff --git a/tests/ui/stacked_borrows/return_invalid_mut_tuple.stderr b/tests/ui/stacked_borrows/return_invalid_mut_tuple.stderr index 5625d3220e..8c665df3f8 100644 --- a/tests/ui/stacked_borrows/return_invalid_mut_tuple.stderr +++ b/tests/ui/stacked_borrows/return_invalid_mut_tuple.stderr @@ -1,8 +1,11 @@ -error: Undefined Behavior: trying to reborrow for Unique at alloc953+0x4, but parent tag <1906> does not have an appropriate item in the borrow stack +error: Undefined Behavior: trying to reborrow <1906> for Unique permission at alloc953[0x4], but that tag does not exist in the borrow stack for this location --> $DIR/return_invalid_mut_tuple.rs:11:5 | 11 | foo(&mut (1, 2)).0; //~ ERROR: borrow stack - | ^^^^^^^^^^^^^^^^^^ trying to reborrow for Unique at alloc953+0x4, but parent tag <1906> does not have an appropriate item in the borrow stack + | ^^^^^^^^^^^^^^^^^^ + | | + | trying to reborrow <1906> for Unique permission at alloc953[0x4], but that tag does not exist in the borrow stack for this location + | this error occurs as part of a reborrow at alloc953[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 diff --git a/tests/ui/stacked_borrows/return_invalid_shr.stderr b/tests/ui/stacked_borrows/return_invalid_shr.stderr index bf21b98dd2..03a56a4d79 100644 --- a/tests/ui/stacked_borrows/return_invalid_shr.stderr +++ b/tests/ui/stacked_borrows/return_invalid_shr.stderr @@ -1,8 +1,11 @@ -error: Undefined Behavior: trying to reborrow for SharedReadOnly at alloc953+0x4, but parent tag <1906> does not have an appropriate item in the borrow stack +error: Undefined Behavior: trying to reborrow <1906> for SharedReadOnly permission at alloc953[0x4], but that tag does not exist in the borrow stack for this location --> $DIR/return_invalid_shr.rs:6:5 | 6 | ret //~ ERROR borrow stack - | ^^^ trying to reborrow for SharedReadOnly at alloc953+0x4, but parent tag <1906> does not have an appropriate item in the borrow stack + | ^^^ + | | + | trying to reborrow <1906> for SharedReadOnly permission at alloc953[0x4], but that tag does not exist in the borrow stack for this location + | this error occurs as part of a reborrow at alloc953[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 diff --git a/tests/ui/stacked_borrows/return_invalid_shr_option.stderr b/tests/ui/stacked_borrows/return_invalid_shr_option.stderr index 08f026fb32..75f4937f79 100644 --- a/tests/ui/stacked_borrows/return_invalid_shr_option.stderr +++ b/tests/ui/stacked_borrows/return_invalid_shr_option.stderr @@ -1,8 +1,11 @@ -error: Undefined Behavior: trying to reborrow for SharedReadOnly at alloc953+0x4, but parent tag <1906> does not have an appropriate item in the borrow stack +error: Undefined Behavior: trying to reborrow <1906> for SharedReadOnly permission at alloc953[0x4], but that tag does not exist in the borrow stack for this location --> $DIR/return_invalid_shr_option.rs:12:14 | 12 | Some(_x) => {}, //~ ERROR borrow stack - | ^^ trying to reborrow for SharedReadOnly at alloc953+0x4, but parent tag <1906> does not have an appropriate item in the borrow stack + | ^^ + | | + | trying to reborrow <1906> for SharedReadOnly permission at alloc953[0x4], but that tag does not exist in the borrow stack for this location + | this error occurs as part of a reborrow at alloc953[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 diff --git a/tests/ui/stacked_borrows/return_invalid_shr_tuple.stderr b/tests/ui/stacked_borrows/return_invalid_shr_tuple.stderr index ab46e9b2a1..c5bf1f12ce 100644 --- a/tests/ui/stacked_borrows/return_invalid_shr_tuple.stderr +++ b/tests/ui/stacked_borrows/return_invalid_shr_tuple.stderr @@ -1,8 +1,11 @@ -error: Undefined Behavior: trying to reborrow for SharedReadOnly at alloc953+0x4, but parent tag <1906> does not have an appropriate item in the borrow stack +error: Undefined Behavior: trying to reborrow <1906> for SharedReadOnly permission at alloc953[0x4], but that tag does not exist in the borrow stack for this location --> $DIR/return_invalid_shr_tuple.rs:11:5 | 11 | foo(&mut (1, 2)).0; //~ ERROR borrow stack - | ^^^^^^^^^^^^^^^^^^ trying to reborrow for SharedReadOnly at alloc953+0x4, but parent tag <1906> does not have an appropriate item in the borrow stack + | ^^^^^^^^^^^^^^^^^^ + | | + | trying to reborrow <1906> for SharedReadOnly permission at alloc953[0x4], but that tag does not exist in the borrow stack for this location + | this error occurs as part of a reborrow at alloc953[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 diff --git a/tests/ui/stacked_borrows/shared_rw_borrows_are_weak1.stderr b/tests/ui/stacked_borrows/shared_rw_borrows_are_weak1.stderr index c8c7bf5e70..2baadfa8e4 100644 --- a/tests/ui/stacked_borrows/shared_rw_borrows_are_weak1.stderr +++ b/tests/ui/stacked_borrows/shared_rw_borrows_are_weak1.stderr @@ -1,8 +1,11 @@ -error: Undefined Behavior: trying to reborrow for SharedReadWrite at alloc953, but parent tag <1908> does not have an appropriate item in the borrow stack +error: Undefined Behavior: trying to reborrow <1908> for SharedReadWrite permission at alloc953[0x0], but that tag does not exist in the borrow stack for this location --> $DIR/shared_rw_borrows_are_weak1.rs:13:5 | 13 | y.get_mut(); //~ ERROR borrow stack - | ^^^^^^^^^^^ trying to reborrow for SharedReadWrite at alloc953, but parent tag <1908> does not have an appropriate item in the borrow stack + | ^^^^^^^^^^^ + | | + | trying to reborrow <1908> 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 diff --git a/tests/ui/stacked_borrows/shared_rw_borrows_are_weak2.stderr b/tests/ui/stacked_borrows/shared_rw_borrows_are_weak2.stderr index 213e3d0fbf..358985f27e 100644 --- a/tests/ui/stacked_borrows/shared_rw_borrows_are_weak2.stderr +++ b/tests/ui/stacked_borrows/shared_rw_borrows_are_weak2.stderr @@ -1,8 +1,11 @@ -error: Undefined Behavior: no item granting read access to tag <1994> at alloc953+0x8 found in borrow stack. +error: Undefined Behavior: attempting a read access using <1994> at alloc953[0x8], but that tag does not exist in the borrow stack for this location --> $DIR/shared_rw_borrows_are_weak2.rs:13:16 | 13 | let _val = *y; //~ ERROR borrow stack - | ^^ no item granting read access to tag <1994> at alloc953+0x8 found in borrow stack. + | ^^ + | | + | attempting a read access using <1994> 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 diff --git a/tests/ui/stacked_borrows/shr_frozen_violation1.stderr b/tests/ui/stacked_borrows/shr_frozen_violation1.stderr index 0769e1a8a0..92e0fa2a2b 100644 --- a/tests/ui/stacked_borrows/shr_frozen_violation1.stderr +++ b/tests/ui/stacked_borrows/shr_frozen_violation1.stderr @@ -1,8 +1,11 @@ -error: Undefined Behavior: no item granting write access to tag at alloc957 found in borrow stack. +error: Undefined Behavior: attempting a write access using at alloc957[0x0], but that tag only grants SharedReadOnly permission for this location --> $DIR/shr_frozen_violation1.rs:12:14 | -12 | unsafe { *(x as *const i32 as *mut i32) = 7; } //~ ERROR borrow stack - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no item granting write access to tag at alloc957 found in borrow stack. +12 | unsafe { *(x as *const i32 as *mut i32) = 7; } //~ ERROR only grants SharedReadOnly permission + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | | + | attempting a write access using at alloc957[0x0], but that tag only grants SharedReadOnly permission for this location + | this error occurs as part of an access at alloc957[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 diff --git a/tests/ui/stacked_borrows/transmute-is-no-escape.stderr b/tests/ui/stacked_borrows/transmute-is-no-escape.stderr index 40e32968ab..a9e8b175e5 100644 --- a/tests/ui/stacked_borrows/transmute-is-no-escape.stderr +++ b/tests/ui/stacked_borrows/transmute-is-no-escape.stderr @@ -1,8 +1,11 @@ -error: Undefined Behavior: no item granting write access to tag at alloc955 found in borrow stack. +error: Undefined Behavior: attempting a write access using at alloc955[0x0], but that tag does not exist in the borrow stack for this location --> $DIR/transmute-is-no-escape.rs:13:14 | 13 | unsafe { *raw = 13; } //~ ERROR borrow stack - | ^^^^^^^^^ no item granting write access to tag at alloc955 found in borrow stack. + | ^^^^^^^^^ + | | + | attempting a write access using 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 diff --git a/tests/ui/stacked_borrows/unescaped_local.stderr b/tests/ui/stacked_borrows/unescaped_local.stderr index 35d6986b73..e1528ebec0 100644 --- a/tests/ui/stacked_borrows/unescaped_local.stderr +++ b/tests/ui/stacked_borrows/unescaped_local.stderr @@ -1,8 +1,11 @@ -error: Undefined Behavior: no item granting write access to tag at alloc953 found in borrow stack. +error: Undefined Behavior: attempting a write access using at alloc953[0x0], but that tag does not exist in the borrow stack for this location --> $DIR/unescaped_local.rs:7:14 | 7 | unsafe { *raw = 13; } //~ ERROR borrow stack - | ^^^^^^^^^ no item granting write access to tag at alloc953 found in borrow stack. + | ^^^^^^^^^ + | | + | attempting a write access using 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 diff --git a/tests/ui/stacked_borrows/unescaped_static.stderr b/tests/ui/stacked_borrows/unescaped_static.stderr index 35d6d34fc2..72cec59ec1 100644 --- a/tests/ui/stacked_borrows/unescaped_static.stderr +++ b/tests/ui/stacked_borrows/unescaped_static.stderr @@ -1,8 +1,11 @@ -error: Undefined Behavior: no item granting read access to tag at alloc1+0x1 found in borrow stack. +error: Undefined Behavior: attempting a read access using at alloc1[0x1], but that tag does not exist in the borrow stack for this location --> $DIR/unescaped_static.rs:6:25 | 6 | let _val = unsafe { *ptr_to_first.add(1) }; //~ ERROR borrow stack - | ^^^^^^^^^^^^^^^^^^^^ no item granting read access to tag at alloc1+0x1 found in borrow stack. + | ^^^^^^^^^^^^^^^^^^^^ + | | + | attempting a read access using at alloc1[0x1], but that tag does not exist in the borrow stack for this location + | this error occurs as part of an access at alloc1[0x1..0x2] | = 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 diff --git a/tests/ui/stacked_borrows/zst_slice.stderr b/tests/ui/stacked_borrows/zst_slice.stderr index 85229c7556..9a9bd6cfb5 100644 --- a/tests/ui/stacked_borrows/zst_slice.stderr +++ b/tests/ui/stacked_borrows/zst_slice.stderr @@ -1,8 +1,11 @@ -error: Undefined Behavior: trying to reborrow for SharedReadOnly at alloc966+0x4, but parent tag <2043> does not have an appropriate item in the borrow stack +error: Undefined Behavior: trying to reborrow <2043> for SharedReadOnly permission at alloc966[0x4], but that tag does not exist in the borrow stack for this location --> /home/ubuntu/.rustup/toolchains/miri/lib/rustlib/src/rust/library/core/src/slice/mod.rs:392:18 | 392 | unsafe { &*index.get_unchecked(self) } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ trying to reborrow for SharedReadOnly at alloc966+0x4, but parent tag <2043> does not have an appropriate item in the borrow stack + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | | + | trying to reborrow <2043> for SharedReadOnly permission at alloc966[0x4], but that tag does not exist in the borrow stack for this location + | this error occurs as part of a reborrow at alloc966[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