about summary refs log tree commit diff
path: root/src/test/ui/impl-trait
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/impl-trait')
-rw-r--r--src/test/ui/impl-trait/issues/issue-83929-impl-trait-in-generic-default.rs4
-rw-r--r--src/test/ui/impl-trait/issues/issue-83929-impl-trait-in-generic-default.stderr4
-rw-r--r--src/test/ui/impl-trait/nested_impl_trait.stderr4
-rw-r--r--src/test/ui/impl-trait/where-allowed.rs82
-rw-r--r--src/test/ui/impl-trait/where-allowed.stderr82
5 files changed, 88 insertions, 88 deletions
diff --git a/src/test/ui/impl-trait/issues/issue-83929-impl-trait-in-generic-default.rs b/src/test/ui/impl-trait/issues/issue-83929-impl-trait-in-generic-default.rs
index d9d2e3929b1..773cd0b81cc 100644
--- a/src/test/ui/impl-trait/issues/issue-83929-impl-trait-in-generic-default.rs
+++ b/src/test/ui/impl-trait/issues/issue-83929-impl-trait-in-generic-default.rs
@@ -1,8 +1,8 @@
 struct Foo<T = impl Copy>(T);
-//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+//~^ ERROR `impl Trait` not allowed outside of function and method return types
 
 type Result<T, E = impl std::error::Error> = std::result::Result<T, E>;
