about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-10-22 11:51:23 -0700
committerbors <bors@rust-lang.org>2013-10-22 11:51:23 -0700
commitae0905ab67a2dd3def61e266bba9f8f223586af6 (patch)
tree2ac88ed15bd6e69ec9c437768e31434501211b0b /src
parentfd2c0128a7dd3cb19eda253acd01cd7905d1c7dc (diff)
parent38c620e75829b2eb09417479aa8c1e2dd69c8d7e (diff)
downloadrust-ae0905ab67a2dd3def61e266bba9f8f223586af6.tar.gz
rust-ae0905ab67a2dd3def61e266bba9f8f223586af6.zip
auto merge of #9923 : thestinger/rust/managed_boxes, r=brson
I'll flip this on after doing a snapshot. This syntax may or may not
stay around, and managed boxes are currently not very useful. They have
the same overall performance characteristics as `std::rc::Rc`, but are
significantly slower, allocate larger boxes and hold onto the memory
beyond when it is needed due to lacking move semantics.

There are currently two useful aspects of the type:

* the dereference sugar, which we should implement for `Rc`
* the annihilator freeing cycles at the end of the task
Diffstat (limited to 'src')
-rw-r--r--src/librustc/front/feature_gate.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/librustc/front/feature_gate.rs b/src/librustc/front/feature_gate.rs
index 0f8307b87e5..000dea12b07 100644
--- a/src/librustc/front/feature_gate.rs
+++ b/src/librustc/front/feature_gate.rs
@@ -35,6 +35,7 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[
     ("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 @@ impl Visitor<()> for Context {
                                    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.");
+            }
             _ => {}
         }