Skip to content

Commit 28f6265

Browse files
committed
And fix the UI tests that also had their error optimized out
1 parent c50de3c commit 28f6265

14 files changed

+28
-7
lines changed

tests/ui/limits/huge-array-simple-32.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
//@ ignore-64bit
22
//@ build-fail
33

4+
//@ compile-flags: -Z mir-opt-level=0
5+
// (The optimizations would remove the values on which this errors.)
6+
47
#![allow(arithmetic_overflow)]
58

69
fn main() {

tests/ui/limits/huge-array-simple-32.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: values of the type `[u8; 2147516416]` are too big for the current architecture
2-
--> $DIR/huge-array-simple-32.rs:7:9
2+
--> $DIR/huge-array-simple-32.rs:10:9
33
|
44
LL | let _fat: [u8; (1<<31)+(1<<15)] =
55
| ^^^^

tests/ui/limits/huge-array-simple-64.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
//@ build-fail
22
//@ ignore-32bit
33

4+
//@ compile-flags: -Z mir-opt-level=0
5+
// (The optimizations would remove the values on which this errors.)
6+
47
#![allow(arithmetic_overflow)]
58

69
fn main() {

tests/ui/limits/huge-array-simple-64.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: values of the type `[u8; 2305843011361177600]` are too big for the current architecture
2-
--> $DIR/huge-array-simple-64.rs:7:9
2+
--> $DIR/huge-array-simple-64.rs:10:9
33
|
44
LL | let _fat: [u8; (1<<61)+(1<<31)] =
55
| ^^^^

tests/ui/limits/huge-array.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
//@ build-fail
22

3+
//@ compile-flags: -Z mir-opt-level=0
4+
// (The optimizations would remove the values on which this errors.)
5+
36
fn generic<T: Copy>(t: T) {
47
let s: [T; 1518600000] = [t; 1518600000];
58
//~^ ERROR values of the type `[[u8; 1518599999]; 1518600000]` are too big

tests/ui/limits/huge-array.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: values of the type `[[u8; 1518599999]; 1518600000]` are too big for the current architecture
2-
--> $DIR/huge-array.rs:4:9
2+
--> $DIR/huge-array.rs:7:9
33
|
44
LL | let s: [T; 1518600000] = [t; 1518600000];
55
| ^

tests/ui/limits/huge-enum.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
//@ normalize-stderr-test: "std::option::Option<\[u32; \d+\]>" -> "TYPE"
33
//@ normalize-stderr-test: "\[u32; \d+\]" -> "TYPE"
44

5+
//@ compile-flags: -Z mir-opt-level=0
6+
// (The optimizations would remove the values on which this errors.)
7+
58
#[cfg(target_pointer_width = "32")]
69
type BIG = Option<[u32; (1<<29)-1]>;
710

tests/ui/limits/huge-enum.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: values of the type `Option<TYPE>` are too big for the current architecture
2-
--> $DIR/huge-enum.rs:12:9
2+
--> $DIR/huge-enum.rs:15:9
33
|
44
LL | let big: BIG = None;
55
| ^^^

tests/ui/limits/huge-struct.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
//@ normalize-stderr-test: "S1M" -> "SXX"
44
//@ error-pattern: too big for the current
55

6+
//@ compile-flags: -Z mir-opt-level=0
7+
// (The optimizations would remove the values on which this errors.)
8+
69
struct S32<T> {
710
v0: T,
811
v1: T,

tests/ui/limits/huge-struct.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: values of the type `SXX<SXX<SXX<u32>>>` are too big for the current architecture
2-
--> $DIR/huge-struct.rs:46:9
2+
--> $DIR/huge-struct.rs:49:9
33
|
44
LL | let fat: Option<SXX<SXX<SXX<u32>>>> = None;
55
| ^^^

tests/ui/limits/issue-15919-32.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
//@ ignore-64bit
22
//@ build-fail
33

4+
//@ compile-flags: -Z mir-opt-level=0
5+
// (The optimizations would remove the values on which this errors.)
6+
47
fn main() {
58
let x = [0usize; 0xffff_ffff]; //~ ERROR too big
69
}

tests/ui/limits/issue-15919-32.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: values of the type `[usize; usize::MAX]` are too big for the current architecture
2-
--> $DIR/issue-15919-32.rs:5:9
2+
--> $DIR/issue-15919-32.rs:8:9
33
|
44
LL | let x = [0usize; 0xffff_ffff];
55
| ^

tests/ui/limits/issue-15919-64.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
//@ build-fail
22
//@ ignore-32bit
33

4+
//@ compile-flags: -Z mir-opt-level=0
5+
// (The optimizations would remove the values on which this errors.)
6+
47
fn main() {
58
let x = [0usize; 0xffff_ffff_ffff_ffff]; //~ ERROR too big
69
}

tests/ui/limits/issue-15919-64.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: values of the type `[usize; usize::MAX]` are too big for the current architecture
2-
--> $DIR/issue-15919-64.rs:5:9
2+
--> $DIR/issue-15919-64.rs:8:9
33
|
44
LL | let x = [0usize; 0xffff_ffff_ffff_ffff];
55
| ^

0 commit comments

Comments
 (0)