]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-eval/const-eval-overflow-3.rs
6fd8e9cbc806b17c872bcc12c77623134faa428a
[rust.git] / src / test / ui / consts / const-eval / const-eval-overflow-3.rs
1 // Evaluation of constants in array-elem count goes through different
2 // compiler control-flow paths.
3 //
4 // This test is checking the count in an array expression.
5
6
7
8
9
10
11
12 #![allow(unused_imports)]
13
14 use std::fmt;
15 use std::{i8, i16, i32, i64, isize};
16 use std::{u8, u16, u32, u64, usize};
17
18 const A_I8_I
19     : [u32; (i8::MAX as usize) + 1]
20     = [0; (i8::MAX + 1) as usize];
21 //~^ ERROR evaluation of constant value failed
22
23 fn main() {
24     foo(&A_I8_I[..]);
25 }
26
27 fn foo<T:fmt::Debug>(x: T) {
28     println!("{:?}", x);
29 }