diff --git a/src/librustc/front/feature_gate.rs b/src/librustc/front/feature_gate.rs
index 868b53c2465f2..6bbf18de693fa 100644
--- a/src/librustc/front/feature_gate.rs
+++ b/src/librustc/front/feature_gate.rs
@@ -77,6 +77,14 @@ impl Context {
}
}
+ fn gate_box(&self, span: Span) {
+ self.gate_feature("managed_boxes", span,
+ "The managed box syntax is being replaced by the \
+ `std::gc::Gc` and `std::rc::Rc` types. Equivalent \
+ functionality to managed trait objects will be \
+ implemented but is currently missing.");
+ }
+
fn has_feature(&self, feature: &str) -> bool {
self.features.iter().any(|n| n.as_slice() == feature)
}
@@ -172,17 +180,24 @@ impl Visitor<()> for Context {
experimental and likely to be removed");
},
- ast::ty_box(_) => {
- self.gate_feature("managed_boxes", t.span,
- "The managed box syntax is being replaced by the `std::gc::Gc` \
- and `std::rc::Rc` types. Equivalent functionality to managed \
- trait objects will be implemented but is currently missing.");
- }
+ ast::ty_box(_) => { self.gate_box(t.span); }
_ => {}
}
visit::walk_ty(self, t, ());
}
+
+ fn visit_expr(&mut self, e: @ast::Expr, _: ()) {
+ match e.node {
+ ast::ExprUnary(_, ast::UnBox(..), _) |
+ ast::ExprVstore(_, ast::ExprVstoreBox) |
+ ast::ExprVstore(_, ast::ExprVstoreMutBox) => {
+ self.gate_box(e.span);
+ }
+ _ => {}
+ }
+ visit::walk_expr(self, e, ());
+ }
}
pub fn check_crate(sess: Session, crate: &ast::Crate) {
diff --git a/src/librustc/middle/lint.rs b/src/librustc/middle/lint.rs
index feee3583f717a..5128f90a0a5a3 100644
--- a/src/librustc/middle/lint.rs
+++ b/src/librustc/middle/lint.rs
@@ -770,9 +770,21 @@ fn check_heap_type(cx: &Context, span: Span, ty: ty::t) {
let mut n_uniq = 0;
ty::fold_ty(cx.tcx, ty, |t| {
match ty::get(t).sty {
- ty::ty_box(_) => n_box += 1,
- ty::ty_uniq(_) => n_uniq += 1,
- _ => ()
+ ty::ty_box(_) | ty::ty_estr(ty::vstore_box) |
+ ty::ty_evec(_, ty::vstore_box) |
+ ty::ty_trait(_, _, ty::BoxTraitStore, _, _) => {
+ n_box += 1;
+ }
+ ty::ty_uniq(_) | ty::ty_estr(ty::vstore_uniq) |
+ ty::ty_evec(_, ty::vstore_uniq) |
+ ty::ty_trait(_, _, ty::UniqTraitStore, _, _) => {
+ n_uniq += 1;
+ }
+ ty::ty_closure(ref c) if c.sigil == ast::OwnedSigil => {
+ n_uniq += 1;
+ }
+
+ _ => ()
};
t
});
diff --git a/src/test/compile-fail/auto-ref-slice-plus-ref.rs b/src/test/compile-fail/auto-ref-slice-plus-ref.rs
index 9f73955f29ebb..311becc63eff1 100644
--- a/src/test/compile-fail/auto-ref-slice-plus-ref.rs
+++ b/src/test/compile-fail/auto-ref-slice-plus-ref.rs
@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(managed_boxes)];
+
fn main() {
// Testing that method lookup does not automatically borrow
diff --git a/src/test/compile-fail/borrowck-loan-rcvr-overloaded-op.rs b/src/test/compile-fail/borrowck-loan-rcvr-overloaded-op.rs
index b205c5be2179c..bfc1884ac5a7f 100644
--- a/src/test/compile-fail/borrowck-loan-rcvr-overloaded-op.rs
+++ b/src/test/compile-fail/borrowck-loan-rcvr-overloaded-op.rs
@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(managed_boxes)];
+
struct Point {
x: int,
y: int,
diff --git a/src/test/compile-fail/borrowck-loan-rcvr.rs b/src/test/compile-fail/borrowck-loan-rcvr.rs
index c2ed3378bf97c..5c6f7082ed03b 100644
--- a/src/test/compile-fail/borrowck-loan-rcvr.rs
+++ b/src/test/compile-fail/borrowck-loan-rcvr.rs
@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(managed_boxes)];
+
struct point { x: int, y: int }
trait methods {
diff --git a/src/test/compile-fail/borrowck-mut-boxed-vec.rs b/src/test/compile-fail/borrowck-mut-boxed-vec.rs
index 1a8fa50c76eee..84c2db8bd576b 100644
--- a/src/test/compile-fail/borrowck-mut-boxed-vec.rs
+++ b/src/test/compile-fail/borrowck-mut-boxed-vec.rs
@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(managed_boxes)];
+
fn main() {
let v = @mut [ 1, 2, 3 ];
for _x in v.iter() {
diff --git a/src/test/compile-fail/issue-3763.rs b/src/test/compile-fail/issue-3763.rs
index 7097615b87e74..a4d184e346b0e 100644
--- a/src/test/compile-fail/issue-3763.rs
+++ b/src/test/compile-fail/issue-3763.rs
@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(managed_boxes)];
+
mod my_mod {
pub struct MyStruct {
priv priv_field: int
diff --git a/src/test/compile-fail/lint-heap-memory.rs b/src/test/compile-fail/lint-heap-memory.rs
index b550c227898f2..c02da1beeb732 100644
--- a/src/test/compile-fail/lint-heap-memory.rs
+++ b/src/test/compile-fail/lint-heap-memory.rs
@@ -19,6 +19,20 @@ struct Foo {
struct Bar { x: ~int } //~ ERROR type uses owned
fn main() {
- let _x : Bar = Bar {x : ~10};
+ let _x : Bar = Bar {x : ~10}; //~ ERROR type uses owned
+
+ @2; //~ ERROR type uses managed
+ @[1]; //~ ERROR type uses managed
+ //~^ ERROR type uses managed
+ fn f(_: @Clone) {} //~ ERROR type uses managed
+ @""; //~ ERROR type uses managed
+ //~^ ERROR type uses managed
+
+ ~2; //~ ERROR type uses owned
+ ~[1]; //~ ERROR type uses owned
+ //~^ ERROR type uses owned
+ fn g(_: ~Clone) {} //~ ERROR type uses owned
+ ~""; //~ ERROR type uses owned
//~^ ERROR type uses owned
+ proc() {}; //~ ERROR type uses owned
}
diff --git a/src/test/compile-fail/moves-based-on-type-exprs.rs b/src/test/compile-fail/moves-based-on-type-exprs.rs
index fec0f89adbaf8..34e506ed015c8 100644
--- a/src/test/compile-fail/moves-based-on-type-exprs.rs
+++ b/src/test/compile-fail/moves-based-on-type-exprs.rs
@@ -1,6 +1,8 @@
// Tests that references to move-by-default values trigger moves when
// they occur as part of various kinds of expressions.
+#[feature(managed_boxes)];
+
struct Foo { f: A }
fn guard(_s: ~str) -> bool {fail!()}
fn touch(_a: &A) {}
diff --git a/src/test/compile-fail/non-exhaustive-match.rs b/src/test/compile-fail/non-exhaustive-match.rs
index e728b9c2fd76e..c8183d70f87d1 100644
--- a/src/test/compile-fail/non-exhaustive-match.rs
+++ b/src/test/compile-fail/non-exhaustive-match.rs
@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(managed_boxes)];
+
enum t { a, b, }
fn main() {
diff --git a/src/test/compile-fail/occurs-check.rs b/src/test/compile-fail/occurs-check.rs
index d6a5a747e8de7..f08272f58acd7 100644
--- a/src/test/compile-fail/occurs-check.rs
+++ b/src/test/compile-fail/occurs-check.rs
@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(managed_boxes)];
+
fn main() {
let f; //~ ERROR cyclic type of infinite size
f = @f;
diff --git a/src/test/compile-fail/static-region-bound.rs b/src/test/compile-fail/static-region-bound.rs
index ada3aebb2f420..35f5ac1bb18a8 100644
--- a/src/test/compile-fail/static-region-bound.rs
+++ b/src/test/compile-fail/static-region-bound.rs
@@ -1,3 +1,5 @@
+#[feature(managed_boxes)];
+
fn f(_: T) {}
fn main() {
diff --git a/src/test/compile-fail/unique-unique-kind.rs b/src/test/compile-fail/unique-unique-kind.rs
index d51df4979e352..b9965b1822936 100644
--- a/src/test/compile-fail/unique-unique-kind.rs
+++ b/src/test/compile-fail/unique-unique-kind.rs
@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(managed_boxes)];
+
fn f(_i: T) {
}
diff --git a/src/test/debug-info/borrowed-struct.rs b/src/test/debug-info/borrowed-struct.rs
index 42f7ffd8777bc..85b6fd03a273f 100644
--- a/src/test/debug-info/borrowed-struct.rs
+++ b/src/test/debug-info/borrowed-struct.rs
@@ -43,6 +43,7 @@
// debugger:print *unique_val_interior_ref_2
// check:$10 = 26.5
+#[feature(managed_boxes)];
#[allow(unused_variable)];
struct SomeStruct {
diff --git a/src/test/debug-info/box.rs b/src/test/debug-info/box.rs
index 60ff5f789a8fb..b760126207bba 100644
--- a/src/test/debug-info/box.rs
+++ b/src/test/debug-info/box.rs
@@ -22,6 +22,7 @@
// debugger:print d->val
// check:$4 = false
+#[feature(managed_boxes)];
#[allow(unused_variable)];
fn main() {
diff --git a/src/test/debug-info/boxed-struct.rs b/src/test/debug-info/boxed-struct.rs
index 47c9bd469d409..5a7eacb3eea52 100644
--- a/src/test/debug-info/boxed-struct.rs
+++ b/src/test/debug-info/boxed-struct.rs
@@ -25,6 +25,7 @@
// debugger:print managed_dtor->val
// check:$4 = {x = 33, y = 333, z = 3333, w = 33333}
+#[feature(managed_boxes)];
#[allow(unused_variable)];
struct StructWithSomePadding {
diff --git a/src/test/debug-info/destructured-local.rs b/src/test/debug-info/destructured-local.rs
index cd17906623ef1..16498952f28e3 100644
--- a/src/test/debug-info/destructured-local.rs
+++ b/src/test/debug-info/destructured-local.rs
@@ -123,6 +123,7 @@
// debugger:print *nn
// check:$43 = 56
+#[feature(managed_boxes)];
#[allow(unused_variable)];
struct Struct {
diff --git a/src/test/debug-info/generic-method-on-generic-struct.rs b/src/test/debug-info/generic-method-on-generic-struct.rs
index 8eafef5ab106a..80f2031b92ebc 100644
--- a/src/test/debug-info/generic-method-on-generic-struct.rs
+++ b/src/test/debug-info/generic-method-on-generic-struct.rs
@@ -94,6 +94,8 @@
// check:$21 = {-16, 16.5}
// debugger:continue
+#[feature(managed_boxes)];
+
struct Struct {
x: T
}
diff --git a/src/test/debug-info/managed-enum.rs b/src/test/debug-info/managed-enum.rs
index 7be4287257093..8c94f2ea970bc 100644
--- a/src/test/debug-info/managed-enum.rs
+++ b/src/test/debug-info/managed-enum.rs
@@ -23,7 +23,7 @@
// check:$3 = {-9747455}
#[allow(unused_variable)];
-#[feature(struct_variant)];
+#[feature(struct_variant, managed_boxes)];
// The first element is to ensure proper alignment, irrespective of the machines word size. Since
// the size of the discriminant value is machine dependent, this has be taken into account when
diff --git a/src/test/debug-info/method-on-enum.rs b/src/test/debug-info/method-on-enum.rs
index c7e60289b22e4..622786fcb53c2 100644
--- a/src/test/debug-info/method-on-enum.rs
+++ b/src/test/debug-info/method-on-enum.rs
@@ -94,6 +94,7 @@
// check:$21 = -16
// debugger:continue
+#[feature(managed_boxes)];
#[feature(struct_variant)];
enum Enum {
diff --git a/src/test/debug-info/method-on-generic-struct.rs b/src/test/debug-info/method-on-generic-struct.rs
index e4524aaffd2cc..99ed66cc03b52 100644
--- a/src/test/debug-info/method-on-generic-struct.rs
+++ b/src/test/debug-info/method-on-generic-struct.rs
@@ -94,6 +94,8 @@
// check:$21 = -16
// debugger:continue
+#[feature(managed_boxes)];
+
struct Struct {
x: T
}
diff --git a/src/test/debug-info/method-on-struct.rs b/src/test/debug-info/method-on-struct.rs
index 654f1db559b87..9c2afadaef386 100644
--- a/src/test/debug-info/method-on-struct.rs
+++ b/src/test/debug-info/method-on-struct.rs
@@ -94,6 +94,8 @@
// check:$21 = -16
// debugger:continue
+#[feature(managed_boxes)];
+
struct Struct {
x: int
}
diff --git a/src/test/debug-info/method-on-trait.rs b/src/test/debug-info/method-on-trait.rs
index e6e024323c3da..6b67dcc18a9aa 100644
--- a/src/test/debug-info/method-on-trait.rs
+++ b/src/test/debug-info/method-on-trait.rs
@@ -94,6 +94,8 @@
// check:$21 = -16
// debugger:continue
+#[feature(managed_boxes)];
+
struct Struct {
x: int
}
diff --git a/src/test/debug-info/method-on-tuple-struct.rs b/src/test/debug-info/method-on-tuple-struct.rs
index 0d19cf21514b5..46177664a11eb 100644
--- a/src/test/debug-info/method-on-tuple-struct.rs
+++ b/src/test/debug-info/method-on-tuple-struct.rs
@@ -94,6 +94,8 @@
// check:$21 = -16
// debugger:continue
+#[feature(managed_boxes)];
+
struct TupleStruct(int, f64);
impl TupleStruct {
diff --git a/src/test/debug-info/self-in-default-method.rs b/src/test/debug-info/self-in-default-method.rs
index d1b275c9ec0dd..f9726c5329b1c 100644
--- a/src/test/debug-info/self-in-default-method.rs
+++ b/src/test/debug-info/self-in-default-method.rs
@@ -94,6 +94,8 @@
// check:$21 = -16
// debugger:continue
+#[feature(managed_boxes)];
+
struct Struct {
x: int
}
diff --git a/src/test/debug-info/self-in-generic-default-method.rs b/src/test/debug-info/self-in-generic-default-method.rs
index f09953487bc6f..1b1e0ccf65248 100644
--- a/src/test/debug-info/self-in-generic-default-method.rs
+++ b/src/test/debug-info/self-in-generic-default-method.rs
@@ -94,6 +94,8 @@
// check:$21 = {-16, 16.5}
// debugger:continue
+#[feature(managed_boxes)];
+
struct Struct {
x: int
}
diff --git a/src/test/debug-info/var-captured-in-nested-closure.rs b/src/test/debug-info/var-captured-in-nested-closure.rs
index c10697df89953..1032356689f30 100644
--- a/src/test/debug-info/var-captured-in-nested-closure.rs
+++ b/src/test/debug-info/var-captured-in-nested-closure.rs
@@ -49,6 +49,7 @@
// check:$14 = 8
// debugger:continue
+#[feature(managed_boxes)];
#[allow(unused_variable)];
struct Struct {
diff --git a/src/test/debug-info/var-captured-in-stack-closure.rs b/src/test/debug-info/var-captured-in-stack-closure.rs
index cbbb8cbbb122b..53287a8511bce 100644
--- a/src/test/debug-info/var-captured-in-stack-closure.rs
+++ b/src/test/debug-info/var-captured-in-stack-closure.rs
@@ -28,6 +28,7 @@
// debugger:print managed->val
// check:$6 = 7
+#[feature(managed_boxes)];
#[allow(unused_variable)];
struct Struct {
diff --git a/src/test/pretty/block-disambig.rs b/src/test/pretty/block-disambig.rs
index 5cc8f6e6edc58..8d6eaef8b340f 100644
--- a/src/test/pretty/block-disambig.rs
+++ b/src/test/pretty/block-disambig.rs
@@ -12,6 +12,8 @@
// previously ambiguous (e.g. 'if true { } *val;' gets parsed as a
// binop)
+#[feature(managed_boxes)];
+
fn test1() { let val = @0; { } *val; }
fn test2() -> int { let val = @0; { } *val }
diff --git a/src/test/run-fail/borrowck-wg-autoderef-and-autoborrowvec-combined-fail-issue-6272.rs b/src/test/run-fail/borrowck-wg-autoderef-and-autoborrowvec-combined-fail-issue-6272.rs
index 6e15f6edddc89..c9bc061995d3e 100644
--- a/src/test/run-fail/borrowck-wg-autoderef-and-autoborrowvec-combined-fail-issue-6272.rs
+++ b/src/test/run-fail/borrowck-wg-autoderef-and-autoborrowvec-combined-fail-issue-6272.rs
@@ -8,6 +8,8 @@
//
// for a detailed explanation of what is going on here.
+#[feature(managed_boxes)];
+
fn main() {
let a = @mut [3i];
let b = @mut [a];
diff --git a/src/test/run-fail/borrowck-wg-fail-2.rs b/src/test/run-fail/borrowck-wg-fail-2.rs
index 24b928920c2b8..284882ff6f5d5 100644
--- a/src/test/run-fail/borrowck-wg-fail-2.rs
+++ b/src/test/run-fail/borrowck-wg-fail-2.rs
@@ -3,6 +3,8 @@
// Test that write guards trigger when there is a write to a field
// of a frozen structure.
+#[feature(managed_boxes)];
+
struct S {
x: int
}
diff --git a/src/test/run-fail/borrowck-wg-fail-3.rs b/src/test/run-fail/borrowck-wg-fail-3.rs
index 8a72d2680d92f..2643ed261f944 100644
--- a/src/test/run-fail/borrowck-wg-fail-3.rs
+++ b/src/test/run-fail/borrowck-wg-fail-3.rs
@@ -3,6 +3,8 @@
// Test that write guards trigger when there is a write to a directly
// frozen @mut box.
+#[feature(managed_boxes)];
+
fn main() {
let x = @mut 3;
let _y: &mut int = x;
diff --git a/src/test/run-fail/borrowck-wg-one-mut-one-imm-slice-method.rs b/src/test/run-fail/borrowck-wg-one-mut-one-imm-slice-method.rs
index 668fa54315e56..d33e39e09a852 100644
--- a/src/test/run-fail/borrowck-wg-one-mut-one-imm-slice-method.rs
+++ b/src/test/run-fail/borrowck-wg-one-mut-one-imm-slice-method.rs
@@ -3,6 +3,8 @@
// Test that write guards trigger when there is a coercion to
// a slice on the receiver of a method.
+#[feature(managed_boxes)];
+
trait MyMutSlice {
fn my_mut_slice(self) -> Self;
}
diff --git a/src/test/run-fail/borrowck-wg-one-mut-one-imm-slices.rs b/src/test/run-fail/borrowck-wg-one-mut-one-imm-slices.rs
index ef410fb533923..63287981bdcc8 100644
--- a/src/test/run-fail/borrowck-wg-one-mut-one-imm-slices.rs
+++ b/src/test/run-fail/borrowck-wg-one-mut-one-imm-slices.rs
@@ -2,6 +2,8 @@
// Test that write guards trigger when arguments are coerced to slices.
+#[feature(managed_boxes)];
+
fn add(x:&mut [int], y:&[int])
{
x[0] = x[0] + y[0];
diff --git a/src/test/run-fail/borrowck-wg-one-mut-one-imm.rs b/src/test/run-fail/borrowck-wg-one-mut-one-imm.rs
index 9e52c3ae928dc..0820b94e181c4 100644
--- a/src/test/run-fail/borrowck-wg-one-mut-one-imm.rs
+++ b/src/test/run-fail/borrowck-wg-one-mut-one-imm.rs
@@ -3,6 +3,8 @@
// Test that write guards trigger when we are indexing into
// an @mut vector.
+#[feature(managed_boxes)];
+
fn add(x:&mut int, y:&int)
{
*x = *x + *y;
diff --git a/src/test/run-fail/borrowck-wg-two-array-indices.rs b/src/test/run-fail/borrowck-wg-two-array-indices.rs
index a41e529d0628b..5ee9cd37e87b8 100644
--- a/src/test/run-fail/borrowck-wg-two-array-indices.rs
+++ b/src/test/run-fail/borrowck-wg-two-array-indices.rs
@@ -3,6 +3,8 @@
// Test that arguments trigger when there are *two mutable* borrows
// of indices.
+#[feature(managed_boxes)];
+
fn add(x:&mut int, y:&mut int)
{
*x = *x + *y;
diff --git a/src/test/run-fail/unwind-assert.rs b/src/test/run-fail/unwind-assert.rs
index 36954d2bad67e..4ed79147947e2 100644
--- a/src/test/run-fail/unwind-assert.rs
+++ b/src/test/run-fail/unwind-assert.rs
@@ -10,6 +10,8 @@
// error-pattern:fail
+#[feature(managed_boxes)];
+
fn main() {
let _a = @0;
assert!(false);
diff --git a/src/test/run-fail/unwind-box-res.rs b/src/test/run-fail/unwind-box-res.rs
index f0d6e1c188268..6740331d2f048 100644
--- a/src/test/run-fail/unwind-box-res.rs
+++ b/src/test/run-fail/unwind-box-res.rs
@@ -10,6 +10,8 @@
// error-pattern:fail
+#[feature(managed_boxes)];
+
use std::cast;
fn failfn() {
diff --git a/src/test/run-fail/unwind-box-str.rs b/src/test/run-fail/unwind-box-str.rs
index a30f2bfab0a41..410b86d57146b 100644
--- a/src/test/run-fail/unwind-box-str.rs
+++ b/src/test/run-fail/unwind-box-str.rs
@@ -10,6 +10,8 @@
// error-pattern:fail
+#[feature(managed_boxes)];
+
fn failfn() {
fail!();
}
diff --git a/src/test/run-fail/unwind-box-unique-unique.rs b/src/test/run-fail/unwind-box-unique-unique.rs
index fc8e3a793d2c7..c4747c6089ef5 100644
--- a/src/test/run-fail/unwind-box-unique-unique.rs
+++ b/src/test/run-fail/unwind-box-unique-unique.rs
@@ -10,6 +10,8 @@
// error-pattern:fail
+#[feature(managed_boxes)];
+
fn failfn() {
fail!();
}
diff --git a/src/test/run-fail/unwind-box-unique.rs b/src/test/run-fail/unwind-box-unique.rs
index 15925dc475e8f..e99c050d16a20 100644
--- a/src/test/run-fail/unwind-box-unique.rs
+++ b/src/test/run-fail/unwind-box-unique.rs
@@ -10,6 +10,8 @@
// error-pattern:fail
+#[feature(managed_boxes)];
+
fn failfn() {
fail!();
}
diff --git a/src/test/run-fail/unwind-box-vec.rs b/src/test/run-fail/unwind-box-vec.rs
index 18b4cebaa339c..4a5cd27011605 100644
--- a/src/test/run-fail/unwind-box-vec.rs
+++ b/src/test/run-fail/unwind-box-vec.rs
@@ -10,6 +10,8 @@
// error-pattern:fail
+#[feature(managed_boxes)];
+
fn failfn() {
fail!();
}
diff --git a/src/test/run-fail/unwind-box.rs b/src/test/run-fail/unwind-box.rs
index 21308945253b5..6cbccfb29f910 100644
--- a/src/test/run-fail/unwind-box.rs
+++ b/src/test/run-fail/unwind-box.rs
@@ -10,6 +10,8 @@
// error-pattern:fail
+#[feature(managed_boxes)];
+
fn failfn() {
fail!();
}
diff --git a/src/test/run-fail/unwind-fail.rs b/src/test/run-fail/unwind-fail.rs
index 4d4bc0d53eba2..4acd1ba6b1b90 100644
--- a/src/test/run-fail/unwind-fail.rs
+++ b/src/test/run-fail/unwind-fail.rs
@@ -10,6 +10,8 @@
// error-pattern:fail
+#[feature(managed_boxes)];
+
fn main() {
@0;
fail!();
diff --git a/src/test/run-fail/unwind-iter.rs b/src/test/run-fail/unwind-iter.rs
index 1f5e455564e34..9b5b9be341526 100644
--- a/src/test/run-fail/unwind-iter.rs
+++ b/src/test/run-fail/unwind-iter.rs
@@ -10,6 +10,7 @@
// error-pattern:fail
+#[feature(managed_boxes)];
#[allow(unreachable_code)];
#[allow(unused_variable)];
diff --git a/src/test/run-fail/unwind-iter2.rs b/src/test/run-fail/unwind-iter2.rs
index d0726d2544ca6..0ac8b2b26e968 100644
--- a/src/test/run-fail/unwind-iter2.rs
+++ b/src/test/run-fail/unwind-iter2.rs
@@ -10,6 +10,8 @@
// error-pattern:fail
+#[feature(managed_boxes)];
+
fn x(it: |int|) {
let _a = @0;
it(1);
diff --git a/src/test/run-fail/unwind-match.rs b/src/test/run-fail/unwind-match.rs
index a9761017c73f5..44cc3145c4407 100644
--- a/src/test/run-fail/unwind-match.rs
+++ b/src/test/run-fail/unwind-match.rs
@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(managed_boxes)];
+
// Issue #945
// error-pattern:non-exhaustive match failure
fn test_box() {
diff --git a/src/test/run-fail/unwind-misc-1.rs b/src/test/run-fail/unwind-misc-1.rs
index d215927c7d03f..b87303467cee5 100644
--- a/src/test/run-fail/unwind-misc-1.rs
+++ b/src/test/run-fail/unwind-misc-1.rs
@@ -11,6 +11,8 @@
// exec-env:RUST_NEWRT=1
// error-pattern:fail
+#[feature(managed_boxes)];
+
fn main() {
let _count = @mut 0u;
let mut map = std::hashmap::HashMap::new();
diff --git a/src/test/run-fail/unwind-nested.rs b/src/test/run-fail/unwind-nested.rs
index f8a63be2e9ad0..3805f955d73ad 100644
--- a/src/test/run-fail/unwind-nested.rs
+++ b/src/test/run-fail/unwind-nested.rs
@@ -10,6 +10,8 @@
// error-pattern:fail
+#[feature(managed_boxes)];
+
fn main() {
let _a = @0;
{
diff --git a/src/test/run-fail/unwind-partial-box.rs b/src/test/run-fail/unwind-partial-box.rs
index 88f71a5ed7cea..7239cad762d90 100644
--- a/src/test/run-fail/unwind-partial-box.rs
+++ b/src/test/run-fail/unwind-partial-box.rs
@@ -10,6 +10,8 @@
// error-pattern:fail
+#[feature(managed_boxes)];
+
fn f() -> ~[int] { fail!(); }
// Voodoo. In unwind-alt we had to do this to trigger the bug. Might
diff --git a/src/test/run-fail/unwind-partial-unique.rs b/src/test/run-fail/unwind-partial-unique.rs
index e9bbbd46c03ff..6339e72fe469c 100644
--- a/src/test/run-fail/unwind-partial-unique.rs
+++ b/src/test/run-fail/unwind-partial-unique.rs
@@ -10,6 +10,8 @@
// error-pattern:fail
+#[feature(managed_boxes)];
+
fn f() -> ~[int] { fail!(); }
// Voodoo. In unwind-alt we had to do this to trigger the bug. Might
diff --git a/src/test/run-fail/unwind-partial-vec.rs b/src/test/run-fail/unwind-partial-vec.rs
index 3d6d26937dbac..9560e0275d490 100644
--- a/src/test/run-fail/unwind-partial-vec.rs
+++ b/src/test/run-fail/unwind-partial-vec.rs
@@ -10,6 +10,8 @@
// error-pattern:fail
+#[feature(managed_boxes)];
+
fn f() -> ~[int] { fail!(); }
// Voodoo. In unwind-alt we had to do this to trigger the bug. Might
diff --git a/src/test/run-fail/unwind-stacked.rs b/src/test/run-fail/unwind-stacked.rs
index 8249807af74ad..bd875ada18ece 100644
--- a/src/test/run-fail/unwind-stacked.rs
+++ b/src/test/run-fail/unwind-stacked.rs
@@ -10,6 +10,8 @@
// error-pattern:fail
+#[feature(managed_boxes)];
+
fn f() {
let _a = @0;
fail!();
diff --git a/src/test/run-fail/unwind-uninitialized.rs b/src/test/run-fail/unwind-uninitialized.rs
index d5a06ffb9036b..265a616f3dea4 100644
--- a/src/test/run-fail/unwind-uninitialized.rs
+++ b/src/test/run-fail/unwind-uninitialized.rs
@@ -10,6 +10,8 @@
// error-pattern:fail
+#[feature(managed_boxes)];
+
fn f() {
fail!();
}
diff --git a/src/test/run-pass/auto-ref-slice-plus-ref.rs b/src/test/run-pass/auto-ref-slice-plus-ref.rs
index 2b9870b84a5e8..667d9b738c23f 100644
--- a/src/test/run-pass/auto-ref-slice-plus-ref.rs
+++ b/src/test/run-pass/auto-ref-slice-plus-ref.rs
@@ -11,6 +11,8 @@
// Testing that method lookup automatically both borrows vectors to slices
// and also references them to create the &self pointer
+#[feature(managed_boxes)];
+
trait MyIter {
fn test_imm(&self);
}
diff --git a/src/test/run-pass/autoderef-method-twice.rs b/src/test/run-pass/autoderef-method-twice.rs
index f93f0605269a4..79784688d497d 100644
--- a/src/test/run-pass/autoderef-method-twice.rs
+++ b/src/test/run-pass/autoderef-method-twice.rs
@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(managed_boxes)];
+
trait double {
fn double(@self) -> uint;
}
diff --git a/src/test/run-pass/autoderef-method.rs b/src/test/run-pass/autoderef-method.rs
index eb173e3d5f8ec..1a04abe3196e0 100644
--- a/src/test/run-pass/autoderef-method.rs
+++ b/src/test/run-pass/autoderef-method.rs
@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(managed_boxes)];
+
trait double {
fn double(@self) -> uint;
}
diff --git a/src/test/run-pass/borrowck-borrow-from-at-vec.rs b/src/test/run-pass/borrowck-borrow-from-at-vec.rs
index 8ec1b590fdfca..5ae959ef16999 100644
--- a/src/test/run-pass/borrowck-borrow-from-at-vec.rs
+++ b/src/test/run-pass/borrowck-borrow-from-at-vec.rs
@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(managed_boxes)];
+
fn sum_slice(x: &[int]) -> int {
let mut sum = 0;
for i in x.iter() { sum += *i; }
diff --git a/src/test/run-pass/borrowck-preserve-box-in-discr.rs b/src/test/run-pass/borrowck-preserve-box-in-discr.rs
index c155563d8d06e..0f37288d51db6 100644
--- a/src/test/run-pass/borrowck-preserve-box-in-discr.rs
+++ b/src/test/run-pass/borrowck-preserve-box-in-discr.rs
@@ -10,6 +10,8 @@
// exec-env:RUST_POISON_ON_FREE=1
+#[feature(managed_boxes)];
+
use std::ptr;
struct F { f: ~int }
diff --git a/src/test/run-pass/borrowck-preserve-box-in-field.rs b/src/test/run-pass/borrowck-preserve-box-in-field.rs
index 1caf5c033763f..77fe7d14dcba6 100644
--- a/src/test/run-pass/borrowck-preserve-box-in-field.rs
+++ b/src/test/run-pass/borrowck-preserve-box-in-field.rs
@@ -12,6 +12,8 @@
// exec-env:RUST_POISON_ON_FREE=1
+#[feature(managed_boxes)];
+
use std::ptr;
fn borrow(x: &int, f: |x: &int|) {
diff --git a/src/test/run-pass/borrowck-preserve-box-in-pat.rs b/src/test/run-pass/borrowck-preserve-box-in-pat.rs
index fd5f8c0868c6c..2fd2c689a3c50 100644
--- a/src/test/run-pass/borrowck-preserve-box-in-pat.rs
+++ b/src/test/run-pass/borrowck-preserve-box-in-pat.rs
@@ -10,6 +10,8 @@
// exec-env:RUST_POISON_ON_FREE=1
+#[feature(managed_boxes)];
+
use std::ptr;
struct F { f: ~int }
diff --git a/src/test/run-pass/borrowck-preserve-box-in-uniq.rs b/src/test/run-pass/borrowck-preserve-box-in-uniq.rs
index 2b8180be00e2e..d950fce109b13 100644
--- a/src/test/run-pass/borrowck-preserve-box-in-uniq.rs
+++ b/src/test/run-pass/borrowck-preserve-box-in-uniq.rs
@@ -12,6 +12,8 @@
// exec-env:RUST_POISON_ON_FREE=1
+#[feature(managed_boxes)];
+
use std::ptr;
fn borrow(x: &int, f: |x: &int|) {
diff --git a/src/test/run-pass/borrowck-preserve-box.rs b/src/test/run-pass/borrowck-preserve-box.rs
index 2acaf54f05f43..5c0f238e0bcc4 100644
--- a/src/test/run-pass/borrowck-preserve-box.rs
+++ b/src/test/run-pass/borrowck-preserve-box.rs
@@ -12,6 +12,8 @@
// exec-env:RUST_POISON_ON_FREE=1
+#[feature(managed_boxes)];
+
use std::ptr;
fn borrow(x: &int, f: |x: &int|) {
diff --git a/src/test/run-pass/borrowck-preserve-cond-box.rs b/src/test/run-pass/borrowck-preserve-cond-box.rs
index 055a924cf04e3..57365e98f97e9 100644
--- a/src/test/run-pass/borrowck-preserve-cond-box.rs
+++ b/src/test/run-pass/borrowck-preserve-cond-box.rs
@@ -10,6 +10,8 @@
// exec-env:RUST_POISON_ON_FREE=1
+#[feature(managed_boxes)];
+
fn testfn(cond: bool) {
let mut x = @3;
let mut y = @4;
diff --git a/src/test/run-pass/borrowck-preserve-expl-deref.rs b/src/test/run-pass/borrowck-preserve-expl-deref.rs
index 4400b03e31324..e820ec67d6f69 100644
--- a/src/test/run-pass/borrowck-preserve-expl-deref.rs
+++ b/src/test/run-pass/borrowck-preserve-expl-deref.rs
@@ -12,6 +12,8 @@
// exec-env:RUST_POISON_ON_FREE=1
+#[feature(managed_boxes)];
+
use std::ptr;
fn borrow(x: &int, f: |x: &int|) {
diff --git a/src/test/run-pass/borrowck-univariant-enum.rs b/src/test/run-pass/borrowck-univariant-enum.rs
index bb8710aad489b..aaa08ea49b32a 100644
--- a/src/test/run-pass/borrowck-univariant-enum.rs
+++ b/src/test/run-pass/borrowck-univariant-enum.rs
@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(managed_boxes)];
+
enum newtype {
newtype(int)
}
diff --git a/src/test/run-pass/borrowck-wg-autoderef-and-autoborrowvec-combined-issue-6272.rs b/src/test/run-pass/borrowck-wg-autoderef-and-autoborrowvec-combined-issue-6272.rs
index 4ee0d42ae1315..27d337a28bf89 100644
--- a/src/test/run-pass/borrowck-wg-autoderef-and-autoborrowvec-combined-issue-6272.rs
+++ b/src/test/run-pass/borrowck-wg-autoderef-and-autoborrowvec-combined-issue-6272.rs
@@ -26,6 +26,7 @@
//
// run-fail/borrowck-wg-autoderef-and-autoborrowvec-combined-fail-issue-6272.rs
+#[feature(managed_boxes)];
pub fn main() {
let a = @mut 3i;
diff --git a/src/test/run-pass/borrowck-wg-simple.rs b/src/test/run-pass/borrowck-wg-simple.rs
index c07962e10aa93..f561dba242327 100644
--- a/src/test/run-pass/borrowck-wg-simple.rs
+++ b/src/test/run-pass/borrowck-wg-simple.rs
@@ -1,3 +1,5 @@
+#[feature(managed_boxes)];
+
fn f(x: &int) {
println(x.to_str());
}
diff --git a/src/test/run-pass/borrowck-wg-two-imm-borrows.rs b/src/test/run-pass/borrowck-wg-two-imm-borrows.rs
index 3d2988202f3bb..efd0572c8c633 100644
--- a/src/test/run-pass/borrowck-wg-two-imm-borrows.rs
+++ b/src/test/run-pass/borrowck-wg-two-imm-borrows.rs
@@ -1,5 +1,7 @@
// Test that we can borrow the same @mut box twice, so long as both are imm.
+#[feature(managed_boxes)];
+
fn add(x:&int, y:&int)
{
*x + *y;
diff --git a/src/test/run-pass/borrowed-ptr-pattern-infallible.rs b/src/test/run-pass/borrowed-ptr-pattern-infallible.rs
index 4e9ba6d3158e0..77484b8da4a7d 100644
--- a/src/test/run-pass/borrowed-ptr-pattern-infallible.rs
+++ b/src/test/run-pass/borrowed-ptr-pattern-infallible.rs
@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(managed_boxes)];
+
pub fn main() {
let (&x, &y, &z) = (&3, &'a', &@"No pets!");
assert_eq!(x, 3);
diff --git a/src/test/run-pass/cci_borrow.rs b/src/test/run-pass/cci_borrow.rs
index fe57d6b3fecf8..6b8f4089fdfcf 100644
--- a/src/test/run-pass/cci_borrow.rs
+++ b/src/test/run-pass/cci_borrow.rs
@@ -11,6 +11,8 @@
// xfail-fast - check-fast doesn't understand aux-build
// aux-build:cci_borrow_lib.rs
+#[feature(managed_boxes)];
+
extern mod cci_borrow_lib;
use cci_borrow_lib::foo;
diff --git a/src/test/run-pass/deref-lval.rs b/src/test/run-pass/deref-lval.rs
index e7a307c4a22a6..997e2f03abd92 100644
--- a/src/test/run-pass/deref-lval.rs
+++ b/src/test/run-pass/deref-lval.rs
@@ -8,6 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
+#[feature(managed_boxes)];
pub fn main() { let x = @mut 5; *x = 1000; info!("{:?}", *x); }
diff --git a/src/test/run-pass/deriving-encodable-decodable.rs b/src/test/run-pass/deriving-encodable-decodable.rs
index 5f3cebed66777..e9620d4dea420 100644
--- a/src/test/run-pass/deriving-encodable-decodable.rs
+++ b/src/test/run-pass/deriving-encodable-decodable.rs
@@ -13,7 +13,7 @@
// xfail-fast
-#[feature(struct_variant)];
+#[feature(struct_variant, managed_boxes)];
extern mod extra;
diff --git a/src/test/run-pass/expr-block-box.rs b/src/test/run-pass/expr-block-box.rs
index af1fab2b59585..6d6a2a60af0e1 100644
--- a/src/test/run-pass/expr-block-box.rs
+++ b/src/test/run-pass/expr-block-box.rs
@@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-
+#[feature(managed_boxes)];
pub fn main() { let x = { @100 }; assert!((*x == 100)); }
diff --git a/src/test/run-pass/expr-block-ref.rs b/src/test/run-pass/expr-block-ref.rs
index c77cad8858e00..8ed2a9a6b3fc8 100644
--- a/src/test/run-pass/expr-block-ref.rs
+++ b/src/test/run-pass/expr-block-ref.rs
@@ -8,5 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(managed_boxes)];
+
// Regression test for issue #388
pub fn main() { let _x = { { @10 } }; }
diff --git a/src/test/run-pass/expr-elseif-ref2.rs b/src/test/run-pass/expr-elseif-ref2.rs
index 96acaf43e3413..3149ed49f7ea7 100644
--- a/src/test/run-pass/expr-elseif-ref2.rs
+++ b/src/test/run-pass/expr-elseif-ref2.rs
@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(managed_boxes)];
+
// Regression test for issue #388
pub fn main() {
let _x = if false {
diff --git a/src/test/run-pass/expr-if-box.rs b/src/test/run-pass/expr-if-box.rs
index d31723f9c6c26..b83c7b8852c9f 100644
--- a/src/test/run-pass/expr-if-box.rs
+++ b/src/test/run-pass/expr-if-box.rs
@@ -8,9 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-
-
+#[feature(managed_boxes)];
// Tests for if as expressions returning boxed types
fn test_box() {
diff --git a/src/test/run-pass/expr-match-box.rs b/src/test/run-pass/expr-match-box.rs
index 5e6abc3e786f2..8557f409b75c2 100644
--- a/src/test/run-pass/expr-match-box.rs
+++ b/src/test/run-pass/expr-match-box.rs
@@ -8,9 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
-
-
+#[feature(managed_boxes)];
// Tests for match as expressions resulting in boxed types
fn test_box() {
diff --git a/src/test/run-pass/hashmap-memory.rs b/src/test/run-pass/hashmap-memory.rs
index e16cfecb694bc..163a1253ef0a5 100644
--- a/src/test/run-pass/hashmap-memory.rs
+++ b/src/test/run-pass/hashmap-memory.rs
@@ -10,6 +10,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(managed_boxes)];
+
/**
A somewhat reduced test case to expose some Valgrind issues.
diff --git a/src/test/run-pass/intrinsic-move-val.rs b/src/test/run-pass/intrinsic-move-val.rs
index f328c48447810..1d2b0197f08e1 100644
--- a/src/test/run-pass/intrinsic-move-val.rs
+++ b/src/test/run-pass/intrinsic-move-val.rs
@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(managed_boxes)];
+
mod rusti {
extern "rust-intrinsic" {
pub fn move_val_init(dst: &mut T, src: T);
diff --git a/src/test/run-pass/issue-2708.rs b/src/test/run-pass/issue-2708.rs
index 1fce8e5ce4996..e4d7483c5cf81 100644
--- a/src/test/run-pass/issue-2708.rs
+++ b/src/test/run-pass/issue-2708.rs
@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(managed_boxes)];
+
struct Font {
fontbuf: uint,
cairo_font: uint,
diff --git a/src/test/run-pass/issue-3012-2.rs b/src/test/run-pass/issue-3012-2.rs
index c57257502e40a..9d379e8bfe7d7 100644
--- a/src/test/run-pass/issue-3012-2.rs
+++ b/src/test/run-pass/issue-3012-2.rs
@@ -10,6 +10,9 @@
// xfail-fast
// aux-build:issue-3012-1.rs
+
+#[feature(managed_boxes)];
+
extern mod socketlib;
use socketlib::socket;
diff --git a/src/test/run-pass/issue-3860.rs b/src/test/run-pass/issue-3860.rs
index ee9516e552eff..8a30cc9674860 100644
--- a/src/test/run-pass/issue-3860.rs
+++ b/src/test/run-pass/issue-3860.rs
@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(managed_boxes)];
+
struct Foo { x: int }
impl Foo {
diff --git a/src/test/run-pass/issue-4092.rs b/src/test/run-pass/issue-4092.rs
index 919c1f7ad184d..62174a70d07fe 100644
--- a/src/test/run-pass/issue-4092.rs
+++ b/src/test/run-pass/issue-4092.rs
@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(managed_boxes)];
+
use std::hashmap::HashMap;
pub fn main() {
diff --git a/src/test/run-pass/issue-5517.rs b/src/test/run-pass/issue-5517.rs
index d63d8b13b4366..a5c318a20f47d 100644
--- a/src/test/run-pass/issue-5517.rs
+++ b/src/test/run-pass/issue-5517.rs
@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(managed_boxes)];
+
pub fn main() {
let box1 = @mut 42;
let _x = *(&mut *box1) == 42 || *(&mut *box1) == 31337;
diff --git a/src/test/run-pass/issue-5926.rs b/src/test/run-pass/issue-5926.rs
index dbaa5460fd090..ffb7a0a5bb30e 100644
--- a/src/test/run-pass/issue-5926.rs
+++ b/src/test/run-pass/issue-5926.rs
@@ -8,6 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(managed_boxes)];
#[allow(unused_mut)];
pub fn main() {
diff --git a/src/test/run-pass/issue-6117.rs b/src/test/run-pass/issue-6117.rs
index 73e9391f01683..6b68e3c9ed717 100644
--- a/src/test/run-pass/issue-6117.rs
+++ b/src/test/run-pass/issue-6117.rs
@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(managed_boxes)];
+
pub fn main() {
match Left(@17) {
Right(()) => {}
diff --git a/src/test/run-pass/issue-8898.rs b/src/test/run-pass/issue-8898.rs
index 07731020d3485..ecb8e3ca0ed5d 100644
--- a/src/test/run-pass/issue-8898.rs
+++ b/src/test/run-pass/issue-8898.rs
@@ -8,6 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(managed_boxes)];
fn assert_repr_eq(obj : T, expected : ~str) {
diff --git a/src/test/run-pass/issue-9382.rs b/src/test/run-pass/issue-9382.rs
index d2bf6e29f8732..a5f87e6c5365d 100644
--- a/src/test/run-pass/issue-9382.rs
+++ b/src/test/run-pass/issue-9382.rs
@@ -8,6 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(managed_boxes)];
#[allow(unnecessary_allocation)];
// Tests for a previous bug that occured due to an interaction
diff --git a/src/test/run-pass/lambda-infer-unresolved.rs b/src/test/run-pass/lambda-infer-unresolved.rs
index b6ee2d10fb33f..a499c14802596 100644
--- a/src/test/run-pass/lambda-infer-unresolved.rs
+++ b/src/test/run-pass/lambda-infer-unresolved.rs
@@ -11,6 +11,7 @@
// This should typecheck even though the type of e is not fully
// resolved when we finish typechecking the ||.
+#[feature(managed_boxes)];
struct Refs { refs: ~[int], n: int }
diff --git a/src/test/run-pass/let-destruct.rs b/src/test/run-pass/let-destruct.rs
index aab19b31397b6..a1453a3845579 100644
--- a/src/test/run-pass/let-destruct.rs
+++ b/src/test/run-pass/let-destruct.rs
@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(managed_boxes)];
+
struct xx(int);
struct X { x: xx, y: int }
diff --git a/src/test/run-pass/move-2.rs b/src/test/run-pass/move-2.rs
index fb5f3e11ab705..14d4ea3ff35fc 100644
--- a/src/test/run-pass/move-2.rs
+++ b/src/test/run-pass/move-2.rs
@@ -8,6 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(managed_boxes)];
struct X { x: int, y: int, z: int }
diff --git a/src/test/run-pass/nested-exhaustive-match.rs b/src/test/run-pass/nested-exhaustive-match.rs
index fa4bec0271f0d..aa25d13e0cd55 100644
--- a/src/test/run-pass/nested-exhaustive-match.rs
+++ b/src/test/run-pass/nested-exhaustive-match.rs
@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(managed_boxes)];
+
struct Foo { foo: bool, bar: Option, baz: int }
pub fn main() {
diff --git a/src/test/run-pass/rcvr-borrowed-to-region.rs b/src/test/run-pass/rcvr-borrowed-to-region.rs
index 7d07cab433f61..d6d015d478588 100644
--- a/src/test/run-pass/rcvr-borrowed-to-region.rs
+++ b/src/test/run-pass/rcvr-borrowed-to-region.rs
@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(managed_boxes)];
+
trait get {
fn get(self) -> int;
}
diff --git a/src/test/run-pass/regions-appearance-constraint.rs b/src/test/run-pass/regions-appearance-constraint.rs
index 2297277fdc067..3b0a457559ccf 100644
--- a/src/test/run-pass/regions-appearance-constraint.rs
+++ b/src/test/run-pass/regions-appearance-constraint.rs
@@ -10,6 +10,8 @@
/* Tests conditional rooting of the box y */
+#[feature(managed_boxes)];
+
fn testfn(cond: bool) {
let mut x = @3;
let mut y = @4;
diff --git a/src/test/run-pass/regions-borrow-at.rs b/src/test/run-pass/regions-borrow-at.rs
index b4ec9914f2637..5b1b1dd8ec3b4 100644
--- a/src/test/run-pass/regions-borrow-at.rs
+++ b/src/test/run-pass/regions-borrow-at.rs
@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(managed_boxes)];
+
fn foo(x: &uint) -> uint {
*x
}
diff --git a/src/test/run-pass/regions-borrow-evec-at.rs b/src/test/run-pass/regions-borrow-evec-at.rs
index 45e5b1ad9c94a..3c0fcba2064fb 100644
--- a/src/test/run-pass/regions-borrow-evec-at.rs
+++ b/src/test/run-pass/regions-borrow-evec-at.rs
@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(managed_boxes)];
+
fn foo(x: &[uint]) -> uint {
x[0]
}
diff --git a/src/test/run-pass/regions-escape-into-other-fn.rs b/src/test/run-pass/regions-escape-into-other-fn.rs
index 986071ec53599..8ccda6824bdfd 100644
--- a/src/test/run-pass/regions-escape-into-other-fn.rs
+++ b/src/test/run-pass/regions-escape-into-other-fn.rs
@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(managed_boxes)];
+
fn foo<'r>(x: &'r uint) -> &'r uint { x }
fn bar(x: &uint) -> uint { *x }
diff --git a/src/test/run-pass/regions-infer-borrow-scope-within-loop-ok.rs b/src/test/run-pass/regions-infer-borrow-scope-within-loop-ok.rs
index db4a51bbf2221..1f21ca9ef1b2d 100644
--- a/src/test/run-pass/regions-infer-borrow-scope-within-loop-ok.rs
+++ b/src/test/run-pass/regions-infer-borrow-scope-within-loop-ok.rs
@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(managed_boxes)];
+
fn borrow<'r, T>(x: &'r T) -> &'r T {x}
pub fn main() {
diff --git a/src/test/run-pass/regions-infer-borrow-scope.rs b/src/test/run-pass/regions-infer-borrow-scope.rs
index 6bd3fa5a73bcb..7db4ce8caf249 100644
--- a/src/test/run-pass/regions-infer-borrow-scope.rs
+++ b/src/test/run-pass/regions-infer-borrow-scope.rs
@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(managed_boxes)];
+
struct Point {x: int, y: int}
fn x_coord<'r>(p: &'r Point) -> &'r int {
diff --git a/src/test/run-pass/repeated-vector-syntax.rs b/src/test/run-pass/repeated-vector-syntax.rs
index 465c9b7090e65..03497de0d554f 100644
--- a/src/test/run-pass/repeated-vector-syntax.rs
+++ b/src/test/run-pass/repeated-vector-syntax.rs
@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(managed_boxes)];
+
#[deriving(Clone)]
struct Foo {
a: ~str,
diff --git a/src/test/run-pass/struct-field-assignability.rs b/src/test/run-pass/struct-field-assignability.rs
index 86656b011dd4d..da00e1595dee4 100644
--- a/src/test/run-pass/struct-field-assignability.rs
+++ b/src/test/run-pass/struct-field-assignability.rs
@@ -1,3 +1,5 @@
+#[feature(managed_boxes)];
+
struct Foo<'a> {
x: &'a int
}
diff --git a/src/test/run-pass/type-param-constraints.rs b/src/test/run-pass/type-param-constraints.rs
index a1cb0063322dc..e721a9a96dba7 100644
--- a/src/test/run-pass/type-param-constraints.rs
+++ b/src/test/run-pass/type-param-constraints.rs
@@ -10,6 +10,8 @@
// xfail-fast
+#[feature(managed_boxes)];
+
fn p_foo(_pinned: T) { }
fn s_foo(_shared: T) { }
fn u_foo(_unique: T) { }
diff --git a/src/test/run-pass/unique-assign-generic.rs b/src/test/run-pass/unique-assign-generic.rs
index eb2638f256881..8fb2b9b40f4fb 100644
--- a/src/test/run-pass/unique-assign-generic.rs
+++ b/src/test/run-pass/unique-assign-generic.rs
@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(managed_boxes)];
+
fn f(t: T) -> T {
let t1 = t;
t1
diff --git a/src/test/run-pass/unique-copy-box.rs b/src/test/run-pass/unique-copy-box.rs
index d84ebe0ba766b..48a49996aeebb 100644
--- a/src/test/run-pass/unique-copy-box.rs
+++ b/src/test/run-pass/unique-copy-box.rs
@@ -8,6 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(managed_boxes)];
#[allow(unused_variable)];
use std::managed;
diff --git a/src/test/run-pass/unwind-box.rs b/src/test/run-pass/unwind-box.rs
index 2b3e44a65290f..173919608de01 100644
--- a/src/test/run-pass/unwind-box.rs
+++ b/src/test/run-pass/unwind-box.rs
@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(managed_boxes)];
+
extern mod extra;
use std::task;
diff --git a/src/test/run-pass/vec-matching-autoslice.rs b/src/test/run-pass/vec-matching-autoslice.rs
index acd1d63a6edff..cd9d9603ffb1e 100644
--- a/src/test/run-pass/vec-matching-autoslice.rs
+++ b/src/test/run-pass/vec-matching-autoslice.rs
@@ -1,3 +1,5 @@
+#[feature(managed_boxes)];
+
pub fn main() {
let x = @[1, 2, 3];
match x {
diff --git a/src/test/run-pass/vec-to_str.rs b/src/test/run-pass/vec-to_str.rs
index a24ef38b28341..16a895f723162 100644
--- a/src/test/run-pass/vec-to_str.rs
+++ b/src/test/run-pass/vec-to_str.rs
@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[feature(managed_boxes)];
+
pub fn main() {
assert_eq!((~[0, 1]).to_str(), ~"[0, 1]");
assert_eq!((&[1, 2]).to_str(), ~"[1, 2]");