Skip to content

Commit 0124715

Browse files
committed
Auto merge of #146614 - Zalathar:rollup-hcxvdi1, r=Zalathar
Rollup of 9 pull requests Successful merges: - rust-lang/rust#145095 (Migrate `UnsizedConstParamTy` to unstable impl of `ConstParamTy_`) - rust-lang/rust#145960 (Split `FnCtxt::report_args_error` into subfunctions) - rust-lang/rust#146402 (interpret: fix overlapping aggregate initialization) - rust-lang/rust#146466 (llvm-wrapper: other cleanup) - rust-lang/rust#146574 (compiletest: Enable new-output-capture by default) - rust-lang/rust#146599 (replace some `#[const_trait]` with `const trait`) - rust-lang/rust#146601 (compiletest: Make `./x test --test-args ...` work again) - rust-lang/rust#146608 (improve internal bootstrap docs) - rust-lang/rust#146609 (bootstrap: lower verbosity of cargo to one less than bootstrap's) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 1867c58 + a1b5ad2 commit 0124715

12 files changed

+63
-7
lines changed

tests/fail/both_borrows/issue-miri-1050-1.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
//@revisions: stack tree
2+
// Ensure this even hits the aliasing model
3+
//@compile-flags: -Zmiri-disable-validation
24
//@[tree]compile-flags: -Zmiri-tree-borrows
35
//@error-in-other-file: pointer not dereferenceable
46

tests/fail/both_borrows/issue-miri-1050-2.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
//@revisions: stack tree
2+
// Ensure this even hits the aliasing model
3+
//@compile-flags: -Zmiri-disable-validation
24
//@[tree]compile-flags: -Zmiri-tree-borrows
35
//@error-in-other-file: is a dangling pointer
46
use std::ptr::NonNull;

tests/fail/both_borrows/return_invalid_shr.stack.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ help: <TAG> was created by a SharedReadOnly retag at offsets [0x4..0x8]
1111
|
1212
LL | let ret = unsafe { &(*xraw).1 };
1313
| ^^^^^^^^^^
14-
help: <TAG> was later invalidated at offsets [0x0..0x8] by a write access
14+
help: <TAG> was later invalidated at offsets [0x4..0x8] by a write access
1515
--> tests/fail/both_borrows/return_invalid_shr.rs:LL:CC
1616
|
1717
LL | unsafe { *xraw = (42, 23) }; // unfreeze

tests/fail/both_borrows/return_invalid_shr.tree.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ help: the accessed tag <TAG> was created here, in the initial state Frozen
1212
|
1313
LL | let ret = unsafe { &(*xraw).1 };
1414
| ^^^^^^^^^^
15-
help: the accessed tag <TAG> later transitioned to Disabled due to a foreign write access at offsets [0x0..0x8]
15+
help: the accessed tag <TAG> later transitioned to Disabled due to a foreign write access at offsets [0x4..0x8]
1616
--> tests/fail/both_borrows/return_invalid_shr.rs:LL:CC
1717
|
1818
LL | unsafe { *xraw = (42, 23) }; // unfreeze

tests/fail/both_borrows/return_invalid_shr_option.stack.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ help: <TAG> was created by a SharedReadOnly retag at offsets [0x4..0x8]
1414
|
1515
LL | let ret = Some(unsafe { &(*xraw).1 });
1616
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
17-
help: <TAG> was later invalidated at offsets [0x0..0x8] by a write access
17+
help: <TAG> was later invalidated at offsets [0x4..0x8] by a write access
1818
--> tests/fail/both_borrows/return_invalid_shr_option.rs:LL:CC
1919
|
2020
LL | unsafe { *xraw = (42, 23) }; // unfreeze

tests/fail/both_borrows/return_invalid_shr_option.tree.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ help: the accessed tag <TAG> was created here, in the initial state Frozen
1212
|
1313
LL | let ret = Some(unsafe { &(*xraw).1 });
1414
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
15-
help: the accessed tag <TAG> later transitioned to Disabled due to a foreign write access at offsets [0x0..0x8]
15+
help: the accessed tag <TAG> later transitioned to Disabled due to a foreign write access at offsets [0x4..0x8]
1616
--> tests/fail/both_borrows/return_invalid_shr_option.rs:LL:CC
1717
|
1818
LL | unsafe { *xraw = (42, 23) }; // unfreeze

tests/fail/both_borrows/return_invalid_shr_tuple.stack.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ help: <TAG> was created by a SharedReadOnly retag at offsets [0x4..0x8]
1414
|
1515
LL | let ret = (unsafe { &(*xraw).1 },);
1616
| ^^^^^^^^^^^^^^^^^^^^^^^^
17-
help: <TAG> was later invalidated at offsets [0x0..0x8] by a write access
17+
help: <TAG> was later invalidated at offsets [0x4..0x8] by a write access
1818
--> tests/fail/both_borrows/return_invalid_shr_tuple.rs:LL:CC
1919
|
2020
LL | unsafe { *xraw = (42, 23) }; // unfreeze

tests/fail/both_borrows/return_invalid_shr_tuple.tree.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ help: the accessed tag <TAG> was created here, in the initial state Frozen
1212
|
1313
LL | let ret = (unsafe { &(*xraw).1 },);
1414
| ^^^^^^^^^^^^^^^^^^^^^^^^
15-
help: the accessed tag <TAG> later transitioned to Disabled due to a foreign write access at offsets [0x0..0x8]
15+
help: the accessed tag <TAG> later transitioned to Disabled due to a foreign write access at offsets [0x4..0x8]
1616
--> tests/fail/both_borrows/return_invalid_shr_tuple.rs:LL:CC
1717
|
1818
LL | unsafe { *xraw = (42, 23) }; // unfreeze
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//! This is like `pass/overlapping_assignment_aggregate_scalar.rs` but with a non-scalar
2+
//! type, and that makes it definite UB.
3+
#![feature(custom_mir, core_intrinsics)]
4+
#![allow(internal_features)]
5+
6+
use std::intrinsics::mir::*;
7+
8+
#[custom_mir(dialect = "runtime")]
9+
fn main() {
10+
mir! {
11+
let _1: ([u8; 1],);
12+
{
13+
_1.0 = [0_u8; 1];
14+
_1 = (_1.0, ); //~ERROR: overlapping ranges
15+
Return()
16+
}
17+
}
18+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
error: Undefined Behavior: `copy_nonoverlapping` called on overlapping ranges
2+
--> tests/fail/overlapping_assignment_aggregate.rs:LL:CC
3+
|
4+
LL | _1 = (_1.0, );
5+
| ^^^^^^^^^^^^^ Undefined Behavior occurred here
6+
|
7+
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
8+
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
9+
= note: BACKTRACE:
10+
= note: inside `main` at tests/fail/overlapping_assignment_aggregate.rs:LL:CC
11+
12+
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
13+
14+
error: aborting due to 1 previous error
15+

0 commit comments

Comments
 (0)