2018-09-06 07:41:12 -05:00
|
|
|
// run-pass
|
2018-09-25 16:51:35 -05:00
|
|
|
#![allow(unused_variables)]
|
2018-09-06 07:41:12 -05:00
|
|
|
|
2018-01-16 03:15:41 -06:00
|
|
|
// https://github.com/rust-lang/rust/issues/46114
|
|
|
|
|
|
|
|
#[derive(Eq, PartialEq)]
|
|
|
|
struct A { value: u32 }
|
|
|
|
|
|
|
|
const fn new(value: u32) -> A {
|
|
|
|
A { value }
|
|
|
|
}
|
|
|
|
|
|
|
|
const A_1: A = new(1);
|
|
|
|
const A_2: A = new(2);
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let a_str = match new(42) {
|
|
|
|
A_1 => "A 1",
|
|
|
|
A_2 => "A 2",
|
|
|
|
_ => "Unknown A",
|
|
|
|
};
|
|
|
|
}
|