Skip to content

Commit ae0905a

Browse files
committed
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
2 parents fd2c012 + 38c620e commit ae0905a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/librustc/front/feature_gate.rs

+10
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[
3535
("struct_variant", Active),
3636
("once_fns", Active),
3737
("asm", Active),
38+
("managed_boxes", Active),
3839

3940
// These are used to test this portion of the compiler, they don't actually
4041
// mean anything
@@ -137,6 +138,15 @@ impl Visitor<()> for Context {
137138
experimental and likely to be removed");
138139

139140
},
141+
// NOTE: enable after snapshot
142+
ast::ty_box(_) if false => {
143+
self.gate_feature("managed_boxes", t.span, "The managed box syntax may be replaced \
144+
by a library type, and a garbage \
145+
collector is not yet implemented. \
146+
Consider using the `std::rc` module \
147+
as it performs much better as a \
148+
reference counting implementation.");
149+
}
140150
_ => {}
141151
}
142152

0 commit comments

Comments
 (0)