Skip to content

Commit f080b13

Browse files
committed
tests
1 parent 10737a5 commit f080b13

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

src/test/compile-fail/const-eval-overflow-4b.rs

+11-7
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
#![allow(unused_imports)]
1717

18-
use std::fmt;
1918
use std::{i8, i16, i32, i64, isize};
2019
use std::{u8, u16, u32, u64, usize};
2120

@@ -26,10 +25,15 @@ const A_I8_T
2625
//~| found `u8` [E0250]
2726
= [0; (i8::MAX as usize) + 1];
2827

29-
fn main() {
30-
foo(&A_I8_T[..]);
31-
}
3228

33-
fn foo<T:fmt::Debug>(x: T) {
34-
println!("{:?}", x);
35-
}
29+
const A_CHAR_USIZE
30+
: [u32; 5u8 as char as usize]
31+
= [0; 5];
32+
33+
34+
const A_BAD_CHAR_USIZE
35+
: [u32; 5i8 as char as usize]
36+
//~^ ERROR only `u8` can be cast as `char`, not `i8`
37+
= [0; 5];
38+
39+
fn main() {}

src/test/run-pass/const-err.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//

0 commit comments

Comments
 (0)