Translate constants from MIR instead of going through trans::expr/consts.

This commit is contained in:
Eduard Burtescu 2016-04-21 16:15:56 +03:00
parent 4639128d40
commit e1eca0a110
13 changed files with 859 additions and 152 deletions

View file

@ -8,8 +8,9 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
static A: &'static [i32] = &[];
static B: i32 = (&A)[1]; //~ ERROR: const index-expr is out of bounds
const A: &'static [i32] = &[];
const B: i32 = (&A)[1];
//~^ ERROR: array index out of bounds
fn main() {
let _ = B;