Support parentheses in patterns under feature gate

Improve recovery for trailing comma after `..`
This commit is contained in:
Vadim Petrochenkov 2018-02-24 15:27:06 +03:00
parent 0ff9872b22
commit c9aff92e6d
12 changed files with 166 additions and 107 deletions

View file

@ -0,0 +1,15 @@
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
fn main() {
match 0 {
(pat) => {} //~ ERROR parentheses in patterns are unstable
}
}

View file

@ -0,0 +1,11 @@
error[E0658]: parentheses in patterns are unstable
--> $DIR/feature-gate-pattern_parentheses.rs:13:9
|
LL | (pat) => {} //~ ERROR parentheses in patterns are unstable
| ^^^^^
|
= help: add #![feature(pattern_parentheses)] to the crate attributes to enable
error: aborting due to previous error
If you want more information on this error, try using "rustc --explain E0658"