Skip to content

Incorrect unreachable pattern when matching slice with .. #15178

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
stepancheg opened this issue Jun 25, 2014 · 3 comments
Closed

Incorrect unreachable pattern when matching slice with .. #15178

stepancheg opened this issue Jun 25, 2014 · 3 comments

Comments

@stepancheg
Copy link
Contributor

Code:

fn foo(v: &[int]) {
    match v {
        [_] => {},
        [_, ..] => {},
        _ => {},
    }
}

Wrong error is:

/home/vagrant/tmp2.rs:4:9: 4:16 error: unreachable pattern
/home/vagrant/tmp2.rs:4         [_, ..] => {},
                                ^~~~~~~
error: aborting due to previous error
@alexcrichton
Copy link
Member

cc @jakub-

@ghost
Copy link

ghost commented Jun 25, 2014

Duplicate of #15104. Still on it.

@alexcrichton
Copy link
Member

Thanks! In that case, closing as a duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants