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 expression.
6 // This is a variation of another such test, but in this case the
7 // types for the left- and right-hand sides of the addition do not
8 // match (as well as overflow).
10 #![allow(unused_imports)]
13 use std::{i8, i16, i32, i64, isize};
14 use std::{u8, u16, u32, u64, usize};
17 : [u32; (i8::MAX as usize) + 1]
18 = [0; (i8::MAX + 1u8) as usize];
19 //~^ ERROR mismatched types
20 //~| ERROR cannot add `u8` to `i8`
21 //~| ERROR mismatched types
27 fn foo<T:fmt::Debug>(x: T) {