Skip to content

Commit 3bcd276

Browse files
committed
Auto merge of rust-lang#2590 - RalfJung:rustup, r=RalfJung
Rustup
2 parents 10ef1cb + ccbc63b commit 3bcd276

14 files changed

+19
-59
lines changed

src/tools/miri/rust-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
e42c4d7218b2596276152c5eb1e69335621f3086
1+
f382c2748aec2ada91eff88840c996644ff0f70d

src/tools/miri/test-cargo-miri/test.filter.cross-target.stdout.ref

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11

2-
running 0 tests
3-
4-
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
5-
6-
72
running 0 tests
83

94
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 2 filtered out
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11

2-
running 0 tests
3-
4-
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
5-
6-
72
running 0 tests
83

94
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 2 filtered out
@@ -15,3 +10,8 @@ test simple ... ok
1510

1611
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 5 filtered out
1712

13+
14+
running 0 tests
15+
16+
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 4 filtered out; finished in $TIME
17+

src/tools/miri/tests/fail/erroneous_const.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// Inlining changes the error location
44
//@compile-flags: -Zmir-opt-level=0
55
#![feature(never_type)]
6-
#![warn(warnings, const_err)]
76

87
struct PrintName<T>(T);
98
impl<T> PrintName<T> {
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
const X: u32 = 5;
22
const Y: u32 = 6;
33
const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
4-
//~^ERROR: any use of this value
5-
//~|WARN: previously accepted
4+
//~^ERROR: evaluation of constant value failed
65

76
#[rustfmt::skip] // rustfmt bug: https://github.com/rust-lang/rustfmt/issues/5391
87
fn main() {
9-
println!("{}", FOO); //~ERROR: post-monomorphization error
10-
//~|ERROR: evaluation of constant value failed
11-
//~|ERROR: erroneous constant used
12-
//~|WARN: previously accepted
8+
println!("{}", FOO);
139
}
Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,9 @@
1-
error: any use of this value will cause an error
2-
--> $DIR/erroneous_const2.rs:LL:CC
3-
|
4-
LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
5-
| -------------- ^^^^^ attempt to compute `5_u32 - 6_u32`, which would overflow
6-
|
7-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
8-
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
9-
= note: `#[deny(const_err)]` on by default
10-
111
error[E0080]: evaluation of constant value failed
122
--> $DIR/erroneous_const2.rs:LL:CC
133
|
14-
LL | println!("{}", FOO);
15-
| ^^^ referenced constant has errors
16-
17-
error: erroneous constant used
18-
--> $DIR/erroneous_const2.rs:LL:CC
19-
|
20-
LL | println!("{}", FOO);
21-
| ^^^ referenced constant has errors
22-
|
23-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
24-
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
25-
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
26-
27-
error: post-monomorphization error: referenced constant has errors
28-
--> $DIR/erroneous_const2.rs:LL:CC
29-
|
30-
LL | println!("{}", FOO);
31-
| ^^^ referenced constant has errors
32-
|
33-
= note: inside `main` at $DIR/erroneous_const2.rs:LL:CC
34-
35-
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
4+
LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
5+
| ^^^^^ attempt to compute `5_u32 - 6_u32`, which would overflow
366

37-
error: aborting due to 4 previous errors
7+
error: aborting due to previous error
388

399
For more information about this error, try `rustc --explain E0080`.

src/tools/miri/tests/fail/unaligned_pointers/dyn_alignment.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ struct MuchAlign;
77

88
fn main() {
99
// Try many times as this might work by chance.
10-
for _ in 0..10 {
10+
for _ in 0..20 {
1111
let buf = [0u32; 256];
1212
// `buf` is sufficiently aligned for `layout.align` on a `dyn Debug`, but not
1313
// for the actual alignment required by `MuchAlign`.

src/tools/miri/tests/fail/unaligned_pointers/reference_to_packed.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ struct Foo {
1111

1212
fn main() {
1313
// Try many times as this might work by chance.
14-
for _ in 0..10 {
14+
for _ in 0..20 {
1515
let foo = Foo { x: 42, y: 99 };
1616
let p = &foo.x;
1717
let i = *p; //~ERROR: alignment 4 is required

src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
fn main() {
55
// Try many times as this might work by chance.
6-
for _ in 0..10 {
6+
for _ in 0..20 {
77
let x = [2u16, 3, 4]; // Make it big enough so we don't get an out-of-bounds error.
88
let x = &x[0] as *const _ as *const u32;
99
// This must fail because alignment is violated: the allocation's base is not sufficiently aligned.

src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr3.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
fn main() {
55
// Try many times as this might work by chance.
6-
for _ in 0..10 {
6+
for _ in 0..20 {
77
let x = [2u16, 3, 4, 5]; // Make it big enough so we don't get an out-of-bounds error.
88
let x = &x[0] as *const _ as *const *const u8; // cast to ptr-to-ptr, so that we load a ptr
99
// This must fail because alignment is violated. Test specifically for loading pointers,

src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr4.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ fn main() {
66
// (This would be missed if u8 allocations are *always* at odd addresses.)
77
//
88
// Try many times as this might work by chance.
9-
for _ in 0..10 {
9+
for _ in 0..20 {
1010
let x = [0u8; 4];
1111
let ptr = x.as_ptr().wrapping_offset(1).cast::<u16>();
1212
let _val = unsafe { *ptr }; //~ERROR: but alignment

src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr_addr_of.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::ptr;
44

55
fn main() {
66
// Try many times as this might work by chance.
7-
for _ in 0..10 {
7+
for _ in 0..20 {
88
let x = [2u16, 3, 4]; // Make it big enough so we don't get an out-of-bounds error.
99
let x = &x[0] as *const _ as *const u32;
1010
// This must fail because alignment is violated: the allocation's base is not sufficiently aligned.

src/tools/miri/tests/fail/unaligned_pointers/unaligned_ptr_zst.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
fn main() {
66
// Try many times as this might work by chance.
7-
for i in 0..10 {
7+
for i in 0..20 {
88
let x = i as u8;
99
let x = &x as *const _ as *const [u32; 0];
1010
// This must fail because alignment is violated. Test specifically for loading ZST.

src/tools/miri/tests/pass/align.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ fn align_to() {
2222

2323
fn main() {
2424
// Do this a couple times in a loop because it may work "by chance".
25-
for _ in 0..10 {
25+
for _ in 0..20 {
2626
manual_alignment();
2727
align_to();
2828
}

0 commit comments

Comments
 (0)