Report errors in statics during collecting instead of translating

This commit is contained in:
Oliver Schneider 2018-01-27 17:15:40 +01:00 committed by Oliver Schneider
parent df6b40e342
commit 5b247b9bbe
No known key found for this signature in database
GPG key ID: A69F8D225B3AD7D9
6 changed files with 116 additions and 69 deletions

View file

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
static FOO: i32 = [][0]; //~ ERROR E0080
static FOO: i32 = [][0];
//~^ ERROR E0080
//~| ERROR E0080
fn main() {}

View file

@ -20,15 +20,23 @@ error[E0016]: blocks in constant functions are limited to items and tail express
| ^
error[E0015]: calls in constant functions are limited to constant functions, struct and enum constructors
--> $DIR/const-fn-error.rs:17:14
--> $DIR/const-fn-error.rs:18:14
|
<<<<<<< HEAD
LL | for i in 0..x { //~ ERROR calls in constant functions
=======
18 | for i in 0..x {
>>>>>>> Report errors in statics during collecting instead of translating
| ^^^^
error[E0019]: constant function contains unimplemented expression type
--> $DIR/const-fn-error.rs:17:14
--> $DIR/const-fn-error.rs:18:14
|
<<<<<<< HEAD
LL | for i in 0..x { //~ ERROR calls in constant functions
=======
18 | for i in 0..x {
>>>>>>> Report errors in statics during collecting instead of translating
| ^^^^
error[E0080]: constant evaluation error