Remove wfcheck for auto traits, remove dead error codes

The WF checks are now done as an AST validation.
This commit is contained in:
leonardo.yvens 2017-12-03 20:07:50 -02:00 committed by Vadim Petrochenkov
parent 02b5fee732
commit edd52b1975
9 changed files with 23 additions and 111 deletions

View file

@ -11,12 +11,9 @@
#![feature(optin_builtin_traits)]
auto trait Generic<T> {}
//~^ ERROR auto traits cannot have generics
//~^^ traits with auto impls (`e.g. impl Trait for ..`) can not have type parameters
//~^ Auto traits cannot have type parameters [E0567]
auto trait Bound : Copy {}
//~^ ERROR auto traits cannot have super traits
//~^^ traits with auto impls (`e.g. impl Trait for ..`) cannot have predicates
//~^ Auto traits cannot have predicates [E0568]
auto trait MyTrait { fn foo() {} }
//~^ ERROR auto traits cannot contain items
//~^^ traits with default impls (`e.g. impl Trait for ..`) must have no methods or associated items
//~^ Auto traits cannot have methods or associated items [E0380]
fn main() {}

View file

@ -14,13 +14,11 @@ auto trait MySafeTrait {}
struct Foo;
#[allow(auto_impl)]
unsafe impl MySafeTrait for Foo {}
//~^ ERROR implementing the trait `MySafeTrait` is not unsafe
unsafe auto trait MyUnsafeTrait {}
#[allow(auto_impl)]
impl MyUnsafeTrait for Foo {}
//~^ ERROR the trait `MyUnsafeTrait` requires an `unsafe impl` declaration

View file

@ -22,4 +22,5 @@ fn call_method<T: Trait>(x: T) {}
fn main() {
// ICE
call_method(());
//~^ ERROR
}

View file

@ -22,6 +22,6 @@ fn copy<T: Magic>(x: T) -> (T, T) { (x, x) }
struct NoClone;
fn main() {
let (a, b) = copy(NoClone);
let (a, b) = copy(NoClone); //~ ERROR
println!("{:?} {:?}", a, b);
}