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")]
#[rustc_on_unimplemented = "the type {Self} may not be safely transferred \
across an unwind boundary"]
pub trait UnwindSafe {}
pub auto trait UnwindSafe {}
/// A marker trait representing types where a shared reference is considered
/// unwind safe.
@ -115,7 +115,7 @@ pub trait UnwindSafe {}
#[rustc_on_unimplemented = "the type {Self} may contain interior mutability \
and a reference may not be safely transferrable \
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.
///

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)]
#![crate_type = "rlib"]
pub trait DefaultedTrait { }
#[allow(auto_impl)]
impl DefaultedTrait for .. { }
pub auto trait DefaultedTrait { }
pub struct Something<T> { t: T }

View File

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

View File

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

View File

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

View File

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

View File

@ -10,7 +10,6 @@
#![feature(optin_builtin_traits)]
trait MarkerTr {}
pub trait Tr {
fn f();
const C: u8;
@ -21,8 +20,6 @@ pub struct S {
}
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 fn f() {} //~ 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 = {
trait MarkerTr {}
pub trait Tr {
fn f();
const C: u8;
@ -50,8 +46,6 @@ const MAIN: 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 fn f() {} //~ ERROR unnecessary visibility qualifier
pub const C: u8 = 0; //~ ERROR unnecessary visibility qualifier
@ -71,7 +65,6 @@ const MAIN: u8 = {
};
fn main() {
trait MarkerTr {}
pub trait Tr {
fn f();
const C: u8;
@ -82,8 +75,6 @@ fn main() {
}
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 fn f() {} //~ 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(specialization)]
trait Foo {}
#[allow(auto_impl)]
impl Foo for .. {}
auto trait Foo {}
impl<T> Foo for T {}
impl !Foo for u8 {} //~ ERROR E0119
trait Bar {}
#[allow(auto_impl)]
impl Bar for .. {}
auto trait Bar {}
impl<T> !Bar for T {}
impl Bar for u8 {} //~ ERROR E0119

View File

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

View File

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

View File

@ -34,9 +34,7 @@
#![feature(optin_builtin_traits)]
trait Magic: Copy {} //~ ERROR E0568
#[allow(auto_impl)]
impl Magic for .. {}
auto trait Magic: Copy {} //~ ERROR E0568
impl<T:Magic> Magic for T {}
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)]
trait MyTrait {}
#[allow(auto_impl)]
impl MyTrait for .. {}
auto trait MyTrait {}
struct MyS;

View File

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

View File

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

View File

@ -10,14 +10,12 @@
// Test that declaring that `&T` is `Defaulted` if `T:Signed` implies
// 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.
#![feature(optin_builtin_traits)]
trait Defaulted { }
#[allow(auto_impl)]
impl Defaulted for .. { }
auto trait Defaulted { }
impl<'a,T:Signed> Defaulted for &'a T { }
impl<'a,T:Signed> Defaulted for &'a mut T { }
fn is_defaulted<T:Defaulted>() { }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -20,10 +20,6 @@ trait DummyTrait {
auto trait AutoDummyTrait {}
//~^ 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 {}
//~^ 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() {}