diff options
| author | Eduard Burtescu <edy.burt@gmail.com> | 2014-02-07 00:38:33 +0200 |
|---|---|---|
| committer | Eduard Burtescu <edy.burt@gmail.com> | 2014-02-07 00:38:33 +0200 |
| commit | b2d30b72bfaa1f36808151e5825073cdff2e7ea7 (patch) | |
| tree | 14ff6b505eeee456236727940e5804e3e812b1b5 /src/test/compile-fail | |
| parent | c13a929d58c3f866687ccf12cc33b2b59a2e10b8 (diff) | |
| download | rust-b2d30b72bfaa1f36808151e5825073cdff2e7ea7.tar.gz rust-b2d30b72bfaa1f36808151e5825073cdff2e7ea7.zip | |
Removed @self and @Trait.
Diffstat (limited to 'src/test/compile-fail')
| -rw-r--r-- | src/test/compile-fail/borrowck-object-lifetime.rs | 10 | ||||
| -rw-r--r-- | src/test/compile-fail/borrowck-object-mutability.rs | 7 | ||||
| -rw-r--r-- | src/test/compile-fail/class-cast-to-trait.rs | 4 | ||||
| -rw-r--r-- | src/test/compile-fail/issue-5153.rs | 6 | ||||
| -rw-r--r-- | src/test/compile-fail/kindck-owned-trait.rs | 26 | ||||
| -rw-r--r-- | src/test/compile-fail/lint-heap-memory.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/map-types.rs | 10 | ||||
| -rw-r--r-- | src/test/compile-fail/object-does-not-impl-trait.rs | 6 | ||||
| -rw-r--r-- | src/test/compile-fail/object-pointer-types.rs | 13 | ||||
| -rw-r--r-- | src/test/compile-fail/regions-trait-1.rs | 6 | ||||
| -rw-r--r-- | src/test/compile-fail/selftype-traittype.rs | 4 | ||||
| -rw-r--r-- | src/test/compile-fail/trait-bounds-sugar.rs | 20 | ||||
| -rw-r--r-- | src/test/compile-fail/trait-coercion-generic-bad.rs | 4 | ||||
| -rw-r--r-- | src/test/compile-fail/trait-coercion-generic-regions.rs | 4 | ||||
| -rw-r--r-- | src/test/compile-fail/trait-test-2.rs | 4 |
15 files changed, 20 insertions, 106 deletions
diff --git a/src/test/compile-fail/borrowck-object-lifetime.rs b/src/test/compile-fail/borrowck-object-lifetime.rs index ce762e351f9..daeb5b72857 100644 --- a/src/test/compile-fail/borrowck-object-lifetime.rs +++ b/src/test/compile-fail/borrowck-object-lifetime.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[feature(managed_boxes)]; - trait Foo { fn borrowed<'a>(&'a self) -> &'a (); } @@ -18,14 +16,6 @@ fn borrowed_receiver<'a>(x: &'a Foo) -> &'a () { x.borrowed() } -fn managed_receiver(x: @Foo) -> &() { - x.borrowed() //~ ERROR cannot root managed value long enough -} - -fn managed_receiver_1(x: @Foo) { - *x.borrowed() -} - fn owned_receiver(x: ~Foo) -> &() { x.borrowed() //~ ERROR borrowed value does not live long enough } diff --git a/src/test/compile-fail/borrowck-object-mutability.rs b/src/test/compile-fail/borrowck-object-mutability.rs index 1d1b993f5d1..d4203dc9916 100644 --- a/src/test/compile-fail/borrowck-object-mutability.rs +++ b/src/test/compile-fail/borrowck-object-mutability.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[feature(managed_boxes)]; - trait Foo { fn borrowed(&self); fn borrowed_mut(&mut self); @@ -25,11 +23,6 @@ fn borrowed_mut_receiver(x: &mut Foo) { x.borrowed_mut(); } -fn managed_receiver(x: @Foo) { - x.borrowed(); - x.borrowed_mut(); //~ ERROR cannot borrow -} - fn owned_receiver(x: ~Foo) { x.borrowed(); x.borrowed_mut(); //~ ERROR cannot borrow diff --git a/src/test/compile-fail/class-cast-to-trait.rs b/src/test/compile-fail/class-cast-to-trait.rs index 4abd9898d87..18f6fc25149 100644 --- a/src/test/compile-fail/class-cast-to-trait.rs +++ b/src/test/compile-fail/class-cast-to-trait.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[feature(managed_boxes)]; - trait noisy { fn speak(&self); } @@ -59,6 +57,6 @@ fn cat(in_x : uint, in_y : int, in_name: ~str) -> cat { } fn main() { - let nyan : @noisy = @cat(0, 2, ~"nyan") as @noisy; + let nyan: ~noisy = ~cat(0, 2, ~"nyan") as ~noisy; nyan.eat(); //~ ERROR does not implement any method in scope named `eat` } diff --git a/src/test/compile-fail/issue-5153.rs b/src/test/compile-fail/issue-5153.rs index 619ce688d08..5228e03b8bd 100644 --- a/src/test/compile-fail/issue-5153.rs +++ b/src/test/compile-fail/issue-5153.rs @@ -8,9 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[feature(managed_boxes)]; - -// error-pattern: type `@Foo:'static` does not implement any method in scope named `foo` +// error-pattern: type `&Foo<no-bounds>` does not implement any method in scope named `foo` trait Foo { fn foo(~self); @@ -21,5 +19,5 @@ impl Foo for int { } fn main() { - (@5 as @Foo).foo(); + (&5 as &Foo).foo(); } diff --git a/src/test/compile-fail/kindck-owned-trait.rs b/src/test/compile-fail/kindck-owned-trait.rs deleted file mode 100644 index 87e9769d97e..00000000000 --- a/src/test/compile-fail/kindck-owned-trait.rs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or -// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license -// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#[feature(managed_boxes)]; - -trait foo { fn foo(&self); } - -fn to_foo<T:Clone + foo>(t: T) -> @foo { - @t as @foo - //~^ ERROR value may contain references; add `'static` bound - //~^^ ERROR cannot pack type - //~^^^ ERROR value may contain references -} - -fn to_foo2<T:Clone + foo + 'static>(t: T) -> @foo { - @t as @foo -} - -fn main() {} diff --git a/src/test/compile-fail/lint-heap-memory.rs b/src/test/compile-fail/lint-heap-memory.rs index 8899f3f5dbb..fa359dcd538 100644 --- a/src/test/compile-fail/lint-heap-memory.rs +++ b/src/test/compile-fail/lint-heap-memory.rs @@ -23,8 +23,6 @@ fn main() { @2; //~ ERROR type uses managed - fn f(_: @Clone) {} //~ ERROR type uses managed - ~2; //~ ERROR type uses owned ~[1]; //~ ERROR type uses owned //~^ ERROR type uses owned diff --git a/src/test/compile-fail/map-types.rs b/src/test/compile-fail/map-types.rs index 0a1eab913be..697678e286d 100644 --- a/src/test/compile-fail/map-types.rs +++ b/src/test/compile-fail/map-types.rs @@ -8,16 +8,14 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[feature(managed_boxes)]; - use std::container::Map; use std::hashmap::HashMap; // Test that trait types printed in error msgs include the type arguments. fn main() { - let x: @HashMap<~str, ~str> = @HashMap::new(); - let x: @Map<~str, ~str> = x; - let y: @Map<uint, ~str> = @x; - //~^ ERROR failed to find an implementation of trait std::container::Map<uint,~str> for @std::container::Map<~str,~str>:'static + let x: ~HashMap<~str, ~str> = ~HashMap::new(); + let x: ~Map<~str, ~str> = x; + let y: ~Map<uint, ~str> = ~x; + //~^ ERROR failed to find an implementation of trait std::container::Map<uint,~str> for ~std::container::Map<~str,~str>:Send } diff --git a/src/test/compile-fail/object-does-not-impl-trait.rs b/src/test/compile-fail/object-does-not-impl-trait.rs index 916bb74edb2..95f92380816 100644 --- a/src/test/compile-fail/object-does-not-impl-trait.rs +++ b/src/test/compile-fail/object-does-not-impl-trait.rs @@ -8,12 +8,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[feature(managed_boxes)]; - -// Test that an object type `@Foo` is not considered to implement the +// Test that an object type `~Foo` is not considered to implement the // trait `Foo`. Issue #5087. trait Foo {} fn take_foo<F:Foo>(f: F) {} -fn take_object(f: @Foo) { take_foo(f); } //~ ERROR failed to find an implementation of trait +fn take_object(f: ~Foo) { take_foo(f); } //~ ERROR failed to find an implementation of trait fn main() {} diff --git a/src/test/compile-fail/object-pointer-types.rs b/src/test/compile-fail/object-pointer-types.rs index 2270cb6f498..ab2aa928c26 100644 --- a/src/test/compile-fail/object-pointer-types.rs +++ b/src/test/compile-fail/object-pointer-types.rs @@ -8,35 +8,22 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[feature(managed_boxes)]; - trait Foo { fn borrowed(&self); fn borrowed_mut(&mut self); - fn managed(@self); - fn owned(~self); } fn borrowed_receiver(x: &Foo) { x.borrowed(); x.borrowed_mut(); // See [1] - x.managed(); //~ ERROR does not implement any method x.owned(); //~ ERROR does not implement any method } fn borrowed_mut_receiver(x: &mut Foo) { x.borrowed(); x.borrowed_mut(); - x.managed(); //~ ERROR does not implement any method - x.owned(); //~ ERROR does not implement any method -} - -fn managed_receiver(x: @Foo) { - x.borrowed(); - x.borrowed_mut(); // See [1] - x.managed(); x.owned(); //~ ERROR does not implement any method } diff --git a/src/test/compile-fail/regions-trait-1.rs b/src/test/compile-fail/regions-trait-1.rs index 8e6b821294b..7aa545ab1b9 100644 --- a/src/test/compile-fail/regions-trait-1.rs +++ b/src/test/compile-fail/regions-trait-1.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[feature(managed_boxes)]; - struct ctxt { v: uint } trait get_ctxt { @@ -29,12 +27,12 @@ impl<'a> get_ctxt for has_ctxt<'a> { } -fn get_v(gc: @get_ctxt) -> uint { +fn get_v(gc: ~get_ctxt) -> uint { gc.get_ctxt().v } fn main() { let ctxt = ctxt { v: 22u }; let hc = has_ctxt { c: &ctxt }; - assert_eq!(get_v(@hc as @get_ctxt), 22u); + assert_eq!(get_v(~hc as ~get_ctxt), 22u); } diff --git a/src/test/compile-fail/selftype-traittype.rs b/src/test/compile-fail/selftype-traittype.rs index d6c97806201..73df5c3967c 100644 --- a/src/test/compile-fail/selftype-traittype.rs +++ b/src/test/compile-fail/selftype-traittype.rs @@ -8,13 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[feature(managed_boxes)]; - trait add { fn plus(&self, x: Self) -> Self; } -fn do_add(x: @add, y: @add) -> @add { +fn do_add(x: ~add, y: ~add) -> ~add { x.plus(y) //~ ERROR cannot call a method whose type contains a self-type through an object } diff --git a/src/test/compile-fail/trait-bounds-sugar.rs b/src/test/compile-fail/trait-bounds-sugar.rs index d907022da71..b9fb94e09ed 100644 --- a/src/test/compile-fail/trait-bounds-sugar.rs +++ b/src/test/compile-fail/trait-bounds-sugar.rs @@ -8,32 +8,22 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[feature(managed_boxes)]; - // Tests for "default" bounds inferred for traits with no bounds list. -trait Foo { -} +trait Foo {} fn a(_x: ~Foo) { // should be same as ~Foo:Send } -fn b(_x: @Foo) { // should be same as ~Foo:'static -} - -fn c(_x: &'static Foo) { // should be same as &'static Foo:'static +fn b(_x: &'static Foo) { // should be same as &'static Foo:'static } -fn d(x: ~Foo:Freeze) { +fn c(x: ~Foo:Freeze) { a(x); //~ ERROR expected bounds `Send` } -fn e(x: @Foo:Freeze) { +fn d(x: &'static Foo:Freeze) { b(x); //~ ERROR expected bounds `'static` } -fn f(x: &'static Foo:Freeze) { - c(x); //~ ERROR expected bounds `'static` -} - -fn main() { } +fn main() {} diff --git a/src/test/compile-fail/trait-coercion-generic-bad.rs b/src/test/compile-fail/trait-coercion-generic-bad.rs index 2d73158add2..f04770409a2 100644 --- a/src/test/compile-fail/trait-coercion-generic-bad.rs +++ b/src/test/compile-fail/trait-coercion-generic-bad.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[feature(managed_boxes)]; - struct Struct { person: &'static str } @@ -25,7 +23,7 @@ impl Trait<&'static str> for Struct { } fn main() { - let s: @Trait<int> = @Struct { person: "Fred" }; //~ ERROR expected Trait<int>, but found Trait<&'static str> + let s: ~Trait<int> = ~Struct { person: "Fred" }; //~ ERROR expected Trait<int>, but found Trait<&'static str> //~^ ERROR expected Trait<int>, but found Trait<&'static str> s.f(1); } diff --git a/src/test/compile-fail/trait-coercion-generic-regions.rs b/src/test/compile-fail/trait-coercion-generic-regions.rs index 1ea18a7c75b..2aeebc0f1a8 100644 --- a/src/test/compile-fail/trait-coercion-generic-regions.rs +++ b/src/test/compile-fail/trait-coercion-generic-regions.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[feature(managed_boxes)]; - struct Struct { person: &'static str } @@ -27,6 +25,6 @@ impl Trait<&'static str> for Struct { fn main() { let person = ~"Fred"; let person: &str = person; //~ ERROR borrowed value does not live long enough - let s: @Trait<&'static str> = @Struct { person: person }; + let s: ~Trait<&'static str> = ~Struct { person: person }; } diff --git a/src/test/compile-fail/trait-test-2.rs b/src/test/compile-fail/trait-test-2.rs index 3006b6e5acf..acac7ae9556 100644 --- a/src/test/compile-fail/trait-test-2.rs +++ b/src/test/compile-fail/trait-test-2.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[feature(managed_boxes)]; - trait bar { fn dup(&self) -> Self; fn blah<X>(&self); } impl bar for int { fn dup(&self) -> int { *self } fn blah<X>(&self) {} } impl bar for uint { fn dup(&self) -> uint { *self } fn blah<X>(&self) {} } @@ -17,5 +15,5 @@ impl bar for uint { fn dup(&self) -> uint { *self } fn blah<X>(&self) {} } fn main() { 10i.dup::<int>(); //~ ERROR does not take type parameters 10i.blah::<int, int>(); //~ ERROR incorrect number of type parameters - (@10 as @bar).dup(); //~ ERROR contains a self-type + (~10 as ~bar).dup(); //~ ERROR contains a self-type } |
