Stabilize .. in tuple (struct) patterns

This commit is contained in:
Vadim Petrochenkov 2016-09-15 00:51:46 +03:00
parent 0ca9967af7
commit 74bb594563
33 changed files with 20 additions and 73 deletions

View File

@ -2479,8 +2479,6 @@ The currently implemented features of the reference compiler are:
* - `abi_vectorcall` - Allows the usage of the vectorcall calling convention
(e.g. `extern "vectorcall" func fn_();`)
* - `dotdot_in_tuple_patterns` - Allows `..` in tuple (struct) patterns.
* - `abi_sysv64` - Allows the usage of the system V AMD64 calling convention
(e.g. `extern "sysv64" func fn_();`)

View File

@ -31,7 +31,7 @@
#![feature(conservative_impl_trait)]
#![feature(const_fn)]
#![feature(core_intrinsics)]
#![feature(dotdot_in_tuple_patterns)]
#![cfg_attr(stage0, feature(dotdot_in_tuple_patterns))]
#![feature(enumset)]
#![feature(libc)]
#![feature(nonzero)]

View File

@ -19,7 +19,7 @@
#![allow(non_camel_case_types)]
#![feature(dotdot_in_tuple_patterns)]
#![cfg_attr(stage0, feature(dotdot_in_tuple_patterns))]
#![feature(quote)]
#![feature(rustc_diagnostic_macros)]
#![feature(rustc_private)]

View File

@ -22,7 +22,7 @@
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
html_root_url = "https://doc.rust-lang.org/nightly/")]
#![feature(dotdot_in_tuple_patterns)]
#![cfg_attr(stage0, feature(dotdot_in_tuple_patterns))]
#![feature(rustc_private)]
#![feature(staged_api)]
#![feature(rustc_diagnostic_macros)]

View File

@ -24,7 +24,7 @@
#![cfg_attr(not(stage0), deny(warnings))]
#![feature(box_syntax)]
#![feature(dotdot_in_tuple_patterns)]
#![cfg_attr(stage0, feature(dotdot_in_tuple_patterns))]
#![feature(libc)]
#![feature(quote)]
#![feature(rustc_diagnostic_macros)]

View File

@ -19,7 +19,7 @@
html_root_url = "https://doc.rust-lang.org/nightly/")]
#![cfg_attr(not(stage0), deny(warnings))]
#![feature(dotdot_in_tuple_patterns)]
#![cfg_attr(stage0, feature(dotdot_in_tuple_patterns))]
#![cfg_attr(stage0, feature(question_mark))]
#![feature(rustc_private)]
#![feature(staged_api)]

View File

@ -31,13 +31,12 @@
#![cfg_attr(test, feature(test))]
#![feature(box_patterns)]
#![feature(box_syntax)]
#![feature(dotdot_in_tuple_patterns)]
#![cfg_attr(stage0, feature(dotdot_in_tuple_patterns))]
#![feature(quote)]
#![feature(rustc_diagnostic_macros)]
#![feature(rustc_private)]
#![feature(slice_patterns)]
#![feature(staged_api)]
#![feature(dotdot_in_tuple_patterns)]
#[macro_use]
extern crate syntax;

View File

@ -20,7 +20,7 @@
#![feature(box_patterns)]
#![feature(conservative_impl_trait)]
#![feature(core_intrinsics)]
#![feature(dotdot_in_tuple_patterns)]
#![cfg_attr(stage0, feature(dotdot_in_tuple_patterns))]
#![feature(proc_macro_internals)]
#![feature(proc_macro_lib)]
#![cfg_attr(stage0, feature(question_mark))]

View File

@ -22,7 +22,7 @@ Rust MIR: a lowered representation of Rust. Also: an experiment!
#![feature(associated_consts)]
#![feature(box_patterns)]
#![feature(dotdot_in_tuple_patterns)]
#![cfg_attr(stage0, feature(dotdot_in_tuple_patterns))]
#![feature(rustc_diagnostic_macros)]
#![feature(rustc_private)]
#![feature(staged_api)]

