mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-05 11:33:04 +00:00
parent
1b12dca7f9
commit
0f6537fed4
@ -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) {
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
|
@ -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 {
|
||||
|
@ -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() {
|
||||
|
@ -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
|
||||
|
@ -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<A> { f: A }
|
||||
fn guard(_s: ~str) -> bool {fail!()}
|
||||
fn touch<A>(_a: &A) {}
|
||||
|
@ -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() {
|
||||
|
@ -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;
|
||||
|
@ -1,3 +1,5 @@
|
||||
#[feature(managed_boxes)];
|
||||
|
||||
fn f<T:'static>(_: T) {}
|
||||
|
||||
fn main() {
|
||||
|
@ -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:Send>(_i: T) {
|
||||
}
|
||||
|
||||
|
@ -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];
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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];
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -10,6 +10,8 @@
|
||||
|
||||
// error-pattern:fail
|
||||
|
||||
#[feature(managed_boxes)];
|
||||
|
||||
fn main() {
|
||||
let _a = @0;
|
||||
assert!(false);
|
||||
|
@ -10,6 +10,8 @@
|
||||
|
||||
// error-pattern:fail
|
||||
|
||||
#[feature(managed_boxes)];
|
||||
|
||||
use std::cast;
|
||||
|
||||
fn failfn() {
|
||||
|
@ -10,6 +10,8 @@
|
||||
|
||||
// error-pattern:fail
|
||||
|
||||
#[feature(managed_boxes)];
|
||||
|
||||
fn failfn() {
|
||||
fail!();
|
||||
}
|
||||
|
@ -10,6 +10,8 @@
|
||||
|
||||
// error-pattern:fail
|
||||
|
||||
#[feature(managed_boxes)];
|
||||
|
||||
fn failfn() {
|
||||
fail!();
|
||||
}
|
||||
|
@ -10,6 +10,8 @@
|
||||
|
||||
// error-pattern:fail
|
||||
|
||||
#[feature(managed_boxes)];
|
||||
|
||||
fn failfn() {
|
||||
fail!();
|
||||
}
|
||||
|
@ -10,6 +10,8 @@
|
||||
|
||||
// error-pattern:fail
|
||||
|
||||
#[feature(managed_boxes)];
|
||||
|
||||
fn failfn() {
|
||||
fail!();
|
||||
}
|
||||
|
@ -10,6 +10,8 @@
|
||||
|
||||
// error-pattern:fail
|
||||
|
||||
#[feature(managed_boxes)];
|
||||
|
||||
fn failfn() {
|
||||
fail!();
|
||||
}
|
||||
|
@ -10,6 +10,8 @@
|
||||
|
||||
// error-pattern:fail
|
||||
|
||||
#[feature(managed_boxes)];
|
||||
|
||||
fn main() {
|
||||
@0;
|
||||
fail!();
|
||||
|
@ -10,6 +10,7 @@
|
||||
|
||||
// error-pattern:fail
|
||||
|
||||
#[feature(managed_boxes)];
|
||||
#[allow(unreachable_code)];
|
||||
#[allow(unused_variable)];
|
||||
|
||||
|
@ -10,6 +10,8 @@
|
||||
|
||||
// error-pattern:fail
|
||||
|
||||
#[feature(managed_boxes)];
|
||||
|
||||
fn x(it: |int|) {
|
||||
let _a = @0;
|
||||
it(1);
|
||||
|
@ -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() {
|
||||
|
@ -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();
|
||||
|
@ -10,6 +10,8 @@
|
||||
|
||||
// error-pattern:fail
|
||||
|
||||
#[feature(managed_boxes)];
|
||||
|
||||
fn main() {
|
||||
let _a = @0;
|
||||
{
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -10,6 +10,8 @@
|
||||
|
||||
// error-pattern:fail
|
||||
|
||||
#[feature(managed_boxes)];
|
||||
|
||||
fn f() {
|
||||
let _a = @0;
|
||||
fail!();
|
||||
|
@ -10,6 +10,8 @@
|
||||
|
||||
// error-pattern:fail
|
||||
|
||||
#[feature(managed_boxes)];
|
||||
|
||||
fn f() {
|
||||
fail!();
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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; }
|
||||
|
@ -10,6 +10,8 @@
|
||||
|
||||
// exec-env:RUST_POISON_ON_FREE=1
|
||||
|
||||
#[feature(managed_boxes)];
|
||||
|
||||
use std::ptr;
|
||||
|
||||
struct F { f: ~int }
|
||||
|
@ -12,6 +12,8 @@
|
||||
|
||||
// exec-env:RUST_POISON_ON_FREE=1
|
||||
|
||||
#[feature(managed_boxes)];
|
||||
|
||||
use std::ptr;
|
||||
|
||||
fn borrow(x: &int, f: |x: &int|) {
|
||||
|
@ -10,6 +10,8 @@
|
||||
|
||||
// exec-env:RUST_POISON_ON_FREE=1
|
||||
|
||||
#[feature(managed_boxes)];
|
||||
|
||||
use std::ptr;
|
||||
|
||||
struct F { f: ~int }
|
||||
|
@ -12,6 +12,8 @@
|
||||
|
||||
// exec-env:RUST_POISON_ON_FREE=1
|
||||
|
||||
#[feature(managed_boxes)];
|
||||
|
||||
use std::ptr;
|
||||
|
||||
fn borrow(x: &int, f: |x: &int|) {
|
||||
|
@ -12,6 +12,8 @@
|
||||
|
||||
// exec-env:RUST_POISON_ON_FREE=1
|
||||
|
||||
#[feature(managed_boxes)];
|
||||
|
||||
use std::ptr;
|
||||
|
||||
fn borrow(x: &int, f: |x: &int|) {
|
||||
|
@ -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;
|
||||
|
@ -12,6 +12,8 @@
|
||||
|
||||
// exec-env:RUST_POISON_ON_FREE=1
|
||||
|
||||
#[feature(managed_boxes)];
|
||||
|
||||
use std::ptr;
|
||||
|
||||
fn borrow(x: &int, f: |x: &int|) {
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -1,3 +1,5 @@
|
||||
#[feature(managed_boxes)];
|
||||
|
||||
fn f(x: &int) {
|
||||
println(x.to_str());
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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); }
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
// xfail-fast
|
||||
|
||||
#[feature(struct_variant)];
|
||||
#[feature(struct_variant, managed_boxes)];
|
||||
|
||||
extern mod extra;
|
||||
|
||||
|
@ -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)); }
|
||||
|
@ -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 } }; }
|
||||
|
@ -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 {
|
||||
|
@ -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() {
|
||||
|
@ -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() {
|
||||
|
@ -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.
|
||||
|
||||
|
@ -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<T>(dst: &mut T, src: T);
|
||||
|
@ -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,
|
||||
|
@ -10,6 +10,9 @@
|
||||
|
||||
// xfail-fast
|
||||
// aux-build:issue-3012-1.rs
|
||||
|
||||
#[feature(managed_boxes)];
|
||||
|
||||
extern mod socketlib;
|
||||
|
||||
use socketlib::socket;
|
||||
|
@ -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 {
|
||||
|
@ -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() {
|
||||
|
@ -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;
|
||||
|
@ -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() {
|
||||
|
@ -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(()) => {}
|
||||
|
@ -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<T>(obj : T, expected : ~str) {
|
||||
|
||||
|
@ -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
|
||||
|
@ -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 }
|
||||
|
||||
|
@ -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 }
|
||||
|
@ -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 }
|
||||
|
||||
|
@ -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<int>, baz: int }
|
||||
|
||||
pub fn main() {
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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]
|
||||
}
|
||||
|
@ -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 }
|
||||
|
||||
|
@ -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() {
|
||||
|
@ -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 {
|
||||
|
@ -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,
|
||||
|
@ -1,3 +1,5 @@
|
||||
#[feature(managed_boxes)];
|
||||
|
||||
struct Foo<'a> {
|
||||
x: &'a int
|
||||
}
|
||||
|
@ -10,6 +10,8 @@
|
||||
|
||||
// xfail-fast
|
||||
|
||||
#[feature(managed_boxes)];
|
||||
|
||||
fn p_foo<T>(_pinned: T) { }
|
||||
fn s_foo<T>(_shared: T) { }
|
||||
fn u_foo<T:Send>(_unique: T) { }
|
||||
|
@ -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) -> T {
|
||||
let t1 = t;
|
||||
t1
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -1,3 +1,5 @@
|
||||
#[feature(managed_boxes)];
|
||||
|
||||
pub fn main() {
|
||||
let x = @[1, 2, 3];
|
||||
match x {
|
||||
|
@ -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]");
|
||||
|
Loading…
Reference in New Issue
Block a user