Skip to content

Commit 1973f7e

Browse files
committed
Fixes to compile-fail error messages post-rebase.
1 parent 1f5e45b commit 1973f7e

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

src/test/compile-fail/const-eval-overflow-3.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ use std::{u8, u16, u32, u64, usize};
2222
const A_I8_I
2323
: [u32; (i8::MAX as usize) + 1]
2424
= [0; (i8::MAX + 1) as usize];
25-
//~^ ERROR error evaluating count: attempted to add with overflow
25+
//~^ ERROR mismatched types
26+
//~| ERROR expected constant integer for repeat count, but attempted to add with overflow
2627

2728
fn main() {
2829
foo(&A_I8_I[..]);

src/test/compile-fail/const-eval-overflow-3b.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ const A_I8_I
2727
: [u32; (i8::MAX as usize) + 1]
2828
= [0; (i8::MAX + 1u8) as usize];
2929
//~^ ERROR mismatched types
30+
//~| ERROR mismatched types
31+
//~| ERROR expected constant integer for repeat count, but attempted to add with overflow
32+
//~| ERROR the trait `core::ops::Add<u8>` is not implemented for the type `i8`
33+
//~| ERROR the trait `core::ops::Add<u8>` is not implemented for the type `i8`
3034

3135
fn main() {
3236
foo(&A_I8_I[..]);

src/test/compile-fail/const-eval-overflow-4b.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ use std::{u8, u16, u32, u64, usize};
2222
const A_I8_T
2323
: [u32; (i8::MAX as i8 + 1u8) as usize]
2424
//~^ ERROR mismatched types
25+
//~| the trait `core::ops::Add<u8>` is not implemented for the type `i8`
26+
//~| the trait `core::ops::Add<u8>` is not implemented for the type `i8`
2527
= [0; (i8::MAX as usize) + 1];
2628

2729
fn main() {

src/test/compile-fail/huge-array-simple.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// error-pattern: too big for the current
1211
#![allow(exceeding_bitshifts)]
1312

1413
fn main() {
15-
let fat : [u8; (1<<61)+(1<<31)] = [0; (1u64<<61) as usize +(1u64<<31) as usize];
14+
let fat : [u8; (1<<61)+(1<<31)] =
15+
//~^ ERROR array length constant evaluation error: attempted left shift with overflow
16+
[0; (1u64<<61) as usize +(1u64<<31) as usize];
17+
//~^ ERROR expected constant integer for repeat count, but attempted left shift with overflow
1618
}

0 commit comments

Comments
 (0)