2014-01-29 10:04:14 -06:00
|
|
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
// file at the top-level directory of this distribution and at
|
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
2015-03-29 18:23:15 -05:00
|
|
|
// Note: This test is checking that we forbid a coding pattern that
|
|
|
|
// Issue #5873 explicitly wants to allow.
|
|
|
|
|
2014-01-29 10:04:14 -06:00
|
|
|
enum State { ST_NULL, ST_WHITESPACE }
|
|
|
|
|
|
|
|
fn main() {
|
2015-01-08 05:02:42 -06:00
|
|
|
[State::ST_NULL; (State::ST_WHITESPACE as usize)];
|
2016-07-19 16:02:56 -05:00
|
|
|
//~^ ERROR constant evaluation error
|
|
|
|
//~| unimplemented constant expression: enum variants
|
2014-01-29 10:04:14 -06:00
|
|
|
}
|