-//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+//~^ ERROR `impl Trait` not allowed outside of function and method return types
 
 // should not cause ICE
 fn x() -> Foo {
diff --git a/src/test/ui/impl-trait/issues/issue-83929-impl-trait-in-generic-default.stderr b/src/test/ui/impl-trait/issues/issue-83929-impl-trait-in-generic-default.stderr
index eef6844adfc..d44dcf1f7fa 100644
--- a/src/test/ui/impl-trait/issues/issue-83929-impl-trait-in-generic-default.stderr
+++ b/src/test/ui/impl-trait/issues/issue-83929-impl-trait-in-generic-default.stderr
@@ -1,10 +1,10 @@
-error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+error[E0562]: `impl Trait` not allowed outside of function and method return types
   --> $DIR/issue-83929-impl-trait-in-generic-default.rs:1:16
    |
 LL | struct Foo<T = impl Copy>(T);
    |                ^^^^^^^^^
 
-error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+error[E0562]: `impl Trait` not allowed outside of function and method return types
   --> $DIR/issue-83929-impl-trait-in-generic-default.rs:4:20
    |
 LL | type Result<T, E = impl std::error::Error> = std::result::Result<T, E>;
diff --git a/src/test/ui/impl-trait/nested_impl_trait.stderr b/src/test/ui/impl-trait/nested_impl_trait.stderr
index 3749c268a68..59c7e4d5f4e 100644
--- a/src/test/ui/impl-trait/nested_impl_trait.stderr
+++ b/src/test/ui/impl-trait/nested_impl_trait.stderr
@@ -34,13 +34,13 @@ LL |     fn bad(x: impl Into<u32>) -> impl Into<impl Debug> { x }
    |                                  |         nested `impl Trait` here
    |                                  outer `impl Trait`
 
-error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+error[E0562]: `impl Trait` not allowed outside of function and method return types
   --> $DIR/nested_impl_trait.rs:8:32
    |
 LL | fn bad_in_fn_syntax(x: fn() -> impl Into<impl Debug>) {}
    |                                ^^^^^^^^^^^^^^^^^^^^^
 
-error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+error[E0562]: `impl Trait` not allowed outside of function and method return types
   --> $DIR/nested_impl_trait.rs:25:42
    |
 LL | fn allowed_in_ret_type() -> impl Fn() -> impl Into<u32> {
diff --git a/src/test/ui/impl-trait/where-allowed.rs b/src/test/ui/impl-trait/where-allowed.rs
index c3e21c81f03..4605e76ac96 100644
--- a/src/test/ui/impl-trait/where-allowed.rs
+++ b/src/test/ui/impl-trait/where-allowed.rs
@@ -13,61 +13,61 @@ fn in_adt_in_parameters(_: Vec<impl Debug>) { panic!() }
 
 // Disallowed
 fn in_fn_parameter_in_parameters(_: fn(impl Debug)) { panic!() }
-//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+//~^ ERROR `impl Trait` not allowed outside of function and method return types
 
 // Disallowed
 fn in_fn_return_in_parameters(_: fn() -> impl Debug) { panic!() }
-//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+//~^ ERROR `impl Trait` not allowed outside of function and method return types
 
 // Disallowed
 fn in_fn_parameter_in_return() -> fn(impl Debug) { panic!() }
-//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+//~^ ERROR `impl Trait` not allowed outside of function and method return types
 
 // Disallowed
 fn in_fn_return_in_return() -> fn() -> impl Debug { panic!() }
-//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+//~^ ERROR `impl Trait` not allowed outside of function and method return types
 
 // Disallowed
 fn in_dyn_Fn_parameter_in_parameters(_: &dyn Fn(impl Debug)) { panic!() }
-//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+//~^ ERROR `impl Trait` not allowed outside of function and method return types
 
 // Disallowed
 fn in_dyn_Fn_return_in_parameters(_: &dyn Fn() -> impl Debug) { panic!() }
-//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+//~^ ERROR `impl Trait` not allowed outside of function and method return types
 
 // Disallowed
 fn in_dyn_Fn_parameter_in_return() -> &'static dyn Fn(impl Debug) { panic!() }
-//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+//~^ ERROR `impl Trait` not allowed outside of function and method return types
 
 // Disallowed
 fn in_dyn_Fn_return_in_return() -> &'static dyn Fn() -> impl Debug { panic!() }
-//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+//~^ ERROR `impl Trait` not allowed outside of function and method return types
 
 // Disallowed
 fn in_impl_Fn_parameter_in_parameters(_: &impl Fn(impl Debug)) { panic!() }
-//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+//~^ ERROR `impl Trait` not allowed outside of function and method return types
 //~^^ ERROR nested `impl Trait` is not allowed
 
 // Disallowed
 fn in_impl_Fn_return_in_parameters(_: &impl Fn() -> impl Debug) { panic!() }
-//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+//~^ ERROR `impl Trait` not allowed outside of function and method return types
 
 // Disallowed
 fn in_impl_Fn_parameter_in_return() -> &'static impl Fn(impl Debug) { panic!() }
-//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+//~^ ERROR `impl Trait` not allowed outside of function and method return types
 //~| ERROR nested `impl Trait` is not allowed
 
 // Disallowed
 fn in_impl_Fn_return_in_return() -> &'static impl Fn() -> impl Debug { panic!() }
-//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+//~^ ERROR `impl Trait` not allowed outside of function and method return types
 
 // Disallowed
 fn in_Fn_parameter_in_generics<F: Fn(impl Debug)> (_: F) { panic!() }
-//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+//~^ ERROR `impl Trait` not allowed outside of function and method return types
 
 // Disallowed
 fn in_Fn_return_in_generics<F: Fn() -> impl Debug> (_: F) { panic!() }
-//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+//~^ ERROR `impl Trait` not allowed outside of function and method return types
 
 
 // Allowed
@@ -80,22 +80,22 @@ fn in_impl_Trait_in_return() -> impl IntoIterator<Item = impl IntoIterator> {
 
 // Disallowed
 struct InBraceStructField { x: impl Debug }
-//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+//~^ ERROR `impl Trait` not allowed outside of function and method return types
 
 // Disallowed
 struct InAdtInBraceStructField { x: Vec<impl Debug> }
-//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+//~^ ERROR `impl Trait` not allowed outside of function and method return types
 
 // Disallowed
 struct InTupleStructField(impl Debug);
-//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+//~^ ERROR `impl Trait` not allowed outside of function and method return types
 
 // Disallowed
 enum InEnum {
     InBraceVariant { x: impl Debug },
-    //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+    //~^ ERROR `impl Trait` not allowed outside of function and method return types
     InTupleVariant(impl Debug),
-    //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+    //~^ ERROR `impl Trait` not allowed outside of function and method return types
 }
 
 // Allowed
@@ -106,7 +106,7 @@ trait InTraitDefnParameters {
 // Disallowed
 trait InTraitDefnReturn {
     fn in_return() -> impl Debug;
-    //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+    //~^ ERROR `impl Trait` not allowed outside of function and method return types
 }
 
 // Allowed and disallowed in trait impls
@@ -123,7 +123,7 @@ impl DummyTrait for () {
     // Allowed
 
     fn in_trait_impl_return() -> impl Debug { () }
-    //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+    //~^ ERROR `impl Trait` not allowed outside of function and method return types
 }
 
 // Allowed
@@ -136,10 +136,10 @@ impl DummyType {
 // Disallowed
 extern "C" {
     fn in_foreign_parameters(_: impl Debug);
-    //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+    //~^ ERROR `impl Trait` not allowed outside of function and method return types
 
     fn in_foreign_return() -> impl Debug;
-    //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+    //~^ ERROR `impl Trait` not allowed outside of function and method return types
 }
 
 // Allowed
@@ -155,96 +155,96 @@ type InTypeAlias<R> = impl Debug;
 //~^ ERROR `impl Trait` in type aliases is unstable
 
 type InReturnInTypeAlias<R> = fn() -> impl Debug;
-//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+//~^ ERROR `impl Trait` not allowed outside of function and method return types
 //~| ERROR `impl Trait` in type aliases is unstable
 
 // Disallowed in impl headers
 impl PartialEq<impl Debug> for () {
-    //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+    //~^ ERROR `impl Trait` not allowed outside of function and method return types
 }
 
 // Disallowed in impl headers
 impl PartialEq<()> for impl Debug {
-    //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+    //~^ ERROR `impl Trait` not allowed outside of function and method return types
 }
 
 // Disallowed in inherent impls
 impl impl Debug {
-    //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+    //~^ ERROR `impl Trait` not allowed outside of function and method return types
 }
 
 // Disallowed in inherent impls
 struct InInherentImplAdt<T> { t: T }
 impl InInherentImplAdt<impl Debug> {
-    //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+    //~^ ERROR `impl Trait` not allowed outside of function and method return types
 }
 
 // Disallowed in where clauses
 fn in_fn_where_clause()
     where impl Debug: Debug
-//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+//~^ ERROR `impl Trait` not allowed outside of function and method return types
 {
 }
 
 // Disallowed in where clauses
 fn in_adt_in_fn_where_clause()
     where Vec<impl Debug>: Debug
-//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+//~^ ERROR `impl Trait` not allowed outside of function and method return types
 {
 }
 
 // Disallowed
 fn in_trait_parameter_in_fn_where_clause<T>()
     where T: PartialEq<impl Debug>
-//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+//~^ ERROR `impl Trait` not allowed outside of function and method return types
 {
 }
 
 // Disallowed
 fn in_Fn_parameter_in_fn_where_clause<T>()
     where T: Fn(impl Debug)
-//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+//~^ ERROR `impl Trait` not allowed outside of function and method return types
 {
 }
 
 // Disallowed
 fn in_Fn_return_in_fn_where_clause<T>()
     where T: Fn() -> impl Debug
-//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+//~^ ERROR `impl Trait` not allowed outside of function and method return types
 {
 }
 
 // Disallowed
 struct InStructGenericParamDefault<T = impl Debug>(T);
-//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+//~^ ERROR `impl Trait` not allowed outside of function and method return types
 
 // Disallowed
 enum InEnumGenericParamDefault<T = impl Debug> { Variant(T) }
-//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+//~^ ERROR `impl Trait` not allowed outside of function and method return types
 
 // Disallowed
 trait InTraitGenericParamDefault<T = impl Debug> {}
-//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+//~^ ERROR `impl Trait` not allowed outside of function and method return types
 
 // Disallowed
 type InTypeAliasGenericParamDefault<T = impl Debug> = T;
-//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+//~^ ERROR `impl Trait` not allowed outside of function and method return types
 
 // Disallowed
 impl <T = impl Debug> T {}
 //~^ ERROR defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
 //~| WARNING this was previously accepted by the compiler but is being phased out
-//~| ERROR `impl Trait` not allowed outside of function and inherent method return types
+//~| ERROR `impl Trait` not allowed outside of function and method return types
 
 // Disallowed
 fn in_method_generic_param_default<T = impl Debug>(_: T) {}
 //~^ ERROR defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
 //~| WARNING this was previously accepted by the compiler but is being phased out
-//~| ERROR `impl Trait` not allowed outside of function and inherent method return types
+//~| ERROR `impl Trait` not allowed outside of function and method return types
 
 fn main() {
     let _in_local_variable: impl Fn() = || {};
-    //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+    //~^ ERROR `impl Trait` not allowed outside of function and method return types
     let _in_return_in_local_variable = || -> impl Fn() { || {} };
-    //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+    //~^ ERROR `impl Trait` not allowed outside of function and method return types
 }
diff --git a/src/test/ui/impl-trait/where-allowed.stderr b/src/test/ui/impl-trait/where-allowed.stderr
index 32389048148..93a3de61ccf 100644
--- a/src/test/ui/impl-trait/where-allowed.stderr
+++ b/src/test/ui/impl-trait/where-allowed.stderr
@@ -43,247 +43,247 @@ LL | type InReturnInTypeAlias<R> = fn() -> impl Debug;
    = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
    = help: add `#![feature(min_type_alias_impl_trait)]` to the crate attributes to enable
 
-error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+error[E0562]: `impl Trait` not allowed outside of function and method return types
   --> $DIR/where-allowed.rs:15:40
    |
 LL | fn in_fn_parameter_in_parameters(_: fn(impl Debug)) { panic!() }
    |                                        ^^^^^^^^^^
 
-error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+error[E0562]: `impl Trait` not allowed outside of function and method return types
   --> $DIR/where-allowed.rs:19:42
    |
 LL | fn in_fn_return_in_parameters(_: fn() -> impl Debug) { panic!() }
    |                                          ^^^^^^^^^^
 
-error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+error[E0562]: `impl Trait` not allowed outside of function and method return types
   --> $DIR/where-allowed.rs:23:38
    |
 LL | fn in_fn_parameter_in_return() -> fn(impl Debug) { panic!() }
    |                                      ^^^^^^^^^^
 
-error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+error[E0562]: `impl Trait` not allowed outside of function and method return types
   --> $DIR/where-allowed.rs:27:40
    |
 LL | fn in_fn_return_in_return() -> fn() -> impl Debug { panic!() }
    |                                        ^^^^^^^^^^
 
-error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+error[E0562]: `impl Trait` not allowed outside of function and method return types
   --> $DIR/where-allowed.rs:31:49
    |
 LL | fn in_dyn_Fn_parameter_in_parameters(_: &dyn Fn(impl Debug)) { panic!() }
    |                                                 ^^^^^^^^^^
 
-error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+error[E0562]: `impl Trait` not allowed outside of function and method return types
   --> $DIR/where-allowed.rs:35:51
    |
 LL | fn in_dyn_Fn_return_in_parameters(_: &dyn Fn() -> impl Debug) { panic!() }
    |                                                   ^^^^^^^^^^
 
-error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+error[E0562]: `impl Trait` not allowed outside of function and method return types
   --> $DIR/where-allowed.rs:39:55
    |
 LL | fn in_dyn_Fn_parameter_in_return() -> &'static dyn Fn(impl Debug) { panic!() }
    |                                                       ^^^^^^^^^^
 
-error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+error[E0562]: `impl Trait` not allowed outside of function and method return types
   --> $DIR/where-allowed.rs:43:57
    |
 LL | fn in_dyn_Fn_return_in_return() -> &'static dyn Fn() -> impl Debug { panic!() }
    |                                                         ^^^^^^^^^^
 
-error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+error[E0562]: `impl Trait` not allowed outside of function and method return types
   --> $DIR/where-allowed.rs:47:51
    |
 LL | fn in_impl_Fn_parameter_in_parameters(_: &impl Fn(impl Debug)) { panic!() }
    |                                                   ^^^^^^^^^^
 
-error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+error[E0562]: `impl Trait` not allowed outside of function and method return types
   --> $DIR/where-allowed.rs:52:53
    |
 LL | fn in_impl_Fn_return_in_parameters(_: &impl Fn() -> impl Debug) { panic!() }
    |                                                     ^^^^^^^^^^
 
-error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+error[E0562]: `impl Trait` not allowed outside of function and method return types
   --> $DIR/where-allowed.rs:56:57
    |
 LL | fn in_impl_Fn_parameter_in_return() -> &'static impl Fn(impl Debug) { panic!() }
    |                                                         ^^^^^^^^^^
 
-error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+error[E0562]: `impl Trait` not allowed outside of function and method return types
   --> $DIR/where-allowed.rs:61:59
    |
 LL | fn in_impl_Fn_return_in_return() -> &'static impl Fn() -> impl Debug { panic!() }
    |                                                           ^^^^^^^^^^
 
-error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+error[E0562]: `impl Trait` not allowed outside of function and method return types
   --> $DIR/where-allowed.rs:65:38
    |
 LL | fn in_Fn_parameter_in_generics<F: Fn(impl Debug)> (_: F) { panic!() }
    |                                      ^^^^^^^^^^
 
-error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+error[E0562]: `impl Trait` not allowed outside of function and method return types
   --> $DIR/where-allowed.rs:69:40
    |
 LL | fn in_Fn_return_in_generics<F: Fn() -> impl Debug> (_: F) { panic!() }
    |                                        ^^^^^^^^^^
 
-error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+error[E0562]: `impl Trait` not allowed outside of function and method return types
   --> $DIR/where-allowed.rs:82:32
    |
 LL | struct InBraceStructField { x: impl Debug }
    |                                ^^^^^^^^^^
 
-error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+error[E0562]: `impl Trait` not allowed outside of function and method return types
   --> $DIR/where-allowed.rs:86:41
    |
 LL | struct InAdtInBraceStructField { x: Vec<impl Debug> }
    |                                         ^^^^^^^^^^
 
-error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+error[E0562]: `impl Trait` not allowed outside of function and method return types
   --> $DIR/where-allowed.rs:90:27
    |
 LL | struct InTupleStructField(impl Debug);
    |                           ^^^^^^^^^^
 
-error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+error[E0562]: `impl Trait` not allowed outside of function and method return types
   --> $DIR/where-allowed.rs:95:25
    |
 LL |     InBraceVariant { x: impl Debug },
    |                         ^^^^^^^^^^
 
-error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+error[E0562]: `impl Trait` not allowed outside of function and method return types
   --> $DIR/where-allowed.rs:97:20
    |
 LL |     InTupleVariant(impl Debug),
    |                    ^^^^^^^^^^
 
-error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+error[E0562]: `impl Trait` not allowed outside of function and method return types
   --> $DIR/where-allowed.rs:108:23
    |
 LL |     fn in_return() -> impl Debug;
    |                       ^^^^^^^^^^
 
-error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+error[E0562]: `impl Trait` not allowed outside of function and method return types
   --> $DIR/where-allowed.rs:125:34
    |
 LL |     fn in_trait_impl_return() -> impl Debug { () }
    |                                  ^^^^^^^^^^
 
-error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+error[E0562]: `impl Trait` not allowed outside of function and method return types
   --> $DIR/where-allowed.rs:138:33
    |
 LL |     fn in_foreign_parameters(_: impl Debug);
    |                                 ^^^^^^^^^^
 
-error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+error[E0562]: `impl Trait` not allowed outside of function and method return types
   --> $DIR/where-allowed.rs:141:31
    |
 LL |     fn in_foreign_return() -> impl Debug;
    |                               ^^^^^^^^^^
 
-error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+error[E0562]: `impl Trait` not allowed outside of function and method return types
   --> $DIR/where-allowed.rs:157:39
    |
 LL | type InReturnInTypeAlias<R> = fn() -> impl Debug;
    |                                       ^^^^^^^^^^
 
-error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+error[E0562]: `impl Trait` not allowed outside of function and method return types
   --> $DIR/where-allowed.rs:162:16
    |
 LL | impl PartialEq<impl Debug> for () {
    |                ^^^^^^^^^^
 
-error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+error[E0562]: `impl Trait` not allowed outside of function and method return types
   --> $DIR/where-allowed.rs:167:24
    |
 LL | impl PartialEq<()> for impl Debug {
    |                        ^^^^^^^^^^
 
-error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+error[E0562]: `impl Trait` not allowed outside of function and method return types
   --> $DIR/where-allowed.rs:172:6
    |
 LL | impl impl Debug {
    |      ^^^^^^^^^^
 
-error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+error[E0562]: `impl Trait` not allowed outside of function and method return types
   --> $DIR/where-allowed.rs:178:24
    |
 LL | impl InInherentImplAdt<impl Debug> {
    |                        ^^^^^^^^^^
 
-error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+error[E0562]: `impl Trait` not allowed outside of function and method return types
   --> $DIR/where-allowed.rs:184:11
    |
 LL |     where impl Debug: Debug
    |           ^^^^^^^^^^
 
-error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+error[E0562]: `impl Trait` not allowed outside of function and method return types
   --> $DIR/where-allowed.rs:191:15
    |
 LL |     where Vec<impl Debug>: Debug
    |               ^^^^^^^^^^
 
-error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+error[E0562]: `impl Trait` not allowed outside of function and method return types
   --> $DIR/where-allowed.rs:198:24
    |
 LL |     where T: PartialEq<impl Debug>
    |                        ^^^^^^^^^^
 
-error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+error[E0562]: `impl Trait` not allowed outside of function and method return types
   --> $DIR/where-allowed.rs:205:17
    |
 LL |     where T: Fn(impl Debug)
    |                 ^^^^^^^^^^
 
-error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+error[E0562]: `impl Trait` not allowed outside of function and method return types
   --> $DIR/where-allowed.rs:212:22
    |
 LL |     where T: Fn() -> impl Debug
    |                      ^^^^^^^^^^
 
-error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+error[E0562]: `impl Trait` not allowed outside of function and method return types
   --> $DIR/where-allowed.rs:218:40
    |
 LL | struct InStructGenericParamDefault<T = impl Debug>(T);
    |                                        ^^^^^^^^^^
 
-error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+error[E0562]: `impl Trait` not allowed outside of function and method return types
   --> $DIR/where-allowed.rs:222:36
    |
 LL | enum InEnumGenericParamDefault<T = impl Debug> { Variant(T) }
    |                                    ^^^^^^^^^^
 
-error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+error[E0562]: `impl Trait` not allowed outside of function and method return types
   --> $DIR/where-allowed.rs:226:38
    |
 LL | trait InTraitGenericParamDefault<T = impl Debug> {}
    |                                      ^^^^^^^^^^
 
-error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+error[E0562]: `impl Trait` not allowed outside of function and method return types
   --> $DIR/where-allowed.rs:230:41
    |
 LL | type InTypeAliasGenericParamDefault<T = impl Debug> = T;
    |                                         ^^^^^^^^^^
 
-error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+error[E0562]: `impl Trait` not allowed outside of function and method return types
   --> $DIR/where-allowed.rs:234:11
    |
 LL | impl <T = impl Debug> T {}
    |           ^^^^^^^^^^
 
-error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+error[E0562]: `impl Trait` not allowed outside of function and method return types
   --> $DIR/where-allowed.rs:240:40
    |
 LL | fn in_method_generic_param_default<T = impl Debug>(_: T) {}
    |                                        ^^^^^^^^^^
 
-error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+error[E0562]: `impl Trait` not allowed outside of function and method return types
   --> $DIR/where-allowed.rs:246:29
    |
 LL |     let _in_local_variable: impl Fn() = || {};
    |                             ^^^^^^^^^
 
-error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+error[E0562]: `impl Trait` not allowed outside of function and method return types
   --> $DIR/where-allowed.rs:248:46
    |
 LL |     let _in_return_in_local_variable = || -> impl Fn() { || {} };