View File

@ -23,7 +23,7 @@
html_root_url = "https://doc.rust-lang.org/nightly/")]
#![cfg_attr(not(stage0), deny(warnings))]
#![feature(dotdot_in_tuple_patterns)]
#![cfg_attr(stage0, feature(dotdot_in_tuple_patterns))]
#![feature(rustc_diagnostic_macros)]
#![feature(staged_api)]
#![feature(rustc_private)]

View File

@ -17,7 +17,7 @@
html_root_url = "https://doc.rust-lang.org/nightly/")]
#![cfg_attr(not(stage0), deny(warnings))]
#![feature(dotdot_in_tuple_patterns)]
#![cfg_attr(stage0, feature(dotdot_in_tuple_patterns))]
#![feature(rustc_diagnostic_macros)]
#![feature(rustc_private)]
#![feature(staged_api)]

View File

@ -19,7 +19,7 @@
#![feature(associated_consts)]
#![feature(borrow_state)]
#![feature(dotdot_in_tuple_patterns)]
#![cfg_attr(stage0, feature(dotdot_in_tuple_patterns))]
#![feature(rustc_diagnostic_macros)]
#![feature(rustc_private)]
#![feature(staged_api)]

View File

@ -18,7 +18,7 @@
#![cfg_attr(not(stage0), deny(warnings))]
#![feature(custom_attribute)]
#![feature(dotdot_in_tuple_patterns)]
#![cfg_attr(stage0, feature(dotdot_in_tuple_patterns))]
#![allow(unused_attributes)]
#![feature(rustc_private)]
#![feature(staged_api)]

View File

@ -28,7 +28,7 @@
#![feature(cell_extras)]
#![feature(const_fn)]
#![feature(custom_attribute)]
#![feature(dotdot_in_tuple_patterns)]
#![cfg_attr(stage0, feature(dotdot_in_tuple_patterns))]
#![allow(unused_attributes)]
#![feature(libc)]
#![feature(quote)]

View File

@ -77,7 +77,7 @@ This API is completely unstable and subject to change.
#![feature(box_patterns)]
#![feature(box_syntax)]
#![feature(conservative_impl_trait)]
#![feature(dotdot_in_tuple_patterns)]
#![cfg_attr(stage0, feature(dotdot_in_tuple_patterns))]
#![feature(quote)]
#![feature(rustc_diagnostic_macros)]
#![feature(rustc_private)]

View File

@ -20,7 +20,7 @@
#![feature(box_patterns)]
#![feature(box_syntax)]
#![feature(dotdot_in_tuple_patterns)]
#![cfg_attr(stage0, feature(dotdot_in_tuple_patterns))]
#![feature(libc)]
#![feature(rustc_private)]
#![feature(set_stdio)]

View File

@ -249,7 +249,7 @@
#![feature(const_fn)]
#![feature(core_float)]
#![feature(core_intrinsics)]
#![feature(dotdot_in_tuple_patterns)]
#![cfg_attr(stage0, feature(dotdot_in_tuple_patterns))]
#![feature(dropck_parametricity)]
#![feature(float_extras)]
#![feature(float_from_str_radix)]

View File

