]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/front/feature_gate.rs
add feature gate for managed boxes
[rust.git] / src / librustc / front / feature_gate.rs
index 0f8307b87e5c0c5f9de012df4cee30b2daebf9fa..000dea12b0736e5af23221a604e6cd98b1a544a4 100644 (file)
@@ -35,6 +35,7 @@
     ("struct_variant", Active),
     ("once_fns", Active),
     ("asm", Active),
+    ("managed_boxes", Active),
 
     // These are used to test this portion of the compiler, they don't actually
     // mean anything
@@ -137,6 +138,15 @@ fn visit_ty(&mut self, t: &ast::Ty, _: ()) {
                                    experimental and likely to be removed");
 
             },
+            // NOTE: enable after snapshot
+            ast::ty_box(_) if false => {
+                self.gate_feature("managed_boxes", t.span, "The managed box syntax may be replaced \
+                                                            by a library type, and a garbage \
+                                                            collector is not yet implemented. \
+                                                            Consider using the `std::rc` module \
+                                                            as it performs much better as a \
+                                                            reference counting implementation.");
+            }
             _ => {}
         }