Skip to content

Commit e3e09cc

Browse files
committed
Update tests
1 parent 84e5709 commit e3e09cc

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

src/test/compile-fail/const-eval-overflow2.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,53 +26,61 @@ const VALS_I8: (i8,) =
2626
//~| attempt to subtract with overflow
2727
(
2828
i8::MIN - 1,
29+
//~^ ERROR constant evaluation error
2930
);
3031

3132
const VALS_I16: (i16,) =
3233
//~^ ERROR constant evaluation error
3334
//~| attempt to subtract with overflow
3435
(
3536
i16::MIN - 1,
37+
//~^ ERROR constant evaluation error
3638
);
3739

3840
const VALS_I32: (i32,) =
3941
//~^ ERROR constant evaluation error
4042
//~| attempt to subtract with overflow
4143
(
4244
i32::MIN - 1,
45+
//~^ ERROR constant evaluation error
4346
);
4447

4548
const VALS_I64: (i64,) =
4649
//~^ ERROR constant evaluation error
4750
//~| attempt to subtract with overflow
4851
(
4952
i64::MIN - 1,
53+
//~^ ERROR constant evaluation error
5054
);
5155

5256
const VALS_U8: (u8,) =
5357
//~^ ERROR constant evaluation error
5458
//~| attempt to subtract with overflow
5559
(
5660
u8::MIN - 1,
61+
//~^ ERROR constant evaluation error
5762
);
5863

5964
const VALS_U16: (u16,) = (
6065
//~^ ERROR constant evaluation error
6166
//~| attempt to subtract with overflow
6267
u16::MIN - 1,
68+
//~^ ERROR constant evaluation error
6369
);
6470

6571
const VALS_U32: (u32,) = (
6672
//~^ ERROR constant evaluation error
6773
//~| attempt to subtract with overflow
6874
u32::MIN - 1,
75+
//~^ ERROR constant evaluation error
6976
);
7077

7178
const VALS_U64: (u64,) =
7279
//~^ ERROR constant evaluation error
7380
//~| attempt to subtract with overflow
7481
(
7582
u64::MIN - 1,
83+
//~^ ERROR constant evaluation error
7684
);
7785

7886
fn main() {

src/test/compile-fail/const-eval-overflow2b.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,53 +26,61 @@ const VALS_I8: (i8,) =
2626
//~| attempt to add with overflow
2727
(
2828
i8::MAX + 1,
29+
//~^ ERROR constant evaluation error
2930
);
3031

3132
const VALS_I16: (i16,) =
3233
//~^ ERROR constant evaluation error
3334
//~| attempt to add with overflow
3435
(
3536
i16::MAX + 1,
37+
//~^ ERROR constant evaluation error
3638
);
3739

3840
const VALS_I32: (i32,) =
3941
//~^ ERROR constant evaluation error
4042
//~| attempt to add with overflow
4143
(
4244
i32::MAX + 1,
45+
//~^ ERROR constant evaluation error
4346
);
4447

4548
const VALS_I64: (i64,) =
4649
//~^ ERROR constant evaluation error
4750
//~| attempt to add with overflow
4851
(
4952
i64::MAX + 1,
53+
//~^ ERROR constant evaluation error
5054
);
5155

5256
const VALS_U8: (u8,) =
5357
//~^ ERROR constant evaluation error
5458
//~| attempt to add with overflow
5559
(
5660
u8::MAX + 1,
61+
//~^ ERROR constant evaluation error
5762
);
5863

5964
const VALS_U16: (u16,) = (
6065
//~^ ERROR constant evaluation error
6166
//~| attempt to add with overflow
6267
u16::MAX + 1,
68+
//~^ ERROR constant evaluation error
6369
);
6470

6571
const VALS_U32: (u32,) = (
6672
//~^ ERROR constant evaluation error
6773
//~| attempt to add with overflow
6874
u32::MAX + 1,
75+
//~^ ERROR constant evaluation error
6976
);
7077

7178
const VALS_U64: (u64,) =
7279
//~^ ERROR constant evaluation error
7380
//~| attempt to add with overflow
7481
(
7582
u64::MAX + 1,
83+
//~^ ERROR constant evaluation error
7684
);
7785

7886
fn main() {

src/test/compile-fail/const-eval-overflow2c.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,53 +26,61 @@ const VALS_I8: (i8,) =
2626
//~| attempt to multiply with overflow
2727
(
2828
i8::MIN * 2,
29+
//~^ ERROR constant evaluation error
2930
);
3031

3132
const VALS_I16: (i16,) =
3233
//~^ ERROR constant evaluation error
3334
//~| attempt to multiply with overflow
3435
(
3536
i16::MIN * 2,
37+
//~^ ERROR constant evaluation error
3638
);
3739

3840
const VALS_I32: (i32,) =
3941
//~^ ERROR constant evaluation error
4042
//~| attempt to multiply with overflow
4143
(
4244
i32::MIN * 2,
45+
//~^ ERROR constant evaluation error
4346
);
4447

4548
const VALS_I64: (i64,) =
4649
//~^ ERROR constant evaluation error
4750
//~| attempt to multiply with overflow
4851
(
4952
i64::MIN * 2,
53+
//~^ ERROR constant evaluation error
5054
);
5155

5256
const VALS_U8: (u8,) =
5357
//~^ ERROR constant evaluation error
5458
//~| attempt to multiply with overflow
5559
(
5660
u8::MAX * 2,
61+
//~^ ERROR constant evaluation error
5762
);
5863

5964
const VALS_U16: (u16,) = (
6065
//~^ ERROR constant evaluation error
6166
//~| attempt to multiply with overflow
6267
u16::MAX * 2,
68+
//~^ ERROR constant evaluation error
6369
);
6470

6571
const VALS_U32: (u32,) = (
6672
//~^ ERROR constant evaluation error
6773
//~| attempt to multiply with overflow
6874
u32::MAX * 2,
75+
//~^ ERROR constant evaluation error
6976
);
7077

7178
const VALS_U64: (u64,) =
7279
//~^ ERROR constant evaluation error
7380
//~| attempt to multiply with overflow
7481
(
7582
u64::MAX * 2,
83+
//~^ ERROR constant evaluation error
7684
);
7785

7886
fn main() {

0 commit comments

Comments
 (0)