@ -268,9 +268,6 @@ declare_features! (
// Allows cfg(target_has_atomic = "...").
(active, cfg_target_has_atomic, "1.9.0", Some(32976)),
// Allows `..` in tuple (struct) patterns
(active, dotdot_in_tuple_patterns, "1.10.0", Some(33627)),
// Allows `impl Trait` in function return types.
(active, conservative_impl_trait, "1.12.0", Some(34511)),
@ -353,6 +350,8 @@ declare_features! (
(accepted, deprecated, "1.9.0", Some(29935)),
// `expr?`
(accepted, question_mark, "1.14.0", Some(31436)),
// Allows `..` in tuple (struct) patterns
(accepted, dotdot_in_tuple_patterns, "1.14.0", Some(33627)),
);
// (changing above list without updating src/doc/reference.md makes @cmr sad)
@ -1190,18 +1189,6 @@ impl<'a> Visitor for PostExpansionVisitor<'a> {
pattern.span,
"box pattern syntax is experimental");
}
PatKind::Tuple(_, ddpos)
if ddpos.is_some() => {
gate_feature_post!(&self, dotdot_in_tuple_patterns,
pattern.span,
"`..` in tuple patterns is experimental");
}
PatKind::TupleStruct(_, ref fields, ddpos)
if ddpos.is_some() && !fields.is_empty() => {
gate_feature_post!(&self, dotdot_in_tuple_patterns,
pattern.span,
"`..` in tuple struct patterns is experimental");
}
PatKind::TupleStruct(_, ref fields, ddpos)
if ddpos.is_none() && fields.is_empty() => {
gate_feature_post!(&self, relaxed_adts, pattern.span,

View File

@ -34,7 +34,7 @@
#![cfg_attr(stage0, feature(question_mark))]
#![feature(rustc_diagnostic_macros)]
#![feature(specialization)]
#![feature(dotdot_in_tuple_patterns)]
#![cfg_attr(stage0, feature(dotdot_in_tuple_patterns))]
extern crate core;
extern crate serialize;

View File

@ -19,7 +19,7 @@
html_root_url = "https://doc.rust-lang.org/nightly/")]
#![cfg_attr(not(stage0), deny(warnings))]
#![feature(dotdot_in_tuple_patterns)]
#![cfg_attr(stage0, feature(dotdot_in_tuple_patterns))]
#![feature(proc_macro_lib)]
#![feature(proc_macro_internals)]
#![feature(rustc_private)]

View File

@ -10,7 +10,6 @@
// force-host
#![feature(dotdot_in_tuple_patterns)]
#![feature(plugin_registrar, quote, rustc_private)]
extern crate syntax;

View File

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(dotdot_in_tuple_patterns)]
fn main() {
let x;

View File

@ -1,17 +0,0 @@
// Copyright 2016 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 {
(..) => {} //~ ERROR `..` in tuple patterns is experimental
(pat, ..) => {} //~ ERROR `..` in tuple patterns is experimental
S(pat, ..) => {} //~ ERROR `..` in tuple struct patterns is experimental
}
}

View File

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(dotdot_in_tuple_patterns)]
struct S(u8, u8, u8);
fn main() {

View File

@ -10,7 +10,6 @@
#![ crate_name = "test" ]
#![feature(box_syntax)]
#![feature(dotdot_in_tuple_patterns)]
#![feature(rustc_private)]
extern crate graphviz;

View File

@ -12,7 +12,6 @@
#![feature(plugin_registrar)]
#![feature(box_syntax)]
#![feature(dotdot_in_tuple_patterns)]
#![feature(rustc_private)]
extern crate syntax;

View File

@ -10,7 +10,6 @@
// force-host
#![feature(dotdot_in_tuple_patterns)]
#![feature(plugin_registrar, quote, rustc_private)]
extern crate syntax;

View File

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(dotdot_in_tuple_patterns)]
fn tuple() {
let x = (1, 2, 3);
match x {

View File

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(dotdot_in_tuple_patterns)]
fn tuple() {
let x = (1,);
match x {

View File

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(dotdot_in_tuple_patterns)]
fn tuple() {
let x = (1, 2, 3);
let branch = match x {

View File

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(dotdot_in_tuple_patterns)]
fn tuple() {
let x = (1, 2, 3);
match x {

View File

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(dotdot_in_tuple_patterns)]
fn tuple() {
struct S;
struct Z;

View File

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(dotdot_in_tuple_patterns)]
fn tuple() {
let x = (1, 2, 3, 4, 5);
match x {