]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-eval/const-eval-overflow-3.rs
Merge commit '8d14c94b5c0a66241b4244f1c60ac5859cec1d97' into clippyup
[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
16 const A_I8_I
17     : [u32; (i8::MAX as usize) + 1]
18     = [0; (i8::MAX + 1) as usize];
19 //~^ ERROR evaluation of constant value failed
20
21 fn main() {
22     foo(&A_I8_I[..]);
23 }
24
25 fn foo<T:fmt::Debug>(x: T) {
26     println!("{:?}", x);
27 }