Translate constants from MIR instead of going through trans::expr/consts.
This commit is contained in:
parent
4639128d40
commit
e1eca0a110
13 changed files with 859 additions and 152 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue