Skip to content
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

Stabilize .. in tuple (struct) patterns #36843

Merged
merged 1 commit into from
Nov 8, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/doc/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -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_();`)

Expand Down
2 changes: 1 addition & 1 deletion src/librustc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_borrowck/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_const_eval/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_driver/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_incremental/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
3 changes: 1 addition & 2 deletions src/librustc_lint/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_metadata/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))]
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_mir/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_passes/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_privacy/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_resolve/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_save_analysis/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_trans/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_typeck/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
17 changes: 2 additions & 15 deletions src/libsyntax/feature_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)),

Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax_ext/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

// force-host

#![feature(dotdot_in_tuple_patterns)]
#![feature(plugin_registrar, quote, rustc_private)]

extern crate syntax;
Expand Down
2 changes: 0 additions & 2 deletions src/test/compile-fail/pat-tuple-bad-type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
17 changes: 0 additions & 17 deletions src/test/compile-fail/pat-tuple-feature-gate.rs

This file was deleted.

2 changes: 0 additions & 2 deletions src/test/compile-fail/pat-tuple-overfield.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
1 change: 0 additions & 1 deletion src/test/run-make/save-analysis/foo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

#![ crate_name = "test" ]
#![feature(box_syntax)]
#![feature(dotdot_in_tuple_patterns)]
#![feature(rustc_private)]

extern crate graphviz;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

#![feature(plugin_registrar)]
#![feature(box_syntax)]
#![feature(dotdot_in_tuple_patterns)]
#![feature(rustc_private)]

extern crate syntax;
Expand Down
1 change: 0 additions & 1 deletion src/test/run-pass-fulldeps/auxiliary/macro_crate_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

// force-host

#![feature(dotdot_in_tuple_patterns)]
#![feature(plugin_registrar, quote, rustc_private)]

extern crate syntax;
Expand Down
2 changes: 0 additions & 2 deletions src/test/run-pass/pat-tuple-1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 0 additions & 2 deletions src/test/run-pass/pat-tuple-2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 0 additions & 2 deletions src/test/run-pass/pat-tuple-3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 0 additions & 2 deletions src/test/run-pass/pat-tuple-4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 0 additions & 2 deletions src/test/run-pass/pat-tuple-5.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions src/test/run-pass/pat-tuple-6.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down