diff --git a/rust-version b/rust-version index 85b2e88ac30cb..83da802cfcf58 100644 --- a/rust-version +++ b/rust-version @@ -1 +1 @@ -09d52bc5d4260bac8b9a2ea8ac7a07c5c72906f1 +99930ac7f8cbb5d9b319b2e2e92794fd6f24f556 diff --git a/src/diagnostics.rs b/src/diagnostics.rs index 52f93a6cea9d9..0e3e693e33f90 100644 --- a/src/diagnostics.rs +++ b/src/diagnostics.rs @@ -16,10 +16,9 @@ pub enum TerminationInfo { Exit(i64), Abort(String), UnsupportedInIsolation(String), - ExperimentalUb { + StackedBorrowsUb { msg: String, help: Option, - url: String, history: Option, }, Deadlock, @@ -43,7 +42,7 @@ impl fmt::Display for TerminationInfo { Exit(code) => write!(f, "the evaluated program completed with exit code {}", code), Abort(msg) => write!(f, "{}", msg), UnsupportedInIsolation(msg) => write!(f, "{}", msg), - ExperimentalUb { msg, .. } => write!(f, "{}", msg), + StackedBorrowsUb { msg, .. } => write!(f, "{}", msg), Deadlock => write!(f, "the evaluated program deadlocked"), MultipleSymbolDefinitions { link_name, .. } => write!(f, "multiple definitions of symbol `{}`", link_name), @@ -146,7 +145,7 @@ pub fn report_error<'tcx, 'mir>( Exit(code) => return Some(*code), Abort(_) => Some("abnormal termination"), UnsupportedInIsolation(_) => Some("unsupported operation"), - ExperimentalUb { .. } => Some("Undefined Behavior"), + StackedBorrowsUb { .. } => Some("Undefined Behavior"), Deadlock => Some("deadlock"), MultipleSymbolDefinitions { .. } | SymbolShimClashing { .. } => None, }; @@ -157,11 +156,12 @@ pub fn report_error<'tcx, 'mir>( (None, format!("pass the flag `-Zmiri-disable-isolation` to disable isolation;")), (None, format!("or pass `-Zmiri-isolation-error=warn` to configure Miri to return an error code from isolated operations (if supported for that operation) and continue with a warning")), ], - ExperimentalUb { url, help, history, .. } => { + StackedBorrowsUb { help, history, .. } => { + let url = "https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md"; msg.extend(help.clone()); let mut helps = vec![ - (None, format!("this indicates a potential bug in the program: it performed an invalid operation, but the rules it violated are still experimental")), - (None, format!("see {} for further information", url)), + (None, format!("this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental")), + (None, format!("see {url} for further information")), ]; match history { Some(TagHistory::Tagged {tag, created: (created_range, created_span), invalidated, protected }) => { diff --git a/src/stacked_borrows.rs b/src/stacked_borrows.rs index 88d1b1f10521c..c78741499c2d4 100644 --- a/src/stacked_borrows.rs +++ b/src/stacked_borrows.rs @@ -250,14 +250,7 @@ pub fn err_sb_ub<'tcx>( help: Option, history: Option, ) -> InterpError<'tcx> { - err_machine_stop!(TerminationInfo::ExperimentalUb { - msg, - help, - url: format!( - "https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md" - ), - history - }) + err_machine_stop!(TerminationInfo::StackedBorrowsUb { msg, help, history }) } // # Stacked Borrows Core Begin diff --git a/tests/fail/box-cell-alias.stderr b/tests/fail/box-cell-alias.stderr index a4eaec93a8fb2..44813be9780c0 100644 --- a/tests/fail/box-cell-alias.stderr +++ b/tests/fail/box-cell-alias.stderr @@ -7,7 +7,7 @@ LL | unsafe { (*ptr).set(20); } | trying to reborrow 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 rules it violated are still experimental + = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 help: was created by a retag at offsets [0x0..0x1] --> $DIR/box-cell-alias.rs:LL:CC diff --git a/tests/fail/stacked_borrows/alias_through_mutation.stderr b/tests/fail/stacked_borrows/alias_through_mutation.stderr index 6862a67faec26..610a045efcf24 100644 --- a/tests/fail/stacked_borrows/alias_through_mutation.stderr +++ b/tests/fail/stacked_borrows/alias_through_mutation.stderr @@ -7,7 +7,7 @@ LL | let _val = *target_alias; | attempting a read access using at ALLOC[0x0], but that tag does not exist in the borrow stack for this location | this error occurs as part of an access at ALLOC[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: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 help: was created by a retag at offsets [0x0..0x4] --> $DIR/alias_through_mutation.rs:LL:CC diff --git a/tests/fail/stacked_borrows/aliasing_mut1.stderr b/tests/fail/stacked_borrows/aliasing_mut1.stderr index 5f2e5cbbad36f..7282612b6fc39 100644 --- a/tests/fail/stacked_borrows/aliasing_mut1.stderr +++ b/tests/fail/stacked_borrows/aliasing_mut1.stderr @@ -4,7 +4,7 @@ error: Undefined Behavior: not granting access to tag because incompatible LL | pub fn safe(_x: &mut i32, _y: &mut i32) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not granting access to tag because incompatible item is protected: [Unique for (call ID)] | - = help: this indicates a potential bug in the program: it performed an invalid operation, but the rules it violated are still experimental + = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 help: was created by a retag at offsets [0x0..0x4] --> $DIR/aliasing_mut1.rs:LL:CC diff --git a/tests/fail/stacked_borrows/aliasing_mut2.stderr b/tests/fail/stacked_borrows/aliasing_mut2.stderr index bb82252e78d42..d314fff6222e3 100644 --- a/tests/fail/stacked_borrows/aliasing_mut2.stderr +++ b/tests/fail/stacked_borrows/aliasing_mut2.stderr @@ -4,7 +4,7 @@ error: Undefined Behavior: not granting access to tag because incompatible LL | pub fn safe(_x: &i32, _y: &mut i32) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not granting access to tag because incompatible item is protected: [SharedReadOnly for (call ID)] | - = help: this indicates a potential bug in the program: it performed an invalid operation, but the rules it violated are still experimental + = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 help: was created by a retag at offsets [0x0..0x4] --> $DIR/aliasing_mut2.rs:LL:CC diff --git a/tests/fail/stacked_borrows/aliasing_mut3.stderr b/tests/fail/stacked_borrows/aliasing_mut3.stderr index 0cfddcac84868..a4187be0a25b3 100644 --- a/tests/fail/stacked_borrows/aliasing_mut3.stderr +++ b/tests/fail/stacked_borrows/aliasing_mut3.stderr @@ -7,7 +7,7 @@ LL | pub fn safe(_x: &mut i32, _y: &i32) {} | trying to reborrow 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 rules it violated are still experimental + = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 help: tag was most recently created at offsets [0x0..0x4] --> $DIR/aliasing_mut3.rs:LL:CC diff --git a/tests/fail/stacked_borrows/aliasing_mut4.stderr b/tests/fail/stacked_borrows/aliasing_mut4.stderr index 13b589b94754f..0bf5e863bfa33 100644 --- a/tests/fail/stacked_borrows/aliasing_mut4.stderr +++ b/tests/fail/stacked_borrows/aliasing_mut4.stderr @@ -4,7 +4,7 @@ error: Undefined Behavior: not granting access to tag because incompatible LL | pub fn safe(_x: &i32, _y: &mut Cell) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not granting access to tag because incompatible item is protected: [SharedReadOnly for (call ID)] | - = help: this indicates a potential bug in the program: it performed an invalid operation, but the rules it violated are still experimental + = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 help: was created by a retag at offsets [0x0..0x4] --> $DIR/aliasing_mut4.rs:LL:CC diff --git a/tests/fail/stacked_borrows/box_exclusive_violation1.stderr b/tests/fail/stacked_borrows/box_exclusive_violation1.stderr index 94d4509553484..90d9451285786 100644 --- a/tests/fail/stacked_borrows/box_exclusive_violation1.stderr +++ b/tests/fail/stacked_borrows/box_exclusive_violation1.stderr @@ -7,7 +7,7 @@ LL | *our | attempting a read access using at ALLOC[0x0], but that tag does not exist in the borrow stack for this location | this error occurs as part of an access at ALLOC[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: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 help: was created by a retag at offsets [0x0..0x4] --> $DIR/box_exclusive_violation1.rs:LL:CC diff --git a/tests/fail/stacked_borrows/buggy_as_mut_slice.stderr b/tests/fail/stacked_borrows/buggy_as_mut_slice.stderr index 8eed3732a0cb0..b65e49fd4a7d0 100644 --- a/tests/fail/stacked_borrows/buggy_as_mut_slice.stderr +++ b/tests/fail/stacked_borrows/buggy_as_mut_slice.stderr @@ -7,7 +7,7 @@ LL | v1[1] = 5; | attempting a write access using at ALLOC[0x4], but that tag does not exist in the borrow stack for this location | this error occurs as part of an access at ALLOC[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: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 help: was created by a retag at offsets [0x0..0xc] --> $DIR/buggy_as_mut_slice.rs:LL:CC diff --git a/tests/fail/stacked_borrows/buggy_split_at_mut.stderr b/tests/fail/stacked_borrows/buggy_split_at_mut.stderr index d1d8d1f6aa3c9..1b2536c48e045 100644 --- a/tests/fail/stacked_borrows/buggy_split_at_mut.stderr +++ b/tests/fail/stacked_borrows/buggy_split_at_mut.stderr @@ -7,7 +7,7 @@ LL | let (a, b) = safe::split_at_mut(&mut array, 0); | trying to reborrow 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 rules it violated are still experimental + = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 help: was created by a retag at offsets [0x0..0x10] --> $DIR/buggy_split_at_mut.rs:LL:CC diff --git a/tests/fail/stacked_borrows/deallocate_against_barrier1.stderr b/tests/fail/stacked_borrows/deallocate_against_barrier1.stderr index 38b84e638be4d..58032fa35a1d5 100644 --- a/tests/fail/stacked_borrows/deallocate_against_barrier1.stderr +++ b/tests/fail/stacked_borrows/deallocate_against_barrier1.stderr @@ -4,7 +4,7 @@ error: Undefined Behavior: deallocating while item is protected: [Unique for (call ID)] | - = help: this indicates a potential bug in the program: it performed an invalid operation, but the rules it violated are still experimental + = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 = note: inside `std::alloc::dealloc` at RUSTLIB/alloc/src/alloc.rs:LL:CC diff --git a/tests/fail/stacked_borrows/deallocate_against_barrier2.stderr b/tests/fail/stacked_borrows/deallocate_against_barrier2.stderr index 72e6814b8e14d..088daec040fec 100644 --- a/tests/fail/stacked_borrows/deallocate_against_barrier2.stderr +++ b/tests/fail/stacked_borrows/deallocate_against_barrier2.stderr @@ -4,7 +4,7 @@ error: Undefined Behavior: deallocating while item is protected: [SharedReadWrit LL | unsafe { __rust_dealloc(ptr, layout.size(), layout.align()) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ deallocating while item is protected: [SharedReadWrite for (call ID)] | - = help: this indicates a potential bug in the program: it performed an invalid operation, but the rules it violated are still experimental + = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 = note: inside `std::alloc::dealloc` at RUSTLIB/alloc/src/alloc.rs:LL:CC diff --git a/tests/fail/stacked_borrows/illegal_read1.stderr b/tests/fail/stacked_borrows/illegal_read1.stderr index ca3147e6221ec..bf78c62a0e799 100644 --- a/tests/fail/stacked_borrows/illegal_read1.stderr +++ b/tests/fail/stacked_borrows/illegal_read1.stderr @@ -7,7 +7,7 @@ LL | let _val = *xref; // ...but any use of raw will invalidate our ref. | attempting a read access using at ALLOC[0x0], but that tag does not exist in the borrow stack for this location | this error occurs as part of an access at ALLOC[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: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 help: was created by a retag at offsets [0x0..0x4] --> $DIR/illegal_read1.rs:LL:CC diff --git a/tests/fail/stacked_borrows/illegal_read2.stderr b/tests/fail/stacked_borrows/illegal_read2.stderr index b6343ddd30b64..b0bc3f9a7f0d3 100644 --- a/tests/fail/stacked_borrows/illegal_read2.stderr +++ b/tests/fail/stacked_borrows/illegal_read2.stderr @@ -7,7 +7,7 @@ LL | let _val = *xref; // ...but any use of raw will invalidate our ref. | attempting a read access using at ALLOC[0x0], but that tag does not exist in the borrow stack for this location | this error occurs as part of an access at ALLOC[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: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 help: was created by a retag at offsets [0x0..0x4] --> $DIR/illegal_read2.rs:LL:CC diff --git a/tests/fail/stacked_borrows/illegal_read3.stderr b/tests/fail/stacked_borrows/illegal_read3.stderr index 75c4305ee81f5..34580dec4ee4f 100644 --- a/tests/fail/stacked_borrows/illegal_read3.stderr +++ b/tests/fail/stacked_borrows/illegal_read3.stderr @@ -7,7 +7,7 @@ LL | let _val = *xref2; | attempting a read access using at ALLOC[0x0], but that tag does not exist in the borrow stack for this location | this error occurs as part of an access at ALLOC[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: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 help: was created by a retag at offsets [0x0..0x4] --> $DIR/illegal_read3.rs:LL:CC diff --git a/tests/fail/stacked_borrows/illegal_read4.stderr b/tests/fail/stacked_borrows/illegal_read4.stderr index 968c31ba23af7..19c361a19542a 100644 --- a/tests/fail/stacked_borrows/illegal_read4.stderr +++ b/tests/fail/stacked_borrows/illegal_read4.stderr @@ -7,7 +7,7 @@ LL | let _illegal = *xref2; | attempting a read access using at ALLOC[0x0], but that tag does not exist in the borrow stack for this location | this error occurs as part of an access at ALLOC[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: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 help: was created by a retag at offsets [0x0..0x4] --> $DIR/illegal_read4.rs:LL:CC diff --git a/tests/fail/stacked_borrows/illegal_read5.stderr b/tests/fail/stacked_borrows/illegal_read5.stderr index df6f0a1c68862..4af149e3831ed 100644 --- a/tests/fail/stacked_borrows/illegal_read5.stderr +++ b/tests/fail/stacked_borrows/illegal_read5.stderr @@ -7,7 +7,7 @@ LL | let _val = *xref; // the mutable one is dead and gone | attempting a read access using at ALLOC[$HEX], but that tag does not exist in the borrow stack for this location | this error occurs as part of an access at ALLOC[$HEX..$HEX] | - = help: this indicates a potential bug in the program: it performed an invalid operation, but the rules it violated are still experimental + = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 help: was created by a retag at offsets [$HEX..$HEX] --> $DIR/illegal_read5.rs:LL:CC diff --git a/tests/fail/stacked_borrows/illegal_read6.stderr b/tests/fail/stacked_borrows/illegal_read6.stderr index c2be5bb370c5a..499f060c47c24 100644 --- a/tests/fail/stacked_borrows/illegal_read6.stderr +++ b/tests/fail/stacked_borrows/illegal_read6.stderr @@ -7,7 +7,7 @@ LL | let _val = *raw; | attempting a read access using at ALLOC[0x0], but that tag does not exist in the borrow stack for this location | this error occurs as part of an access at ALLOC[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: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 help: tag was most recently created at offsets [0x0..0x4] --> $DIR/illegal_read6.rs:LL:CC diff --git a/tests/fail/stacked_borrows/illegal_read7.stderr b/tests/fail/stacked_borrows/illegal_read7.stderr index 921d8872b70b8..e7e1685964bca 100644 --- a/tests/fail/stacked_borrows/illegal_read7.stderr +++ b/tests/fail/stacked_borrows/illegal_read7.stderr @@ -7,7 +7,7 @@ LL | let _val = *x.get_mut(); | trying to reborrow 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 rules it violated are still experimental + = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 help: was created by a retag at offsets [0x0..0x4] --> $DIR/illegal_read7.rs:LL:CC diff --git a/tests/fail/stacked_borrows/illegal_read8.stderr b/tests/fail/stacked_borrows/illegal_read8.stderr index 6c6168032b246..21df77775c8b4 100644 --- a/tests/fail/stacked_borrows/illegal_read8.stderr +++ b/tests/fail/stacked_borrows/illegal_read8.stderr @@ -7,7 +7,7 @@ LL | let _fail = *y1; | attempting a read access using at ALLOC[0x0], but that tag does not exist in the borrow stack for this location | this error occurs as part of an access at ALLOC[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: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 help: was created by a retag at offsets [0x0..0x4] --> $DIR/illegal_read8.rs:LL:CC diff --git a/tests/fail/stacked_borrows/illegal_write1.stderr b/tests/fail/stacked_borrows/illegal_write1.stderr index 08fa05ff9f1ff..76639960a9232 100644 --- a/tests/fail/stacked_borrows/illegal_write1.stderr +++ b/tests/fail/stacked_borrows/illegal_write1.stderr @@ -7,7 +7,7 @@ LL | let _x = *xref; | attempting a read access using at ALLOC[0x0], but that tag does not exist in the borrow stack for this location | this error occurs as part of an access at ALLOC[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: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 help: was created by a retag at offsets [0x0..0x4] --> $DIR/illegal_write1.rs:LL:CC diff --git a/tests/fail/stacked_borrows/illegal_write2.stderr b/tests/fail/stacked_borrows/illegal_write2.stderr index 13f41eea91539..3a225123d1f2b 100644 --- a/tests/fail/stacked_borrows/illegal_write2.stderr +++ b/tests/fail/stacked_borrows/illegal_write2.stderr @@ -7,7 +7,7 @@ LL | unsafe { *target2 = 13; } | attempting a write access using at ALLOC[0x0], but that tag does not exist in the borrow stack for this location | this error occurs as part of an access at ALLOC[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: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 help: tag was most recently created at offsets [0x0..0x4] --> $DIR/illegal_write2.rs:LL:CC diff --git a/tests/fail/stacked_borrows/illegal_write3.stderr b/tests/fail/stacked_borrows/illegal_write3.stderr index b37caee5ef203..0dc948b291521 100644 --- a/tests/fail/stacked_borrows/illegal_write3.stderr +++ b/tests/fail/stacked_borrows/illegal_write3.stderr @@ -7,7 +7,7 @@ LL | unsafe { *ptr = 42; } | attempting a write access using at ALLOC[0x0], but that tag only grants SharedReadOnly permission for this location | this error occurs as part of an access at ALLOC[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: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 help: tag was most recently created at offsets [0x0..0x4] --> $DIR/illegal_write3.rs:LL:CC diff --git a/tests/fail/stacked_borrows/illegal_write4.stderr b/tests/fail/stacked_borrows/illegal_write4.stderr index 5c0b4ec868e2e..404e13d1138a2 100644 --- a/tests/fail/stacked_borrows/illegal_write4.stderr +++ b/tests/fail/stacked_borrows/illegal_write4.stderr @@ -7,7 +7,7 @@ LL | let _val = *reference; | attempting a read access using at ALLOC[0x0], but that tag does not exist in the borrow stack for this location | this error occurs as part of an access at ALLOC[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: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 help: was created by a retag at offsets [0x0..0x4] --> $DIR/illegal_write4.rs:LL:CC diff --git a/tests/fail/stacked_borrows/illegal_write5.stderr b/tests/fail/stacked_borrows/illegal_write5.stderr index f9a4dcfd8d21d..b119908145654 100644 --- a/tests/fail/stacked_borrows/illegal_write5.stderr +++ b/tests/fail/stacked_borrows/illegal_write5.stderr @@ -7,7 +7,7 @@ LL | let _val = *xref; | attempting a read access using at ALLOC[0x0], but that tag does not exist in the borrow stack for this location | this error occurs as part of an access at ALLOC[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: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 help: was created by a retag at offsets [0x0..0x4] --> $DIR/illegal_write5.rs:LL:CC diff --git a/tests/fail/stacked_borrows/illegal_write6.stderr b/tests/fail/stacked_borrows/illegal_write6.stderr index 5861aeefaf46c..a58abc8377a00 100644 --- a/tests/fail/stacked_borrows/illegal_write6.stderr +++ b/tests/fail/stacked_borrows/illegal_write6.stderr @@ -4,7 +4,7 @@ error: Undefined Behavior: not granting access to tag because incompa LL | unsafe { *y = 2; } | ^^^^^^ not granting access to tag because incompatible item is protected: [Unique for (call ID)] | - = help: this indicates a potential bug in the program: it performed an invalid operation, but the rules it violated are still experimental + = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 help: tag was most recently created at offsets [0x0..0x4] --> $DIR/illegal_write6.rs:LL:CC diff --git a/tests/fail/stacked_borrows/interior_mut1.stderr b/tests/fail/stacked_borrows/interior_mut1.stderr index af4163c93605e..82cb6e19133d6 100644 --- a/tests/fail/stacked_borrows/interior_mut1.stderr +++ b/tests/fail/stacked_borrows/interior_mut1.stderr @@ -7,7 +7,7 @@ LL | let _val = *inner_shr.get(); | trying to reborrow 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 rules it violated are still experimental + = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 help: was created by a retag at offsets [0x0..0x4] --> $DIR/interior_mut1.rs:LL:CC diff --git a/tests/fail/stacked_borrows/interior_mut2.stderr b/tests/fail/stacked_borrows/interior_mut2.stderr index 5a4ddf381e715..c8a06e32fda03 100644 --- a/tests/fail/stacked_borrows/interior_mut2.stderr +++ b/tests/fail/stacked_borrows/interior_mut2.stderr @@ -7,7 +7,7 @@ LL | let _val = *inner_shr.get(); | trying to reborrow 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 rules it violated are still experimental + = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 help: was created by a retag at offsets [0x0..0x4] --> $DIR/interior_mut2.rs:LL:CC diff --git a/tests/fail/stacked_borrows/invalidate_against_barrier1.stderr b/tests/fail/stacked_borrows/invalidate_against_barrier1.stderr index 47f7a06a85851..08d597ea1895b 100644 --- a/tests/fail/stacked_borrows/invalidate_against_barrier1.stderr +++ b/tests/fail/stacked_borrows/invalidate_against_barrier1.stderr @@ -4,7 +4,7 @@ error: Undefined Behavior: not granting access to tag because incompa LL | let _val = unsafe { *x }; | ^^ not granting access to tag because incompatible item is protected: [Unique for (call ID)] | - = help: this indicates a potential bug in the program: it performed an invalid operation, but the rules it violated are still experimental + = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 help: tag was most recently created at offsets [0x0..0x4] --> $DIR/invalidate_against_barrier1.rs:LL:CC diff --git a/tests/fail/stacked_borrows/invalidate_against_barrier2.stderr b/tests/fail/stacked_borrows/invalidate_against_barrier2.stderr index fa2e6aa05a2b8..6aefa216ed56d 100644 --- a/tests/fail/stacked_borrows/invalidate_against_barrier2.stderr +++ b/tests/fail/stacked_borrows/invalidate_against_barrier2.stderr @@ -4,7 +4,7 @@ error: Undefined Behavior: not granting access to tag because incompa LL | unsafe { *x = 0 }; | ^^^^^^ not granting access to tag because incompatible item is protected: [SharedReadOnly for (call ID)] | - = help: this indicates a potential bug in the program: it performed an invalid operation, but the rules it violated are still experimental + = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 help: tag was most recently created at offsets [0x0..0x4] --> $DIR/invalidate_against_barrier2.rs:LL:CC diff --git a/tests/fail/stacked_borrows/load_invalid_mut.stderr b/tests/fail/stacked_borrows/load_invalid_mut.stderr index 00eda4fe5a316..a15900411ce47 100644 --- a/tests/fail/stacked_borrows/load_invalid_mut.stderr +++ b/tests/fail/stacked_borrows/load_invalid_mut.stderr @@ -7,7 +7,7 @@ LL | let _val = *xref_in_mem; | trying to reborrow 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 rules it violated are still experimental + = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 help: was created by a retag at offsets [0x0..0x4] --> $DIR/load_invalid_mut.rs:LL:CC diff --git a/tests/fail/stacked_borrows/load_invalid_shr.stderr b/tests/fail/stacked_borrows/load_invalid_shr.stderr index eb61b4762f846..85cb8ef93ebd6 100644 --- a/tests/fail/stacked_borrows/load_invalid_shr.stderr +++ b/tests/fail/stacked_borrows/load_invalid_shr.stderr @@ -7,7 +7,7 @@ LL | let _val = *xref_in_mem; | trying to reborrow 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 rules it violated are still experimental + = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 help: was created by a retag at offsets [0x0..0x4] --> $DIR/load_invalid_shr.rs:LL:CC diff --git a/tests/fail/stacked_borrows/mut_exclusive_violation1.stderr b/tests/fail/stacked_borrows/mut_exclusive_violation1.stderr index 2d8ef7c1a4eb4..4e38bcd2a89ce 100644 --- a/tests/fail/stacked_borrows/mut_exclusive_violation1.stderr +++ b/tests/fail/stacked_borrows/mut_exclusive_violation1.stderr @@ -7,7 +7,7 @@ LL | *LEAK = 7; | attempting a write access using at ALLOC[0x0], but that tag does not exist in the borrow stack for this location | this error occurs as part of an access at ALLOC[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: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 help: tag was most recently created at offsets [0x0..0x4] --> $DIR/mut_exclusive_violation1.rs:LL:CC diff --git a/tests/fail/stacked_borrows/mut_exclusive_violation2.stderr b/tests/fail/stacked_borrows/mut_exclusive_violation2.stderr index ae0eab467bf60..fd52dbe348acc 100644 --- a/tests/fail/stacked_borrows/mut_exclusive_violation2.stderr +++ b/tests/fail/stacked_borrows/mut_exclusive_violation2.stderr @@ -7,7 +7,7 @@ LL | let _val = *raw1; | attempting a read access using at ALLOC[0x0], but that tag does not exist in the borrow stack for this location | this error occurs as part of an access at ALLOC[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: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 help: was created by a retag at offsets [0x0..0x4] --> $DIR/mut_exclusive_violation2.rs:LL:CC diff --git a/tests/fail/stacked_borrows/outdated_local.stderr b/tests/fail/stacked_borrows/outdated_local.stderr index 1c1deac2317f3..fe3bdd00f462e 100644 --- a/tests/fail/stacked_borrows/outdated_local.stderr +++ b/tests/fail/stacked_borrows/outdated_local.stderr @@ -7,7 +7,7 @@ LL | assert_eq!(unsafe { *y }, 1); | attempting a read access using at ALLOC[0x0], but that tag does not exist in the borrow stack for this location | this error occurs as part of an access at ALLOC[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: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 help: tag was most recently created at offsets [0x0..0x4] --> $DIR/outdated_local.rs:LL:CC diff --git a/tests/fail/stacked_borrows/pass_invalid_mut.stderr b/tests/fail/stacked_borrows/pass_invalid_mut.stderr index 280e51693a5c0..6af914e55f919 100644 --- a/tests/fail/stacked_borrows/pass_invalid_mut.stderr +++ b/tests/fail/stacked_borrows/pass_invalid_mut.stderr @@ -7,7 +7,7 @@ LL | foo(xref); | trying to reborrow 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 rules it violated are still experimental + = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 help: was created by a retag at offsets [0x0..0x4] --> $DIR/pass_invalid_mut.rs:LL:CC diff --git a/tests/fail/stacked_borrows/pass_invalid_shr.stderr b/tests/fail/stacked_borrows/pass_invalid_shr.stderr index b111832193b9c..d38c582734539 100644 --- a/tests/fail/stacked_borrows/pass_invalid_shr.stderr +++ b/tests/fail/stacked_borrows/pass_invalid_shr.stderr @@ -7,7 +7,7 @@ LL | foo(xref); | trying to reborrow 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 rules it violated are still experimental + = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 help: was created by a retag at offsets [0x0..0x4] --> $DIR/pass_invalid_shr.rs:LL:CC diff --git a/tests/fail/stacked_borrows/pointer_smuggling.stderr b/tests/fail/stacked_borrows/pointer_smuggling.stderr index 097de439f79df..68ac631ec09e5 100644 --- a/tests/fail/stacked_borrows/pointer_smuggling.stderr +++ b/tests/fail/stacked_borrows/pointer_smuggling.stderr @@ -7,7 +7,7 @@ LL | let _x = unsafe { *PTR }; | attempting a read access using at ALLOC[0x0], but that tag does not exist in the borrow stack for this location | this error occurs as part of an access at ALLOC[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: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 help: tag was most recently created at offsets [0x0..0x1] --> $DIR/pointer_smuggling.rs:LL:CC diff --git a/tests/fail/stacked_borrows/raw_tracking.stderr b/tests/fail/stacked_borrows/raw_tracking.stderr index a03d55a90486a..93ae613c3c6b4 100644 --- a/tests/fail/stacked_borrows/raw_tracking.stderr +++ b/tests/fail/stacked_borrows/raw_tracking.stderr @@ -7,7 +7,7 @@ LL | unsafe { *raw1 = 13; } | attempting a write access using at ALLOC[0x0], but that tag does not exist in the borrow stack for this location | this error occurs as part of an access at ALLOC[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: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 help: was created by a retag at offsets [0x0..0x4] --> $DIR/raw_tracking.rs:LL:CC diff --git a/tests/fail/stacked_borrows/return_invalid_mut.stderr b/tests/fail/stacked_borrows/return_invalid_mut.stderr index 6de657b829808..876850590e51e 100644 --- a/tests/fail/stacked_borrows/return_invalid_mut.stderr +++ b/tests/fail/stacked_borrows/return_invalid_mut.stderr @@ -7,7 +7,7 @@ LL | ret | trying to reborrow 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 rules it violated are still experimental + = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 help: was created by a retag at offsets [0x4..0x8] --> $DIR/return_invalid_mut.rs:LL:CC diff --git a/tests/fail/stacked_borrows/return_invalid_mut_option.stderr b/tests/fail/stacked_borrows/return_invalid_mut_option.stderr index 8b95765dcc460..98decdc3adc81 100644 --- a/tests/fail/stacked_borrows/return_invalid_mut_option.stderr +++ b/tests/fail/stacked_borrows/return_invalid_mut_option.stderr @@ -7,7 +7,7 @@ LL | Some(_x) => {}, | trying to reborrow 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 rules it violated are still experimental + = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 help: was created by a retag at offsets [0x4..0x8] --> $DIR/return_invalid_mut_option.rs:LL:CC diff --git a/tests/fail/stacked_borrows/return_invalid_mut_tuple.stderr b/tests/fail/stacked_borrows/return_invalid_mut_tuple.stderr index f9e6d65c78e66..3062d821765a3 100644 --- a/tests/fail/stacked_borrows/return_invalid_mut_tuple.stderr +++ b/tests/fail/stacked_borrows/return_invalid_mut_tuple.stderr @@ -7,7 +7,7 @@ LL | foo(&mut (1, 2)).0; | trying to reborrow 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 rules it violated are still experimental + = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 help: was created by a retag at offsets [0x4..0x8] --> $DIR/return_invalid_mut_tuple.rs:LL:CC diff --git a/tests/fail/stacked_borrows/return_invalid_shr.stderr b/tests/fail/stacked_borrows/return_invalid_shr.stderr index 20dcb8e93c2cf..aa3f7ddde59e2 100644 --- a/tests/fail/stacked_borrows/return_invalid_shr.stderr +++ b/tests/fail/stacked_borrows/return_invalid_shr.stderr @@ -7,7 +7,7 @@ LL | ret | trying to reborrow 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 rules it violated are still experimental + = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 help: was created by a retag at offsets [0x4..0x8] --> $DIR/return_invalid_shr.rs:LL:CC diff --git a/tests/fail/stacked_borrows/return_invalid_shr_option.stderr b/tests/fail/stacked_borrows/return_invalid_shr_option.stderr index 0c41a10a3f97c..81244a87cb065 100644 --- a/tests/fail/stacked_borrows/return_invalid_shr_option.stderr +++ b/tests/fail/stacked_borrows/return_invalid_shr_option.stderr @@ -7,7 +7,7 @@ LL | Some(_x) => {}, | trying to reborrow 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 rules it violated are still experimental + = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 help: was created by a retag at offsets [0x4..0x8] --> $DIR/return_invalid_shr_option.rs:LL:CC diff --git a/tests/fail/stacked_borrows/return_invalid_shr_tuple.stderr b/tests/fail/stacked_borrows/return_invalid_shr_tuple.stderr index 9e7be7ad01388..9519f2f6f07b7 100644 --- a/tests/fail/stacked_borrows/return_invalid_shr_tuple.stderr +++ b/tests/fail/stacked_borrows/return_invalid_shr_tuple.stderr @@ -7,7 +7,7 @@ LL | foo(&mut (1, 2)).0; | trying to reborrow 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 rules it violated are still experimental + = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 help: was created by a retag at offsets [0x4..0x8] --> $DIR/return_invalid_shr_tuple.rs:LL:CC diff --git a/tests/fail/stacked_borrows/shared_rw_borrows_are_weak1.stderr b/tests/fail/stacked_borrows/shared_rw_borrows_are_weak1.stderr index 576a21bbf6d41..8bb67f62b5318 100644 --- a/tests/fail/stacked_borrows/shared_rw_borrows_are_weak1.stderr +++ b/tests/fail/stacked_borrows/shared_rw_borrows_are_weak1.stderr @@ -7,7 +7,7 @@ LL | y.get_mut(); | trying to reborrow 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 rules it violated are still experimental + = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 help: was created by a retag at offsets [0x0..0x4] --> $DIR/shared_rw_borrows_are_weak1.rs:LL:CC diff --git a/tests/fail/stacked_borrows/shared_rw_borrows_are_weak2.stderr b/tests/fail/stacked_borrows/shared_rw_borrows_are_weak2.stderr index e2159ed5892f8..b339785d64842 100644 --- a/tests/fail/stacked_borrows/shared_rw_borrows_are_weak2.stderr +++ b/tests/fail/stacked_borrows/shared_rw_borrows_are_weak2.stderr @@ -7,7 +7,7 @@ LL | let _val = *y; | attempting a read access using at ALLOC[$HEX], but that tag does not exist in the borrow stack for this location | this error occurs as part of an access at ALLOC[$HEX..$HEX] | - = help: this indicates a potential bug in the program: it performed an invalid operation, but the rules it violated are still experimental + = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 help: was created by a retag at offsets [$HEX..$HEX] --> $DIR/shared_rw_borrows_are_weak2.rs:LL:CC diff --git a/tests/fail/stacked_borrows/shr_frozen_violation1.stderr b/tests/fail/stacked_borrows/shr_frozen_violation1.stderr index 689ad1c6b6684..a2487cca278cc 100644 --- a/tests/fail/stacked_borrows/shr_frozen_violation1.stderr +++ b/tests/fail/stacked_borrows/shr_frozen_violation1.stderr @@ -7,7 +7,7 @@ LL | unsafe { *(x as *const i32 as *mut i32) = 7; } | attempting a write access using at ALLOC[0x0], but that tag only grants SharedReadOnly permission for this location | this error occurs as part of an access at ALLOC[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: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 help: tag was most recently created at offsets [0x0..0x4] --> $DIR/shr_frozen_violation1.rs:LL:CC diff --git a/tests/fail/stacked_borrows/transmute-is-no-escape.stderr b/tests/fail/stacked_borrows/transmute-is-no-escape.stderr index f2ea4f919c676..75d74ce393463 100644 --- a/tests/fail/stacked_borrows/transmute-is-no-escape.stderr +++ b/tests/fail/stacked_borrows/transmute-is-no-escape.stderr @@ -7,7 +7,7 @@ LL | unsafe { *raw = 13; } | attempting a write access using at ALLOC[0x0], but that tag does not exist in the borrow stack for this location | this error occurs as part of an access at ALLOC[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: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 = note: inside `main` at $DIR/transmute-is-no-escape.rs:LL:CC diff --git a/tests/fail/stacked_borrows/unescaped_local.stderr b/tests/fail/stacked_borrows/unescaped_local.stderr index a8d869549a9a7..42a81245f2a83 100644 --- a/tests/fail/stacked_borrows/unescaped_local.stderr +++ b/tests/fail/stacked_borrows/unescaped_local.stderr @@ -7,7 +7,7 @@ LL | unsafe { *raw = 13; } | attempting a write access using at ALLOC[0x0], but that tag does not exist in the borrow stack for this location | this error occurs as part of an access at ALLOC[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: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 help: tag was most recently created at offsets [0x0..0x4] --> $DIR/unescaped_local.rs:LL:CC diff --git a/tests/fail/stacked_borrows/unescaped_static.stderr b/tests/fail/stacked_borrows/unescaped_static.stderr index b191855644c2e..a0ac19f042934 100644 --- a/tests/fail/stacked_borrows/unescaped_static.stderr +++ b/tests/fail/stacked_borrows/unescaped_static.stderr @@ -7,7 +7,7 @@ LL | let _val = unsafe { *ptr_to_first.add(1) }; | attempting a read access using at ALLOC[0x1], but that tag does not exist in the borrow stack for this location | this error occurs as part of an access at ALLOC[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: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 = note: inside `main` at $DIR/unescaped_static.rs:LL:CC diff --git a/tests/fail/stacked_borrows/vtable.rs b/tests/fail/stacked_borrows/vtable.rs new file mode 100644 index 0000000000000..dd9ba1dfb2bda --- /dev/null +++ b/tests/fail/stacked_borrows/vtable.rs @@ -0,0 +1,19 @@ +// error-pattern: vtable pointer does not have permission +#![feature(ptr_metadata)] + +trait Foo {} + +impl Foo for u32 {} + +fn uwu(thin: *const (), meta: &'static ()) -> *const dyn Foo { + core::ptr::from_raw_parts(thin, unsafe { core::mem::transmute(meta) }) +} + +fn main() { + unsafe { + let orig = 1_u32; + let x = &orig as &dyn Foo; + let (ptr, meta) = (x as *const dyn Foo).to_raw_parts(); + let _ = uwu(ptr, core::mem::transmute(meta)); + } +} diff --git a/tests/fail/stacked_borrows/vtable.stderr b/tests/fail/stacked_borrows/vtable.stderr new file mode 100644 index 0000000000000..ac3d71045f0cc --- /dev/null +++ b/tests/fail/stacked_borrows/vtable.stderr @@ -0,0 +1,25 @@ +error: Undefined Behavior: type validation failed: encountered vtable pointer does not have permission to read drop function pointer + --> RUSTLIB/core/src/ptr/metadata.rs:LL:CC + | +LL | unsafe { PtrRepr { components: PtrComponents { data_address, metadata } }.const_ptr } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered vtable pointer does not have permission to read drop function pointer + | + = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior + = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information + + = note: inside `std::ptr::from_raw_parts::` at RUSTLIB/core/src/ptr/metadata.rs:LL:CC +note: inside `uwu` at $DIR/vtable.rs:LL:CC + --> $DIR/vtable.rs:LL:CC + | +LL | core::ptr::from_raw_parts(thin, unsafe { core::mem::transmute(meta) }) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +note: inside `main` at $DIR/vtable.rs:LL:CC + --> $DIR/vtable.rs:LL:CC + | +LL | let _ = uwu(ptr, core::mem::transmute(meta)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace + +error: aborting due to previous error + diff --git a/tests/fail/stacked_borrows/zst_slice.stderr b/tests/fail/stacked_borrows/zst_slice.stderr index 6809aa3d25fbd..3474f0c2b4234 100644 --- a/tests/fail/stacked_borrows/zst_slice.stderr +++ b/tests/fail/stacked_borrows/zst_slice.stderr @@ -7,7 +7,7 @@ LL | unsafe { &*index.get_unchecked(self) } | trying to reborrow 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 rules it violated are still experimental + = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows 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 help: was created by a retag at offsets [0x0..0x0] --> $DIR/zst_slice.rs:LL:CC