mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 07:44:10 +00:00
17 lines
220 B
Rust
17 lines
220 B
Rust
enum Thing {
|
|
This,
|
|
That,
|
|
}
|
|
|
|
fn non_const() -> Thing {
|
|
Thing::This
|
|
}
|
|
|
|
pub const Q: i32 = match non_const() {
|
|
//~^ ERROR cannot call non-const fn
|
|
Thing::This => 1,
|
|
Thing::That => 0
|
|
};
|
|
|
|
fn main() {}
|