提交 89ed595e 编写于 作者: N Niko Matsakis

correct expected error msgs in various tests rs=breakage

上级 8a687dd8
enum sty = ~[int];
fn unpack(unpack: &fn(v: &sty) -> ~[int]) {}
fn unpack(_unpack: &fn(v: &sty) -> ~[int]) {}
fn main() {
let foo = unpack(|s| {
let _foo = unpack(|s| {
// Test that `s` is moved here.
match *s { sty(v) => v } //~ ERROR moving out of dereference of immutable & pointer
});
......
......@@ -32,9 +32,9 @@ fn main() {
{
let mut res = foo(x);
let mut v = ~[mut];
v = move ~[mut (move res)] + v; //~ ERROR instantiating a type parameter with an incompatible type (needs `copy`, got `durable`, missing `copy`)
v = move ~[mut (move res)] + v; //~ ERROR instantiating a type parameter with an incompatible type (needs `copy`, got `&static`, missing `copy`)
assert (v.len() == 2);
}
......
......@@ -32,7 +32,7 @@ fn to_foo<T:Copy>(t: T) {
fn to_foo_2<T:Copy>(t: T) -> foo {
// Not OK---T may contain borrowed ptrs and it is going to escape
// as part of the returned foo value
{f:t} as foo //~ ERROR value may contain borrowed pointers; use `durable` bound
{f:t} as foo //~ ERROR value may contain borrowed pointers; use `&static` bound
}
fn to_foo_3<T:Copy &static>(t: T) -> foo {
......
......@@ -11,7 +11,7 @@
trait foo { fn foo(); }
fn to_foo<T: Copy foo>(t: T) -> foo {
t as foo //~ ERROR value may contain borrowed pointers; use `durable` bound
t as foo //~ ERROR value may contain borrowed pointers; use `&static` bound
}
fn to_foo2<T: Copy foo &static>(t: T) -> foo {
......
......@@ -18,12 +18,12 @@ fn copy2<T: Copy &static>(t: T) -> fn@() -> T {
fn main() {
let x = &3;
copy2(&x); //~ ERROR missing `durable`
copy2(&x); //~ ERROR missing `&static`
copy2(@3);
copy2(@&x); //~ ERROR missing `durable`
copy2(@&x); //~ ERROR missing `&static`
copy2(fn@() {});
copy2(fn~() {}); //~ WARNING instantiating copy type parameter with a not implicitly copyable type
copy2(fn&() {}); //~ ERROR missing `copy durable`
copy2(fn&() {}); //~ ERROR missing `copy &static`
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册