]> git.lizzy.rs Git - rust.git/commitdiff
Ungate associated types.
authorHuon Wilson <dbau.pp+github@gmail.com>
Mon, 5 Jan 2015 06:04:32 +0000 (17:04 +1100)
committerHuon Wilson <dbau.pp+github@gmail.com>
Mon, 5 Jan 2015 09:00:10 +0000 (20:00 +1100)
They work pretty well now, and the stdlib is using them everywhere so
they're impossible to avoid anyway.

src/libsyntax/feature_gate.rs

index f8ac34cfe29202a90594f1d00dfe4b057cf45f97..caf3bcd77c49f893a113f10f3dd9899046c0f134 100644 (file)
@@ -67,7 +67,7 @@
     ("import_shadowing", Active),
     ("advanced_slice_patterns", Active),
     ("tuple_indexing", Accepted),
-    ("associated_types", Active),
+    ("associated_types", Accepted),
     ("visible_private_types", Active),
     ("slicing_syntax", Active),
 
@@ -313,18 +313,6 @@ fn visit_item(&mut self, i: &ast::Item) {
                                        many unsafe patterns and may be \
                                        removed in the future");
                 }
-
-                for item in items.iter() {
-                    match *item {
-                        ast::MethodImplItem(_) => {}
-                        ast::TypeImplItem(ref typedef) => {
-                            self.gate_feature("associated_types",
-                                              typedef.span,
-                                              "associated types are \
-                                               experimental")
-                        }
-                    }
-                }
             }
 
             _ => {}
@@ -333,17 +321,6 @@ fn visit_item(&mut self, i: &ast::Item) {
         visit::walk_item(self, i);
     }
 
-    fn visit_trait_item(&mut self, trait_item: &ast::TraitItem) {
-        match *trait_item {
-            ast::RequiredMethod(_) | ast::ProvidedMethod(_) => {}
-            ast::TypeTraitItem(ref ti) => {
-                self.gate_feature("associated_types",
-                                  ti.ty_param.span,
-                                  "associated types are experimental")
-            }
-        }
-    }
-
     fn visit_foreign_item(&mut self, i: &ast::ForeignItem) {
         if attr::contains_name(i.attrs[], "linkage") {
             self.gate_feature("linkage", i.span,