]> git.lizzy.rs Git - rust.git/commitdiff
Adjust tests for removal of `impl Foo for .. {}`
authorleonardo.yvens <leoyvens@gmail.com>
Sun, 3 Dec 2017 12:56:53 +0000 (10:56 -0200)
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>
Sat, 13 Jan 2018 15:48:00 +0000 (18:48 +0300)
27 files changed:
src/libstd/panic.rs
src/test/compile-fail/auto-impl-future-compat.rs [deleted file]
src/test/compile-fail/auxiliary/tdticc_coherence_lib.rs
src/test/compile-fail/coherence-default-trait-impl.rs
src/test/compile-fail/issue-23080-2.rs
src/test/compile-fail/issue-23080.rs
src/test/compile-fail/phantom-oibit.rs
src/test/compile-fail/privacy-sanity.rs
src/test/compile-fail/specialization/defaultimpl/specialization-no-default-trait-implementations.rs [deleted file]
src/test/compile-fail/specialization/specialization-polarity.rs
src/test/compile-fail/traits-inductive-overflow-supertrait-oibit.rs
src/test/compile-fail/typeck-auto-trait-no-supertraits-2.rs
src/test/compile-fail/typeck-auto-trait-no-supertraits.rs
src/test/compile-fail/typeck-auto-trait-no-typeparams.rs [deleted file]
src/test/compile-fail/typeck-default-trait-impl-constituent-types-2.rs
src/test/compile-fail/typeck-default-trait-impl-constituent-types.rs
src/test/compile-fail/typeck-default-trait-impl-negation.rs
src/test/compile-fail/typeck-default-trait-impl-precedence.rs
src/test/run-make/simd-ffi/simd.rs
src/test/run-make/target-specs/foo.rs
src/test/run-pass/auto-traits.rs
src/test/run-pass/issue-29516.rs
src/test/rustdoc/auxiliary/rustdoc-default-impl.rs
src/test/rustdoc/auxiliary/rustdoc-impl-parts-crosscrate.rs
src/test/rustdoc/impl-parts.rs
src/test/ui/feature-gate-optin-builtin-traits.rs
src/test/ui/typeck-default-trait-impl-outside-crate.rs [deleted file]

index 1be3844e29a1c6ea6b357826275bf1aba451e5ce..53c2211745c328dda26a9d50025525b6c2ee6e19 100644 (file)
 #[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.
 ///
diff --git a/src/test/compile-fail/auto-impl-future-compat.rs b/src/test/compile-fail/auto-impl-future-compat.rs
deleted file mode 100644 (file)
index 5c32a75..0000000
+++ /dev/null
@@ -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
index 1e1c55de87e17aa1ecb57b6fb16c6a796633e8b0..f6f7a250174ba5b2c2b7ded7bd6cea7f506c5eef 100644 (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 }
index 9c26b8b05f259ce1e8c3aa03b62bce48a1a06ff5..a01bc791a45f20fb236bf14c4165384adecdce20 100644 (file)
 
 #![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() {}
index bf44cd53f67dc45bda84c3d1bbd7c25692315da3..0be80f41661eca4191524cf817d0b9b381902862 100644 (file)
 
 #![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() {
index 1fb63391d5608df43db2846b69917f97cbccff97..153b6fd07e6d1832cfcebee72ddb08550cf81e41 100644 (file)
 
 #![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();
 }
index 1c1cb396a54f200e8a50eaa296dd3c30efd6c4c9..52bc0126612bfda94361edbbd70d54ae6d0e0fac 100644 (file)
 
 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 {}
 
index 34082adb8f9a563a82c674d5fbb723f0e849a676..f245b7cef29b9e56f5003408162cd769195d4b5e 100644 (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 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
diff --git a/src/test/compile-fail/specialization/defaultimpl/specialization-no-default-trait-implementations.rs b/src/test/compile-fail/specialization/defaultimpl/specialization-no-default-trait-implementations.rs
deleted file mode 100644 (file)
index cad43ff..0000000
+++ /dev/null
@@ -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() {}
index c97cb3f6bb70b6c47a6d019ae2e21255a7f8137f..b28a63c8293aed1103a399cc9a539c47a73e1f7a 100644 (file)
 #![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
index 6c7928f13f8941f3052c74189e808490d1ca110b..61c504d3e1be330e4c51615426b54df608e4ab44 100644 (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) }
 
