Add arbitrary_self_types feature gate error to some tests

This commit is contained in:
Michael Hewson 2017-11-07 05:16:24 -05:00
parent aa0df3da3d
commit 6fd215647d
2 changed files with 10 additions and 3 deletions

View File

@ -13,6 +13,7 @@ struct S(String);
impl S {
fn f(self: *mut S) -> String { self.0 }
//~^ ERROR invalid `self` type
//~| ERROR arbitrary `self` types are unstable
}
fn main() { S("".to_owned()).f(); }

View File

@ -15,7 +15,9 @@ struct Foo {
}
impl Foo {
fn foo(self: isize, x: isize) -> isize { //~ ERROR invalid `self` type
fn foo(self: isize, x: isize) -> isize {
//~^ ERROR invalid `self` type
//~| ERROR arbitrary `self` types are unstable
self.f + x
}
}
@ -25,10 +27,14 @@ struct Bar<T> {
}
impl<T> Bar<T> {
fn foo(self: Bar<isize>, x: isize) -> isize { //~ ERROR invalid `self` type
fn foo(self: Bar<isize>, x: isize) -> isize {
//~^ ERROR invalid `self` type
//~| ERROR arbitrary `self` types are unstable
x
}
fn bar(self: &Bar<usize>, x: isize) -> isize { //~ ERROR invalid `self` type
fn bar(self: &Bar<usize>, x: isize) -> isize {
//~^ ERROR invalid `self` type
//~| ERROR arbitrary `self` types are unstable
x
}
}