diff --git a/src/librustc/front/feature_gate.rs b/src/librustc/front/feature_gate.rs
index 868b53c2465f..6bbf18de693f 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 feee3583f717..5128f90a0a5a 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 9f73955f29eb..311becc63eff 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 b205c5be2179..bfc1884ac5a7 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 c2ed3378bf97..5c6f7082ed03 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 1a8fa50c76ee..84c2db8bd576 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 7097615b87e7..a4d184e346b0 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 b550c227898f..c02da1beeb73 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 fec0f89adbaf..34e506ed015c 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 e728b9c2fd76..c8183d70f87d 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 d6a5a747e8de..f08272f58acd 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 ada3aebb2f42..35f5ac1bb18a 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 d51df4979e35..b9965b182293 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 91ca11aeeed0..0bb8b247e597 100644
--- a/src/test/debug-info/borrowed-struct.rs
+++ b/src/test/debug-info/borrowed-struct.rs
@@ -45,6 +45,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 7ab360277575..304d150d57ef 100644
--- a/src/test/debug-info/box.rs
+++ b/src/test/debug-info/box.rs
@@ -24,6 +24,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 87986b7a866b..ff67d35a9cd2 100644
--- a/src/test/debug-info/boxed-struct.rs
+++ b/src/test/debug-info/boxed-struct.rs
@@ -27,6 +27,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 36c8dacbc137..5bb5eca30e26 100644
--- a/src/test/debug-info/destructured-local.rs
+++ b/src/test/debug-info/destructured-local.rs
@@ -125,6 +125,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 8eafef5ab106..80f2031b92eb 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 02a9cf1237f8..5ab39e00eb34 100644
--- a/src/test/debug-info/managed-enum.rs
+++ b/src/test/debug-info/managed-enum.rs
@@ -25,7 +25,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 c7e60289b22e..622786fcb53c 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 e4524aaffd2c..99ed66cc03b5 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 654f1db559b8..9c2afadaef38 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 e6e024323c3d..6b67dcc18a9a 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 0d19cf21514b..46177664a11e 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 d1b275c9ec0d..f9726c5329b1 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 f09953487bc6..1b1e0ccf6524 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 c10697df8995..1032356689f3 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 cbbb8cbbb122..53287a8511bc 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 5cc8f6e6edc5..8d6eaef8b340 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 6e15f6edddc8..c9bc061995d3 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 24b928920c2b..284882ff6f5d 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 8a72d2680d92..2643ed261f94 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 668fa54315e5..d33e39e09a85 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 ef410fb53392..63287981bdcc 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 9e52c3ae928d..0820b94e181c 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 a41e529d0628..5ee9cd37e87b 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 36954d2bad67..4ed79147947e 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 f0d6e1c18826..6740331d2f04 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 a30f2bfab0a4..410b86d57146 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 fc8e3a793d2c..c4747c6089ef 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 15925dc475e8..e99c050d16a2 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 18b4cebaa339..4a5cd2701160 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 21308945253b..6cbccfb29f91 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 4d4bc0d53eba..4acd1ba6b1b9 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 1f5e455564e3..9b5b9be34152 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 d0726d2544ca..0ac8b2b26e96 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 a9761017c73f..44cc3145c440 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 d215927c7d03..b87303467cee 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 f8a63be2e9ad..3805f955d73a 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 88f71a5ed7ce..7239cad762d9 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 e9bbbd46c03f..6339e72fe469 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 3d6d26937dba..9560e0275d49 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 8249807af74a..bd875ada18ec 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 d5a06ffb9036..265a616f3dea 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 2b9870b84a5e..667d9b738c23 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 f93f0605269a..79784688d497 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 eb173e3d5f8e..1a04abe3196e 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 8ec1b590fdfc..5ae959ef1699 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 c155563d8d06..0f37288d51db 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 1caf5c033763..77fe7d14dcba 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 fd5f8c0868c6..2fd2c689a3c5 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 2b8180be00e2..d950fce109b1 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 2acaf54f05f4..5c0f238e0bcc 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 055a924cf04e..57365e98f97e 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 4400b03e3132..e820ec67d6f6 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 bb8710aad489..aaa08ea49b32 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 4ee0d42ae131..27d337a28bf8 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 c07962e10aa9..f561dba24232 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 3d2988202f3b..efd0572c8c63 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 4e9ba6d3158e..77484b8da4a7 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 fe57d6b3fecf..6b8f4089fdfc 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 e7a307c4a22a..997e2f03abd9 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 5f3cebed6677..e9620d4dea42 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 af1fab2b5958..6d6a2a60af0e 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 c77cad8858e0..8ed2a9a6b3fc 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 96acaf43e341..3149ed49f7ea 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 d31723f9c6c2..b83c7b8852c9 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 5e6abc3e786f..8557f409b75c 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 e16cfecb694b..163a1253ef0a 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 f328c4844781..1d2b0197f08e 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 1fce8e5ce499..e4d7483c5cf8 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 c57257502e40..9d379e8bfe7d 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 ee9516e552ef..8a30cc967486 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 919c1f7ad184..62174a70d07f 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 d63d8b13b436..a5c318a20f47 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 dbaa5460fd09..ffb7a0a5bb30 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 73e9391f0168..6b68e3c9ed71 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 07731020d348..ecb8e3ca0ed5 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 d2bf6e29f873..a5f87e6c5365 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 b6ee2d10fb33..a499c1480259 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 aab19b31397b..a1453a384557 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 fb5f3e11ab70..14d4ea3ff35f 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 fa4bec0271f0..aa25d13e0cd5 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 7d07cab433f6..d6d015d47858 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 2297277fdc06..3b0a457559cc 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 b4ec9914f263..5b1b1dd8ec3b 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 45e5b1ad9c94..3c0fcba2064f 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 986071ec5359..8ccda6824bdf 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 db4a51bbf222..1f21ca9ef1b2 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 6bd3fa5a73bc..7db4ce8caf24 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 465c9b7090e6..03497de0d554 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 86656b011dd4..da00e1595dee 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 a1cb0063322d..e721a9a96dba 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 eb2638f25688..8fb2b9b40f4f 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 d84ebe0ba766..48a49996aeeb 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 2b3e44a65290..173919608de0 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 acd1d63a6edf..cd9d9603ffb1 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 a24ef38b2834..16a895f72316 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]");