index 173582ed22fdc2523f74fbef0296694abf7c5c2b..fa63088d00088028a6e5ae86f7f70f13e892dc42 100644 (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) }
index 6802f72504b7d65adc1457fc8112254c89948f37..c8cf96f52fcf1775f4c3d419ee4d14cc9ee233ee 100644 (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) }
diff --git a/src/test/compile-fail/typeck-auto-trait-no-typeparams.rs b/src/test/compile-fail/typeck-auto-trait-no-typeparams.rs
deleted file mode 100644 (file)
index 3c409d1..0000000
+++ /dev/null
@@ -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 .. {}
index a837d8c9ca74eccf2d989c134f7a5d7ce8a155dd..6e7c9afb6749a8e10fe801a13f38842e96cbeee0 100644 (file)
 
 #![feature(optin_builtin_traits)]
 
-trait MyTrait {}
-
-#[allow(auto_impl)]
-impl MyTrait for .. {}
+auto trait MyTrait {}
 
 struct MyS;
 
index bed184eb4ccca9e70f57e35bae9ccd28692ada6a..4660ecf4fb4b424a11d9dab70381898a59073699 100644 (file)
 
 #![feature(optin_builtin_traits)]
 
-trait MyTrait {}
+auto trait MyTrait {}
 
-#[allow(auto_impl)]
-impl MyTrait for .. {}
 impl<T> !MyTrait for *mut T {}
 
 struct MyS;
index f3a6d8a342e221c7153bc70f7255270f406de7a1..b28cdd8aa2450c74c2b3e14ac1e089a552142851 100644 (file)
 
 #![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;
 
index bdd6487b86d74ea65de8026a350697aac56717b3..d63d70bad2204e9db7dbcc71b3116c360b697b26 100644 (file)
 
 // 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>() { }
index 185476fb704f7fe4176766abe11d54c7c3e2025d..94b91c711cce0d9c7bebb69ef8b7a7c5383d3276 100644 (file)
@@ -80,6 +80,4 @@ pub mod marker {
 }
 
 #[lang = "freeze"]
-trait Freeze {}
-#[allow(auto_impl)]
-impl Freeze for .. {}
+auto trait Freeze {}
index a0feb72702834e74eed0166eaeab601f322cbfd3..bbd1c5d900fafbc99088c7294106583a57f979aa 100644 (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 }
index e42aca9ccbd1378c29cff2e7c80765e2237b5e88..2511488c94ee84ebbc115c56472e673fedc96a9a 100644 (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 {}
 
index 5fa0a002a10db9071c31f3f4418bda4ffccbc959..465986583b15560d3edb575faddfb31ebaf19592 100644 (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 {}
index 4fd55bd482cd998029fb89eb2dcd477d999414c3..34a1331353dca96d1259937dd9d06caaf520ecc7 100644 (file)
 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) {}
index d886778278dfd3dd86a35bc16c5096961eaca876..977d98ca87b10b4cb9fcde1692edd9f3c7e0af79 100644 (file)
@@ -10,7 +10,4 @@
 
 #![feature(optin_builtin_traits)]
 
-pub trait AnOibit {}
-
-#[allow(auto_impl)]
-impl AnOibit for .. {}
+pub auto trait AnOibit {}
index f74f66ce7290551849082781c0f7184313d6e956..6e472da379c592546b392de66a2917f113cbb4fd 100644 (file)
 
 #![feature(optin_builtin_traits)]
 
-pub trait AnOibit {}
-
-#[allow(auto_impl)]
-impl AnOibit for .. {}
+pub auto trait AnOibit {}
 
 pub struct Foo<T> { field: T }
 
index 4c5502cec18a851ff4c7d25cb6e07c17dab1f9ea..ab3313af16d5d6b325a70539cfbeb82899d3aad3 100644 (file)
@@ -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
 
diff --git a/src/test/ui/typeck-default-trait-impl-outside-crate.rs b/src/test/ui/typeck-default-trait-impl-outside-crate.rs
deleted file mode 100644 (file)
index ff0446e..0000000
+++ /dev/null
@@ -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() {}