2019-07-02 21:30:28 +00:00
|
|
|
// build-pass (FIXME(62277): could be check-pass?)
|
2018-01-16 08:24:38 +00:00
|
|
|
|
2017-04-19 12:16:19 +00:00
|
|
|
#[derive(PartialEq, Eq)]
|
2015-12-02 14:50:06 +00:00
|
|
|
enum Cake {
|
|
|
|
BlackForest,
|
|
|
|
Marmor,
|
|
|
|
}
|
|
|
|
use Cake::*;
|
|
|
|
|
2017-04-19 12:16:19 +00:00
|
|
|
struct Pair<A, B>(A, B);
|
|
|
|
|
|
|
|
const BOO: Pair<Cake, Cake> = Pair(Marmor, BlackForest);
|
2016-10-03 18:39:21 +00:00
|
|
|
const FOO: Cake = BOO.1;
|
2015-12-02 14:50:06 +00:00
|
|
|
|
|
|
|
const fn foo() -> Cake {
|
2016-07-19 21:02:56 +00:00
|
|
|
Marmor
|
2015-12-02 14:50:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
const WORKS: Cake = Marmor;
|
|
|
|
|
2016-09-25 23:53:26 +00:00
|
|
|
const GOO: Cake = foo();
|
2015-12-02 14:50:06 +00:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
match BlackForest {
|
2017-12-10 20:29:24 +00:00
|
|
|
FOO => println!("hi"),
|
2017-04-19 12:16:19 +00:00
|
|
|
GOO => println!("meh"),
|
2015-12-02 14:50:06 +00:00
|
|
|
WORKS => println!("möp"),
|
|
|
|
_ => println!("bye"),
|
|
|
|
}
|
|
|
|
}
|