1 // Evaluation of constants in array-elem count goes through different
2 // compiler control-flow paths.
4 // This test is checking the count in an array type.
6 #![allow(unused_imports)]
8 use std::{i8, i16, i32, i64, isize};
9 use std::{u8, u16, u32, u64, usize};
12 : [u32; (i8::MAX as i8 + 1u8) as usize]
13 //~^ ERROR mismatched types
14 //~| expected `i8`, found `u8`
15 //~| ERROR cannot add `u8` to `i8`
16 = [0; (i8::MAX as usize) + 1];
20 : [u32; 5u8 as char as usize]
24 const A_BAD_CHAR_USIZE
25 : [u32; 5i8 as char as usize]
26 //~^ ERROR only `u8` can be cast as `char`, not `i8`