Adjust tests for removal of impl Foo for .. {}

This commit is contained in:
leonardo.yvens 2017-12-03 10:56:53 -02:00 committed by Vadim Petrochenkov
parent f93183adb4
commit 02b5fee732
27 changed files with 30 additions and 169 deletions

View File

@ -101,7 +101,7 @@ pub use panicking::{take_hook, set_hook, PanicInfo, Location};
#[stable(feature = "catch_unwind", since = "1.9.0")] #[stable(feature = "catch_unwind", since = "1.9.0")]
#[rustc_on_unimplemented = "the type {Self} may not be safely transferred \ #[rustc_on_unimplemented = "the type {Self} may not be safely transferred \
across an unwind boundary"] across an unwind boundary"]
pub trait UnwindSafe {} pub auto trait UnwindSafe {}
/// A marker trait representing types where a shared reference is considered /// A marker trait representing types where a shared reference is considered
/// unwind safe. /// unwind safe.
@ -115,7 +115,7 @@ pub trait UnwindSafe {}
#[rustc_on_unimplemented = "the type {Self} may contain interior mutability \ #[rustc_on_unimplemented = "the type {Self} may contain interior mutability \
and a reference may not be safely transferrable \ and a reference may not be safely transferrable \
across a catch_unwind boundary"] across a catch_unwind boundary"]
pub trait RefUnwindSafe {} pub auto trait RefUnwindSafe {}
/// A simple wrapper around a type to assert that it is unwind safe. /// A simple wrapper around a type to assert that it is unwind safe.
/// ///

View File

@ -1,16 +0,0 @@
// Copyright 2017 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(optin_builtin_traits)]
trait Foo {}
impl Foo for .. {}
//~^ ERROR The form `impl Foo for .. {}` will be removed, please use `auto trait Foo {}`
//~^^ WARN this was previously accepted by the compiler

View File

@ -11,8 +11,6 @@
#![feature(optin_builtin_traits, core)] #![feature(optin_builtin_traits, core)]
#![crate_type = "rlib"] #![crate_type = "rlib"]
pub trait DefaultedTrait { } pub auto trait DefaultedTrait { }
#[allow(auto_impl)]
impl DefaultedTrait for .. { }
pub struct Something<T> { t: T } pub struct Something<T> { t: T }

View File

@ -10,25 +10,18 @@
#![feature(optin_builtin_traits)] #![feature(optin_builtin_traits)]
trait MyTrait { fn foo() {} } auto trait MySafeTrait {}
struct Foo;
#[allow(auto_impl)] #[allow(auto_impl)]
impl MyTrait for .. {} unsafe impl MySafeTrait for Foo {}
//~^ ERROR redundant auto implementations of trait `MyTrait`
#[allow(auto_impl)]
impl MyTrait for .. {}
trait MySafeTrait {}
#[allow(auto_impl)]
unsafe impl MySafeTrait for .. {}
//~^ ERROR implementing the trait `MySafeTrait` is not unsafe //~^ ERROR implementing the trait `MySafeTrait` is not unsafe
unsafe trait MyUnsafeTrait {} unsafe auto trait MyUnsafeTrait {}
#[allow(auto_impl)] #[allow(auto_impl)]
impl MyUnsafeTrait for .. {} impl MyUnsafeTrait for Foo {}
//~^ ERROR the trait `MyUnsafeTrait` requires an `unsafe impl` declaration //~^ ERROR the trait `MyUnsafeTrait` requires an `unsafe impl` declaration
fn main() {} fn main() {}

View File

