提交 02b5fee7 编写于 作者: L leonardo.yvens 提交者: Vadim Petrochenkov

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

上级 f93183ad
......@@ -101,7 +101,7 @@
#[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.
///
......
// 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
......@@ -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 }
......@@ -10,25 +10,18 @@
#![feature(optin_builtin_traits)]
trait MyTrait { fn foo() {} }
auto trait MySafeTrait {}
#[allow(auto_impl)]
impl MyTrait for .. {}
//~^ ERROR redundant auto implementations of trait `MyTrait`
#[allow(auto_impl)]
impl MyTrait for .. {}
trait MySafeTrait {}
struct Foo;
#[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() {}
......@@ -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() {
......
......@@ -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();
}
......
......@@ -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 {}
......
......@@ -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 fn f() {}
}
const MAIN: u8 = {
trait MarkerTr {}
pub trait Tr {
fn f();
const C: u8;
......@@ -50,8 +46,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
......@@ -71,7 +65,6 @@ pub fn f() {}
};
fn main() {
trait MarkerTr {}
pub trait Tr {
fn f();
const C: u8;
......@@ -82,8 +75,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
......
// 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() {}
......@@ -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
......
......@@ -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) }
......
......@@ -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) }
......
......@@ -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) }
......
// 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 .. {}
......@@ -10,10 +10,7 @@
#![feature(optin_builtin_traits)]
trait MyTrait {}
#[allow(auto_impl)]
impl MyTrait for .. {}
auto trait MyTrait {}
struct MyS;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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>() { }
......
......@@ -80,6 +80,4 @@ pub mod marker {
}
#[lang = "freeze"]
trait Freeze {}
#[allow(auto_impl)]
impl Freeze for .. {}
auto trait Freeze {}
......@@ -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 }
......
......@@ -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 {}
......
......@@ -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 {}
......
......@@ -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) {}
......
......@@ -10,7 +10,4 @@
#![feature(optin_builtin_traits)]
pub trait AnOibit {}
#[allow(auto_impl)]
impl AnOibit for .. {}
pub auto trait AnOibit {}
......@@ -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 }
......
......@@ -20,10 +20,6 @@ fn dummy(&self) {}
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
......
// 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() {}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册