]> git.lizzy.rs Git - rust.git/commit
Allow non-literal static range pattern for match arms
authorJeong YunWon <jeong@youknowone.org>
Sun, 5 May 2013 01:57:14 +0000 (10:57 +0900)
committerJeong YunWon <jeong@youknowone.org>
Sun, 5 May 2013 02:05:06 +0000 (11:05 +0900)
commitcb918e1a831782d6072a0b93dd57614cb9c2d961
tree0d3a0ef0ddaaa451b3c61a66bcd2ebfa6de9845d
parentd74ac9ea03eb8faab72ce48b89dd47a14f45982a
Allow non-literal static range pattern for match arms

Fix unintended error problem of:

static s: int = 1;
static e: int = 42;

fn main() {
    match 7 {
        s..e => (),
         ^~                 error: expected `=>` but found `..`
        _ => (),
    }
}
src/libsyntax/parse/parser.rs
src/test/run-pass/match-range-static.rs [new file with mode: 0644]