Adjust tests for removal of impl Foo for .. {}
This commit is contained in:
parent
f93183adb4
commit
02b5fee732
27 changed files with 30 additions and 169 deletions
|
|
@ -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
|
||||
|
|
@ -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 {}
|
||||
|
||||
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() {}
|
||||
|
|
|
|||
|
|
@ -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 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
|
||||
|
|
|
|||
|
|
@ -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() {}
|
||||
|
|
@ -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) }
|
||||
|
|
|
|||
|
|
@ -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 .. {}
|
||||
|
|
@ -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>() { }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue