about summary refs log tree commit diff
path: root/src/test/ui/impl-trait
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-11-08 16:50:33 +0100
committerGitHub <noreply@github.com>2019-11-08 16:50:33 +0100
commit7ab50e40063a5f11aec148f59ad4d32e2a13fd70 (patch)
tree5450ddc2785c74a9a373a0d5a92182d20d8551d8 /src/test/ui/impl-trait
parent76ade3e8ac42cd7a7b7c3c5ef54818ab68e3ebdc (diff)
parent574d2b83a16dbbe975bbb3cf2ed541563a2f756c (diff)
downloadrust-7ab50e40063a5f11aec148f59ad4d32e2a13fd70.tar.gz
rust-7ab50e40063a5f11aec148f59ad4d32e2a13fd70.zip
Rollup merge of #65785 - Centril:compat-to-error-2, r=oli-obk
Transition future compat lints to {ERROR, DENY} - Take 2

Follow up to https://github.com/rust-lang/rust/pull/63247 implementing https://github.com/rust-lang/rust/pull/63247#issuecomment-536295992.

- `legacy_ctor_visibility` (ERROR) -- closes #39207
- `legacy_directory_ownership` (ERROR) -- closes #37872
- `safe_extern_static` (ERROR) -- closes #36247
- `parenthesized_params_in_types_and_modules` (ERROR) -- closes #42238
- `duplicate_macro_exports` (ERROR)
- `nested_impl_trait` (ERROR) -- closes #59014
- `ill_formed_attribute_input` (DENY) -- transitions #57571
- `patterns_in_fns_without_body` (DENY) -- transitions #35203

r? @varkor
cc @petrochenkov
Diffstat (limited to 'src/test/ui/impl-trait')
-rw-r--r--src/test/ui/impl-trait/issues/issue-57979-deeply-nested-impl-trait-in-assoc-proj.rs37
-rw-r--r--src/test/ui/impl-trait/issues/issue-57979-deeply-nested-impl-trait-in-assoc-proj.stderr32
-rw-r--r--src/test/ui/impl-trait/issues/issue-57979-impl-trait-in-path.rs35
-rw-r--r--src/test/ui/impl-trait/issues/issue-57979-impl-trait-in-path.stderr30
-rw-r--r--src/test/ui/impl-trait/issues/issue-57979-nested-impl-trait-in-assoc-proj.rs35
-rw-r--r--src/test/ui/impl-trait/issues/issue-57979-nested-impl-trait-in-assoc-proj.stderr42
6 files changed, 36 insertions, 175 deletions
diff --git a/src/test/ui/impl-trait/issues/issue-57979-deeply-nested-impl-trait-in-assoc-proj.rs b/src/test/ui/impl-trait/issues/issue-57979-deeply-nested-impl-trait-in-assoc-proj.rs
index 5eef6a39325..0daec3305c0 100644
--- a/src/test/ui/impl-trait/issues/issue-57979-deeply-nested-impl-trait-in-assoc-proj.rs
+++ b/src/test/ui/impl-trait/issues/issue-57979-deeply-nested-impl-trait-in-assoc-proj.rs
@@ -1,42 +1,17 @@
 // rust-lang/rust#57979 : the initial support for `impl Trait` didn't
 // properly check syntax hidden behind an associated type projection,
 // but it did catch *some cases*. This is checking that we continue to
-// properly emit errors for those, even with the new
-// future-incompatibility warnings.
+// properly emit errors for those.
 //
 // issue-57979-nested-impl-trait-in-assoc-proj.rs shows the main case
 // that we were previously failing to catch.
 
 struct Deeper<T>(T);
 
-mod allowed {
-    #![allow(nested_impl_trait)]
-
-    pub trait Foo<T> { }
-    pub trait Bar { }
-    pub trait Quux { type Assoc; }
-    pub fn demo(_: impl Quux<Assoc=super::Deeper<impl Foo<impl Bar>>>) { }
-    //~^ ERROR nested `impl Trait` is not allowed
-}
-
-mod warned {
-    #![warn(nested_impl_trait)]
-
-    pub trait Foo<T> { }
-    pub trait Bar { }
-    pub trait Quux { type Assoc; }
-    pub fn demo(_: impl Quux<Assoc=super::Deeper<impl Foo<impl Bar>>>) { }
-    //~^ ERROR nested `impl Trait` is not allowed
-}
-
-mod denied {
-    #![deny(nested_impl_trait)]
-
-    pub trait Foo<T> { }
-    pub trait Bar { }
-    pub trait Quux { type Assoc; }
-    pub fn demo(_: impl Quux<Assoc=super::Deeper<impl Foo<impl Bar>>>) { }
-    //~^ ERROR nested `impl Trait` is not allowed
-}
+pub trait Foo<T> { }
+pub trait Bar { }
+pub trait Quux { type Assoc; }
+pub fn demo(_: impl Quux<Assoc=Deeper<impl Foo<impl Bar>>>) { }
+//~^ ERROR nested `impl Trait` is not allowed
 
 fn main() { }
diff --git a/src/test/ui/impl-trait/issues/issue-57979-deeply-nested-impl-trait-in-assoc-proj.stderr b/src/test/ui/impl-trait/issues/issue-57979-deeply-nested-impl-trait-in-assoc-proj.stderr
index 2b6f15e6d3e..6bebbc01f3d 100644
--- a/src/test/ui/impl-trait/issues/issue-57979-deeply-nested-impl-trait-in-assoc-proj.stderr
+++ b/src/test/ui/impl-trait/issues/issue-57979-deeply-nested-impl-trait-in-assoc-proj.stderr
@@ -1,30 +1,12 @@
 error[E0666]: nested `impl Trait` is not allowed
-  --> $DIR/issue-57979-deeply-nested-impl-trait-in-assoc-proj.rs:18:59
+  --> $DIR/issue-57979-deeply-nested-impl-trait-in-assoc-proj.rs:14:48
    |
-LL |     pub fn demo(_: impl Quux<Assoc=super::Deeper<impl Foo<impl Bar>>>) { }
-   |                                                  ---------^^^^^^^^-
-   |                                                  |        |
-   |                                                  |        nested `impl Trait` here
-   |                                                  outer `impl Trait`
+LL | pub fn demo(_: impl Quux<Assoc=Deeper<impl Foo<impl Bar>>>) { }
+   |                                       ---------^^^^^^^^-
+   |                                       |        |
+   |                                       |        nested `impl Trait` here
+   |                                       outer `impl Trait`
 
-error[E0666]: nested `impl Trait` is not allowed
-  --> $DIR/issue-57979-deeply-nested-impl-trait-in-assoc-proj.rs:28:59
-   |
-LL |     pub fn demo(_: impl Quux<Assoc=super::Deeper<impl Foo<impl Bar>>>) { }
-   |                                                  ---------^^^^^^^^-
-   |                                                  |        |
-   |                                                  |        nested `impl Trait` here
-   |                                                  outer `impl Trait`
-
-error[E0666]: nested `impl Trait` is not allowed
-  --> $DIR/issue-57979-deeply-nested-impl-trait-in-assoc-proj.rs:38:59
-   |
-LL |     pub fn demo(_: impl Quux<Assoc=super::Deeper<impl Foo<impl Bar>>>) { }
-   |                                                  ---------^^^^^^^^-
-   |                                                  |        |
-   |                                                  |        nested `impl Trait` here
-   |                                                  outer `impl Trait`
-
-error: aborting due to 3 previous errors
+error: aborting due to previous error
 
 For more information about this error, try `rustc --explain E0666`.
diff --git a/src/test/ui/impl-trait/issues/issue-57979-impl-trait-in-path.rs b/src/test/ui/impl-trait/issues/issue-57979-impl-trait-in-path.rs
index 84fcb5e2880..c5ecd1caae1 100644
--- a/src/test/ui/impl-trait/issues/issue-57979-impl-trait-in-path.rs
+++ b/src/test/ui/impl-trait/issues/issue-57979-impl-trait-in-path.rs
@@ -3,35 +3,10 @@
 // Here we test behavior of occurrences of `impl Trait` within a path
 // component in that context.
 
-mod allowed {
-    #![allow(nested_impl_trait)]
-
-    pub trait Bar { }
-    pub trait Quux<T> { type Assoc; }
-    pub fn demo(_: impl Quux<(), Assoc=<() as Quux<impl Bar>>::Assoc>) { }
-    impl<T> Quux<T> for () { type Assoc = u32; }
-}
-
-mod warned {
-    #![warn(nested_impl_trait)]
-
-    pub trait Bar { }
-    pub trait Quux<T> { type Assoc; }
-    pub fn demo(_: impl Quux<(), Assoc=<() as Quux<impl Bar>>::Assoc>) { }
-    //~^ WARN `impl Trait` is not allowed in path parameters
-    //~| WARN will become a hard error in a future release!
-    impl<T> Quux<T> for () { type Assoc = u32; }
-}
-
-mod denied {
-    #![deny(nested_impl_trait)]
-
-    pub trait Bar { }
-    pub trait Quux<T> { type Assoc; }
-    pub fn demo(_: impl Quux<(), Assoc=<() as Quux<impl Bar>>::Assoc>) { }
-    //~^ ERROR `impl Trait` is not allowed in path parameters
-    //~| WARN will become a hard error in a future release!
-    impl<T> Quux<T> for () { type Assoc = u32; }
-}
+pub trait Bar { }
+pub trait Quux<T> { type Assoc; }
+pub fn demo(_: impl Quux<(), Assoc=<() as Quux<impl Bar>>::Assoc>) { }
+//~^ ERROR `impl Trait` is not allowed in path parameters
+impl<T> Quux<T> for () { type Assoc = u32; }
 
 fn main() { }
diff --git a/src/test/ui/impl-trait/issues/issue-57979-impl-trait-in-path.stderr b/src/test/ui/impl-trait/issues/issue-57979-impl-trait-in-path.stderr
index 982ecba291f..f64545d83b8 100644
--- a/src/test/ui/impl-trait/issues/issue-57979-impl-trait-in-path.stderr
+++ b/src/test/ui/impl-trait/issues/issue-57979-impl-trait-in-path.stderr
@@ -1,30 +1,8 @@
-warning: `impl Trait` is not allowed in path parameters
-  --> $DIR/issue-57979-impl-trait-in-path.rs:20:52
+error[E0667]: `impl Trait` is not allowed in path parameters
+  --> $DIR/issue-57979-impl-trait-in-path.rs:8:48
    |
-LL |     pub fn demo(_: impl Quux<(), Assoc=<() as Quux<impl Bar>>::Assoc>) { }
-   |                                                    ^^^^^^^^
-   |
-note: lint level defined here
-  --> $DIR/issue-57979-impl-trait-in-path.rs:16:13
-   |
-LL |     #![warn(nested_impl_trait)]
-   |             ^^^^^^^^^^^^^^^^^
-   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
-   = note: for more information, see issue #59014 <https://github.com/rust-lang/rust/issues/59014>
-
-error: `impl Trait` is not allowed in path parameters
-  --> $DIR/issue-57979-impl-trait-in-path.rs:31:52
-   |
-LL |     pub fn demo(_: impl Quux<(), Assoc=<() as Quux<impl Bar>>::Assoc>) { }
-   |                                                    ^^^^^^^^
-   |
-note: lint level defined here
-  --> $DIR/issue-57979-impl-trait-in-path.rs:27:13
-   |
-LL |     #![deny(nested_impl_trait)]
-   |             ^^^^^^^^^^^^^^^^^
-   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
-   = note: for more information, see issue #59014 <https://github.com/rust-lang/rust/issues/59014>
+LL | pub fn demo(_: impl Quux<(), Assoc=<() as Quux<impl Bar>>::Assoc>) { }
+   |                                                ^^^^^^^^
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/impl-trait/issues/issue-57979-nested-impl-trait-in-assoc-proj.rs b/src/test/ui/impl-trait/issues/issue-57979-nested-impl-trait-in-assoc-proj.rs
index 5c20ffc7c67..5a444d3dfdd 100644
--- a/src/test/ui/impl-trait/issues/issue-57979-nested-impl-trait-in-assoc-proj.rs
+++ b/src/test/ui/impl-trait/issues/issue-57979-nested-impl-trait-in-assoc-proj.rs
@@ -3,35 +3,10 @@
 // Here we test behavior of occurrences of `impl Trait` within an
 // `impl Trait` in that context.
 
-mod allowed {
-    #![allow(nested_impl_trait)]
-
-    pub trait Foo<T> { }
-    pub trait Bar { }
-    pub trait Quux { type Assoc; }
-    pub fn demo(_: impl Quux<Assoc=impl Foo<impl Bar>>) { }
-}
-
-mod warned {
-    #![warn(nested_impl_trait)]
-
-    pub trait Foo<T> { }
-    pub trait Bar { }
-    pub trait Quux { type Assoc; }
-    pub fn demo(_: impl Quux<Assoc=impl Foo<impl Bar>>) { }
-    //~^ WARN nested `impl Trait` is not allowed
-    //~| WARN will become a hard error in a future release!
-}
-
-mod denied {
-    #![deny(nested_impl_trait)]
-
-    pub trait Foo<T> { }
-    pub trait Bar { }
-    pub trait Quux { type Assoc; }
-    pub fn demo(_: impl Quux<Assoc=impl Foo<impl Bar>>) { }
-    //~^ ERROR nested `impl Trait` is not allowed
-    //~| WARN will become a hard error in a future release!
-}
+pub trait Foo<T> { }
+pub trait Bar { }
+pub trait Quux { type Assoc; }
+pub fn demo(_: impl Quux<Assoc=impl Foo<impl Bar>>) { }
+//~^ ERROR nested `impl Trait` is not allowed
 
 fn main() { }
diff --git a/src/test/ui/impl-trait/issues/issue-57979-nested-impl-trait-in-assoc-proj.stderr b/src/test/ui/impl-trait/issues/issue-57979-nested-impl-trait-in-assoc-proj.stderr
index 508aea24321..8d3d4b5e206 100644
--- a/src/test/ui/impl-trait/issues/issue-57979-nested-impl-trait-in-assoc-proj.stderr
+++ b/src/test/ui/impl-trait/issues/issue-57979-nested-impl-trait-in-assoc-proj.stderr
@@ -1,36 +1,12 @@
-warning: nested `impl Trait` is not allowed
-  --> $DIR/issue-57979-nested-impl-trait-in-assoc-proj.rs:21:45
-   |
-LL |     pub fn demo(_: impl Quux<Assoc=impl Foo<impl Bar>>) { }
-   |                                    ---------^^^^^^^^-
-   |                                    |        |
-   |                                    |        nested `impl Trait` here
-   |                                    outer `impl Trait`
-   |
-note: lint level defined here
-  --> $DIR/issue-57979-nested-impl-trait-in-assoc-proj.rs:16:13
-   |
-LL |     #![warn(nested_impl_trait)]
-   |             ^^^^^^^^^^^^^^^^^
-   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
-   = note: for more information, see issue #59014 <https://github.com/rust-lang/rust/issues/59014>
-
-error: nested `impl Trait` is not allowed
-  --> $DIR/issue-57979-nested-impl-trait-in-assoc-proj.rs:32:45
-   |
-LL |     pub fn demo(_: impl Quux<Assoc=impl Foo<impl Bar>>) { }
-   |                                    ---------^^^^^^^^-
-   |                                    |        |
-   |                                    |        nested `impl Trait` here
-   |                                    outer `impl Trait`
-   |
-note: lint level defined here
-  --> $DIR/issue-57979-nested-impl-trait-in-assoc-proj.rs:27:13
-   |
-LL |     #![deny(nested_impl_trait)]
-   |             ^^^^^^^^^^^^^^^^^
-   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
-   = note: for more information, see issue #59014 <https://github.com/rust-lang/rust/issues/59014>
+error[E0666]: nested `impl Trait` is not allowed
+  --> $DIR/issue-57979-nested-impl-trait-in-assoc-proj.rs:9:41
+   |
+LL | pub fn demo(_: impl Quux<Assoc=impl Foo<impl Bar>>) { }
+   |                                ---------^^^^^^^^-
+   |                                |        |
+   |                                |        nested `impl Trait` here
+   |                                outer `impl Trait`
 
 error: aborting due to previous error
 
+For more information about this error, try `rustc --explain E0666`.