@ -12,14 +12,11 @@
#![feature(optin_builtin_traits)] #![feature(optin_builtin_traits)]
unsafe trait Trait { unsafe auto trait Trait {
//~^ ERROR E0380 //~^ ERROR E0380
type Output; type Output;
} }
#[allow(auto_impl)]
unsafe impl Trait for .. {}
fn call_method<T: Trait>(x: T) {} fn call_method<T: Trait>(x: T) {}
fn main() { fn main() {

View File

@ -12,16 +12,13 @@
#![feature(optin_builtin_traits)] #![feature(optin_builtin_traits)]
unsafe trait Trait { unsafe auto trait Trait {
//~^ ERROR E0380 //~^ ERROR E0380
fn method(&self) { fn method(&self) {
println!("Hello"); println!("Hello");
} }
} }
#[allow(auto_impl)]
unsafe impl Trait for .. {}
fn call_method<T: Trait>(x: T) { fn call_method<T: Trait>(x: T) {
x.method(); x.method();
} }

View File

@ -16,10 +16,7 @@
use std::marker::{PhantomData}; use std::marker::{PhantomData};
unsafe trait Zen {} unsafe auto trait Zen {}
#[allow(auto_impl)]
unsafe impl Zen for .. {}
unsafe impl<'a, T: 'a> Zen for &'a T where T: Sync {} unsafe impl<'a, T: 'a> Zen for &'a T where T: Sync {}

View File

@ -10,7 +10,6 @@
#![feature(optin_builtin_traits)] #![feature(optin_builtin_traits)]
trait MarkerTr {}
pub trait Tr { pub trait Tr {
fn f(); fn f();
const C: u8; const C: u8;
@ -21,8 +20,6 @@ pub struct S {
} }
struct Ts(pub u8); struct Ts(pub u8);
#[allow(auto_impl)]
pub impl MarkerTr for .. {} //~ ERROR unnecessary visibility qualifier
pub impl Tr for S { //~ ERROR unnecessary visibility qualifier pub impl Tr for S { //~ ERROR unnecessary visibility qualifier
pub fn f() {} //~ ERROR unnecessary visibility qualifier pub fn f() {} //~ ERROR unnecessary visibility qualifier
pub const C: u8 = 0; //~ ERROR unnecessary visibility qualifier pub const C: u8 = 0; //~ ERROR unnecessary visibility qualifier
@ -39,7 +36,6 @@ pub extern "C" { //~ ERROR unnecessary visibility qualifier
} }
const MAIN: u8 = { const MAIN: u8 = {
trait MarkerTr {}
pub trait Tr { pub trait Tr {
fn f(); fn f();
const C: u8; const C: u8;
@ -50,8 +46,6 @@ const MAIN: u8 = {
} }
struct Ts(pub u8); struct Ts(pub u8);
#[allow(auto_impl)]
pub impl MarkerTr for .. {} //~ ERROR unnecessary visibility qualifier
pub impl Tr for S { //~ ERROR unnecessary visibility qualifier pub impl Tr for S { //~ ERROR unnecessary visibility qualifier
pub fn f() {} //~ ERROR unnecessary visibility qualifier pub fn f() {} //~ ERROR unnecessary visibility qualifier
pub const C: u8 = 0; //~ ERROR unnecessary visibility qualifier pub const C: u8 = 0; //~ ERROR unnecessary visibility qualifier
@ -71,7 +65,6 @@ const MAIN: u8 = {
}; };
fn main() { fn main() {
trait MarkerTr {}
pub trait Tr { pub trait Tr {
fn f(); fn f();
const C: u8; const C: u8;
@ -82,8 +75,6 @@ fn main() {
} }
struct Ts(pub u8); struct Ts(pub u8);
#[allow(auto_impl)]
pub impl MarkerTr for .. {} //~ ERROR unnecessary visibility qualifier
pub impl Tr for S { //~ ERROR unnecessary visibility qualifier pub impl Tr for S { //~ ERROR unnecessary visibility qualifier
pub fn f() {} //~ ERROR unnecessary visibility qualifier pub fn f() {} //~ ERROR unnecessary visibility qualifier
pub const C: u8 = 0; //~ ERROR unnecessary visibility qualifier pub const C: u8 = 0; //~ ERROR unnecessary visibility qualifier

View File

@ -1,20 +0,0 @@
// Copyright 2015 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(specialization)]
#![feature(optin_builtin_traits)]
trait Foo {}
#[allow(auto_impl)]
default impl Foo for .. {}
//~^ ERROR `default impl` is not allowed for auto trait implementations
fn main() {}

View File

@ -13,18 +13,12 @@
#![feature(optin_builtin_traits)] #![feature(optin_builtin_traits)]
#![feature(specialization)] #![feature(specialization)]
trait Foo {} auto trait Foo {}
#[allow(auto_impl)]
impl Foo for .. {}
impl<T> Foo for T {} impl<T> Foo for T {}
impl !Foo for u8 {} //~ ERROR E0119 impl !Foo for u8 {} //~ ERROR E0119
trait Bar {} auto trait Bar {}
#[allow(auto_impl)]
impl Bar for .. {}
impl<T> !Bar for T {} impl<T> !Bar for T {}
impl Bar for u8 {} //~ ERROR E0119 impl Bar for u8 {} //~ ERROR E0119

View File

@ -14,9 +14,7 @@
#![feature(optin_builtin_traits)] #![feature(optin_builtin_traits)]
trait Magic: Copy {} //~ ERROR E0568 auto trait Magic: Copy {} //~ ERROR E0568
#[allow(auto_impl)]
impl Magic for .. {}
fn copy<T: Magic>(x: T) -> (T, T) { (x, x) } fn copy<T: Magic>(x: T) -> (T, T) { (x, x) }

View File

@ -10,9 +10,7 @@
#![feature(optin_builtin_traits)] #![feature(optin_builtin_traits)]
trait Magic : Sized where Option<Self> : Magic {} //~ ERROR E0568 auto trait Magic : Sized where Option<Self> : Magic {} //~ ERROR E0568
#[allow(auto_impl)]
impl Magic for .. {}
impl<T:Magic> Magic for T {} impl<T:Magic> Magic for T {}
fn copy<T: Magic>(x: T) -> (T, T) { (x, x) } fn copy<T: Magic>(x: T) -> (T, T) { (x, x) }

View File

@ -34,9 +34,7 @@
#![feature(optin_builtin_traits)] #![feature(optin_builtin_traits)]
trait Magic: Copy {} //~ ERROR E0568 auto trait Magic: Copy {} //~ ERROR E0568
#[allow(auto_impl)]
impl Magic for .. {}
impl<T:Magic> Magic for T {} impl<T:Magic> Magic for T {}
fn copy<T: Magic>(x: T) -> (T, T) { (x, x) } fn copy<T: Magic>(x: T) -> (T, T) { (x, x) }

View File

@ -1,15 +0,0 @@
// Copyright 2016 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(optin_builtin_traits)]
trait Magic<T> {} //~ ERROR E0567
#[allow(auto_impl)]
impl Magic<isize> for .. {}

View File

@ -10,10 +10,7 @@
#![feature(optin_builtin_traits)] #![feature(optin_builtin_traits)]
trait MyTrait {} auto trait MyTrait {}
#[allow(auto_impl)]
impl MyTrait for .. {}
struct MyS; struct MyS;

View File

@ -10,10 +10,8 @@
#![feature(optin_builtin_traits)] #![feature(optin_builtin_traits)]
trait MyTrait {} auto trait MyTrait {}
#[allow(auto_impl)]
impl MyTrait for .. {}
impl<T> !MyTrait for *mut T {} impl<T> !MyTrait for *mut T {}
struct MyS; struct MyS;

View File

@ -10,15 +10,9 @@
#![feature(optin_builtin_traits)] #![feature(optin_builtin_traits)]
trait MyTrait {} auto trait MyTrait {}
#[allow(auto_impl)] unsafe auto trait MyUnsafeTrait {}
impl MyTrait for .. {}
unsafe trait MyUnsafeTrait {}
#[allow(auto_impl)]
unsafe impl MyUnsafeTrait for .. {}
struct ThisImplsTrait; struct ThisImplsTrait;

View File

@ -10,14 +10,12 @@
// Test that declaring that `&T` is `Defaulted` if `T:Signed` implies // Test that declaring that `&T` is `Defaulted` if `T:Signed` implies
// that other `&T` is NOT `Defaulted` if `T:Signed` does not hold. In // that other `&T` is NOT `Defaulted` if `T:Signed` does not hold. In
// other words, the `..` impl only applies if there are no existing // other words, the auto impl only applies if there are no existing
// impls whose types unify. // impls whose types unify.
#![feature(optin_builtin_traits)] #![feature(optin_builtin_traits)]
trait Defaulted { } auto trait Defaulted { }
#[allow(auto_impl)]
impl Defaulted for .. { }
impl<'a,T:Signed> Defaulted for &'a T { } impl<'a,T:Signed> Defaulted for &'a T { }
impl<'a,T:Signed> Defaulted for &'a mut T { } impl<'a,T:Signed> Defaulted for &'a mut T { }
fn is_defaulted<T:Defaulted>() { } fn is_defaulted<T:Defaulted>() { }

View File

@ -80,6 +80,4 @@ pub mod marker {
} }
#[lang = "freeze"] #[lang = "freeze"]
trait Freeze {} auto trait Freeze {}
#[allow(auto_impl)]
impl Freeze for .. {}

View File

@ -18,9 +18,7 @@ trait Copy { }
trait Sized { } trait Sized { }
#[lang = "freeze"] #[lang = "freeze"]
trait Freeze {} auto trait Freeze {}
#[allow(auto_impl)]
impl Freeze for .. {}
#[lang="start"] #[lang="start"]
fn start(_main: *const u8, _argc: isize, _argv: *const *const u8) -> isize { 0 } fn start(_main: *const u8, _argc: isize, _argv: *const *const u8) -> isize { 0 }

View File

@ -11,9 +11,6 @@
#![feature(optin_builtin_traits)] #![feature(optin_builtin_traits)]
auto trait Auto {} auto trait Auto {}
// Redundant but accepted until we remove it.
#[allow(auto_impl)]
impl Auto for .. {}
unsafe auto trait AutoUnsafe {} unsafe auto trait AutoUnsafe {}

View File

@ -10,9 +10,8 @@
#![feature(optin_builtin_traits)] #![feature(optin_builtin_traits)]
trait NotSame {} auto trait NotSame {}
#[allow(auto_impl)]
impl NotSame for .. {}
impl<A> !NotSame for (A, A) {} impl<A> !NotSame for (A, A) {}
trait OneOfEach {} trait OneOfEach {}

View File

@ -14,10 +14,7 @@
pub mod bar { pub mod bar {
use std::marker; use std::marker;
pub trait Bar {} pub auto trait Bar {}
#[allow(auto_impl)]
impl Bar for .. {}
pub trait Foo { pub trait Foo {
fn foo(&self) {} fn foo(&self) {}

View File

@ -10,7 +10,4 @@
#![feature(optin_builtin_traits)] #![feature(optin_builtin_traits)]
pub trait AnOibit {} pub auto trait AnOibit {}
#[allow(auto_impl)]
impl AnOibit for .. {}

View File

@ -10,10 +10,7 @@
#![feature(optin_builtin_traits)] #![feature(optin_builtin_traits)]
pub trait AnOibit {} pub auto trait AnOibit {}
#[allow(auto_impl)]
impl AnOibit for .. {}
pub struct Foo<T> { field: T } pub struct Foo<T> { field: T }

View File

@ -20,10 +20,6 @@ trait DummyTrait {
auto trait AutoDummyTrait {} auto trait AutoDummyTrait {}
//~^ ERROR auto traits are experimental and possibly buggy //~^ ERROR auto traits are experimental and possibly buggy
#[allow(auto_impl)]
impl DummyTrait for .. {}
//~^ ERROR auto trait implementations are experimental and possibly buggy
impl !DummyTrait for DummyStruct {} impl !DummyTrait for DummyStruct {}
//~^ ERROR negative trait bounds are not yet fully implemented; use marker types for now //~^ ERROR negative trait bounds are not yet fully implemented; use marker types for now

View File

@ -1,15 +0,0 @@
// Copyright 2015 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(optin_builtin_traits)]
#[allow(auto_impl)]
impl Copy for .. {} //~ ERROR E0318
fn main() {}