rustc_const_eval: always demand typeck_tables for evaluating constants.

This commit is contained in:
Eduard-Mihai Burtescu
2017-02-15 15:00:20 +02:00
parent c832e6f327
commit e7a48821c0
60 changed files with 706 additions and 1222 deletions

View File

@@ -20,8 +20,9 @@ use std::{u8, u16, u32, u64, usize};
const A_I8_T
: [u32; (i8::MAX as i8 + 1u8) as usize]
//~^ ERROR constant evaluation error [E0080]
//~^ ERROR mismatched types
//~| expected i8, found u8
//~| ERROR the trait bound `i8: std::ops::Add<u8>` is not satisfied
= [0; (i8::MAX as usize) + 1];
@@ -32,8 +33,7 @@ const A_CHAR_USIZE
const A_BAD_CHAR_USIZE
: [u32; 5i8 as char as usize]
//~^ ERROR constant evaluation error
//~| only `u8` can be cast as `char`, not `i8`
//~^ ERROR only `u8` can be cast as `char`, not `i8`
= [0; 5];
fn main() {}