Skip to content

Remove feature gates for if let, while let, and tuple indexing #19472

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

Merged
merged 1 commit into from
Dec 5, 2014
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
19 changes: 3 additions & 16 deletions src/libsyntax/feature_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[
("unboxed_closures", Active),
("import_shadowing", Active),
("advanced_slice_patterns", Active),
("tuple_indexing", Active),
("tuple_indexing", Accepted),
("associated_types", Active),
("visible_private_types", Active),
("slicing_syntax", Active),

("if_let", Active),
("while_let", Active),
("if_let", Accepted),
("while_let", Accepted),

// if you change this list without updating src/doc/reference.md, cmr will be sad

Expand Down Expand Up @@ -309,24 +309,11 @@ impl<'a, 'v> Visitor<'v> for Context<'a> {
"unboxed closures are a work-in-progress \
feature with known bugs");
}
ast::ExprTupField(..) => {
self.gate_feature("tuple_indexing",
e.span,
"tuple indexing is experimental");
}
ast::ExprIfLet(..) => {
self.gate_feature("if_let", e.span,
"`if let` syntax is experimental");
}
ast::ExprSlice(..) => {
self.gate_feature("slicing_syntax",
e.span,
"slicing syntax is experimental");
}
ast::ExprWhileLet(..) => {
self.gate_feature("while_let", e.span,
"`while let` syntax is experimental");
}
_ => {}
}
visit::walk_expr(self, e);
Expand Down
2 changes: 0 additions & 2 deletions src/test/compile-fail/borrow-tuple-fields.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(tuple_indexing)]

struct Foo(Box<int>, int);

struct Bar(int, int);
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/if-let.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![feature(macro_rules,if_let)]
#![feature(macro_rules)]

fn macros() {
macro_rules! foo{
Expand Down
2 changes: 0 additions & 2 deletions src/test/compile-fail/issue-18566.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(tuple_indexing)]

struct MyPtr<'a>(&'a mut uint);
impl<'a> Deref<uint> for MyPtr<'a> {
fn deref<'b>(&'b self) -> &'b uint { self.0 }
Expand Down
2 changes: 0 additions & 2 deletions src/test/compile-fail/issue-19244-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(tuple_indexing)]

const TUP: (uint,) = (42,);

fn main() {
Expand Down
1 change: 0 additions & 1 deletion src/test/compile-fail/lint-unnecessary-parens.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
// except according to those terms.

#![deny(unused_parens)]
#![feature(if_let,while_let)]

#[deriving(Eq, PartialEq)]
struct X { y: bool }
Expand Down
2 changes: 0 additions & 2 deletions src/test/compile-fail/move-fragments-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(tuple_indexing)]

// Test that we correctly compute the move fragments for a fn.
//
// Note that the code below is not actually incorrect; the
Expand Down
2 changes: 0 additions & 2 deletions src/test/compile-fail/move-out-of-tuple-field.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(tuple_indexing)]

struct Foo(Box<int>);

fn main() {
Expand Down
2 changes: 0 additions & 2 deletions src/test/compile-fail/tuple-index-not-tuple.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(tuple_indexing)]

struct Point { x: int, y: int }
struct Empty;

Expand Down
2 changes: 0 additions & 2 deletions src/test/compile-fail/tuple-index-out-of-bounds.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(tuple_indexing)]

struct Point(int, int);

fn main() {
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/while-let.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![feature(macro_rules,while_let)]
#![feature(macro_rules)]

fn macros() {
macro_rules! foo{
Expand Down