Created
July 12, 2015 09:59
-
-
Save anonymous/d0ff1de8b6fc15ef1bb6 to your computer and use it in GitHub Desktop.
Shared via Rust Playground
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![feature(const_fn)] | |
#[derive(PartialEq, Eq)] | |
struct Foo { f: usize, g: usize } | |
const fn ZERO(x: usize) -> Foo { Foo { f: x, g: x } } | |
fn main() { | |
let f = Foo { f: 0, g: 1 }; | |
match f { | |
ZERO(22) => println!("hi"), | |
_ => println!("1"), | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just for reference, this errors like this on the current (2018-01-25) nightly: