about summary refs log tree commit diff
path: root/src/test/ui/impl-trait
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-08-03 02:21:23 +0000
committerbors <bors@rust-lang.org>2019-08-03 02:21:23 +0000
commitd7270712cb446aad0817040bbca73a8d024f67b0 (patch)
tree22cf18615b2177381934d771fc3710e6fd04c257 /src/test/ui/impl-trait
parentd9bd4b289f07956819c59704d88d9eed61af3a6d (diff)
parentfbd7e0cf0e31ab612343311a61fe4f58a76a1698 (diff)
downloadrust-d7270712cb446aad0817040bbca73a8d024f67b0.tar.gz
rust-d7270712cb446aad0817040bbca73a8d024f67b0.zip
Auto merge of #63180 - varkor:trait-alias-impl-trait, r=Centril
Change opaque type syntax from `existential type` to type alias `impl Trait`

This implements a new feature gate `type_alias_impl_trait` (this is slightly different from the originally proposed feature name, but matches what has been used in discussion since), deprecating the old `existential_types` feature.

The syntax for opaque types has been changed. In addition, the "existential" terminology has been replaced with "opaque", as per previous discussion and the RFC.

This makes partial progress towards implementing https://github.com/rust-lang/rust/issues/63063.

r? @Centril
Diffstat (limited to 'src/test/ui/impl-trait')
-rw-r--r--src/test/ui/impl-trait/associated-impl-trait-type-generic-trait.rs (renamed from src/test/ui/impl-trait/associated-existential-type-generic-trait.rs)6
-rw-r--r--src/test/ui/impl-trait/associated-impl-trait-type-trivial.rs (renamed from src/test/ui/impl-trait/associated-existential-type-trivial.rs)4
-rw-r--r--src/test/ui/impl-trait/associated-impl-trait-type.rs (renamed from src/test/ui/impl-trait/associated-existential-type.rs)4
-rw-r--r--src/test/ui/impl-trait/bound-normalization-fail.rs1
-rw-r--r--src/test/ui/impl-trait/bound-normalization-fail.stderr6
-rw-r--r--src/test/ui/impl-trait/bound-normalization-pass.rs8
-rw-r--r--src/test/ui/impl-trait/issue-55872-1.rs6
-rw-r--r--src/test/ui/impl-trait/issue-55872-1.stderr10
-rw-r--r--src/test/ui/impl-trait/issue-55872-2.rs6
-rw-r--r--src/test/ui/impl-trait/issue-55872-2.stderr6
-rw-r--r--src/test/ui/impl-trait/issue-55872.rs6
-rw-r--r--src/test/ui/impl-trait/issue-55872.stderr2
-rw-r--r--src/test/ui/impl-trait/issues/issue-53457.rs4
-rw-r--r--src/test/ui/impl-trait/multiple-lifetimes/error-handling.rs4
-rw-r--r--src/test/ui/impl-trait/multiple-lifetimes/error-handling.stderr2
-rw-r--r--src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original-type-alias-impl-trait.rs (renamed from src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original-existential.rs)4
-rw-r--r--src/test/ui/impl-trait/return-position-impl-trait-minimal.rs (renamed from src/test/ui/impl-trait/existential-minimal.rs)0
-rw-r--r--src/test/ui/impl-trait/type-alias-impl-trait-in-fn-body.rs (renamed from src/test/ui/impl-trait/existential_type_in_fn_body.rs)4
-rw-r--r--src/test/ui/impl-trait/where-allowed.rs6
-rw-r--r--src/test/ui/impl-trait/where-allowed.stderr77
20 files changed, 93 insertions, 73 deletions
diff --git a/src/test/ui/impl-trait/associated-existential-type-generic-trait.rs b/src/test/ui/impl-trait/associated-impl-trait-type-generic-trait.rs
index 130de9ccf62..6c7c46b0e3d 100644
--- a/src/test/ui/impl-trait/associated-existential-type-generic-trait.rs
+++ b/src/test/ui/impl-trait/associated-impl-trait-type-generic-trait.rs
@@ -1,4 +1,4 @@
-#![feature(existential_type)]
+#![feature(type_alias_impl_trait)]
 // build-pass (FIXME(62277): could be check-pass?)
 
 trait Bar {}
@@ -11,7 +11,7 @@ trait Foo<T> {
 }
 
 impl<W> Foo<W> for i32 {
-    existential type Assoc: Bar;
+    type Assoc = impl Bar;
     fn foo(w: W) -> Self::Assoc {
         Dummy(w)
     }
@@ -21,7 +21,7 @@ struct NonGeneric;
 impl Bar for NonGeneric {}
 
 impl<W> Foo<W> for u32 {
-    existential type Assoc: Bar;
+    type Assoc = impl Bar;
     fn foo(_: W) -> Self::Assoc {
         NonGeneric
     }
diff --git a/src/test/ui/impl-trait/associated-existential-type-trivial.rs b/src/test/ui/impl-trait/associated-impl-trait-type-trivial.rs
index 0e83b4084b6..cdda341cad8 100644
--- a/src/test/ui/impl-trait/associated-existential-type-trivial.rs
+++ b/src/test/ui/impl-trait/associated-impl-trait-type-trivial.rs
@@ -1,4 +1,4 @@
-#![feature(existential_type)]
+#![feature(type_alias_impl_trait)]
 // build-pass (FIXME(62277): could be check-pass?)
 
 trait Bar {}
@@ -11,7 +11,7 @@ trait Foo {
 }
 
 impl Foo for i32 {
-    existential type Assoc: Bar;
+    type Assoc = impl Bar;
     fn foo() -> Self::Assoc {
         Dummy
     }
diff --git a/src/test/ui/impl-trait/associated-existential-type.rs b/src/test/ui/impl-trait/associated-impl-trait-type.rs
index 58966aefe1c..d0661d66f4b 100644
--- a/src/test/ui/impl-trait/associated-existential-type.rs
+++ b/src/test/ui/impl-trait/associated-impl-trait-type.rs
@@ -1,4 +1,4 @@
-#![feature(existential_type)]
+#![feature(type_alias_impl_trait)]
 // build-pass (FIXME(62277): could be check-pass?)
 
 trait Bar {}
@@ -12,7 +12,7 @@ trait Foo {
 }
 
 impl Foo for i32 {
-    existential type Assoc: Bar;
+    type Assoc = impl Bar;
     fn foo() -> Self::Assoc {
         Dummy
     }
diff --git a/src/test/ui/impl-trait/bound-normalization-fail.rs b/src/test/ui/impl-trait/bound-normalization-fail.rs
index 476ae62fa0f..c33261bfd09 100644
--- a/src/test/ui/impl-trait/bound-normalization-fail.rs
+++ b/src/test/ui/impl-trait/bound-normalization-fail.rs
@@ -2,7 +2,6 @@
 // edition:2018
 
 #![feature(async_await)]
-#![feature(existential_type)]
 #![feature(impl_trait_in_bindings)]
 //~^ WARNING the feature `impl_trait_in_bindings` is incomplete
 
diff --git a/src/test/ui/impl-trait/bound-normalization-fail.stderr b/src/test/ui/impl-trait/bound-normalization-fail.stderr
index 24a687491e5..aa306a7e08a 100644
--- a/src/test/ui/impl-trait/bound-normalization-fail.stderr
+++ b/src/test/ui/impl-trait/bound-normalization-fail.stderr
@@ -1,5 +1,5 @@
 warning: the feature `impl_trait_in_bindings` is incomplete and may cause the compiler to crash
-  --> $DIR/bound-normalization-fail.rs:6:12
+  --> $DIR/bound-normalization-fail.rs:5:12
    |
 LL | #![feature(impl_trait_in_bindings)]
    |            ^^^^^^^^^^^^^^^^^^^^^^
@@ -7,7 +7,7 @@ LL | #![feature(impl_trait_in_bindings)]
    = note: `#[warn(incomplete_features)]` on by default
 
 error[E0271]: type mismatch resolving `<Foo<()> as FooLike>::Output == <T as impl_trait::Trait>::Assoc`
-  --> $DIR/bound-normalization-fail.rs:30:32
+  --> $DIR/bound-normalization-fail.rs:29:32
    |
 LL |     fn foo_fail<T: Trait>() -> impl FooLike<Output=T::Assoc> {
    |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found associated type
@@ -17,7 +17,7 @@ LL |     fn foo_fail<T: Trait>() -> impl FooLike<Output=T::Assoc> {
    = note: the return type of a function must have a statically known size
 
 error[E0271]: type mismatch resolving `<Foo<()> as FooLike>::Output == <T as lifetimes::Trait<'static>>::Assoc`
-  --> $DIR/bound-normalization-fail.rs:47:41
+  --> $DIR/bound-normalization-fail.rs:46:41
    |
 LL |     fn foo2_fail<'a, T: Trait<'a>>() -> impl FooLike<Output=T::Assoc> {
    |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found associated type
diff --git a/src/test/ui/impl-trait/bound-normalization-pass.rs b/src/test/ui/impl-trait/bound-normalization-pass.rs
index 3fdd7c0ecb6..5b634e3106e 100644
--- a/src/test/ui/impl-trait/bound-normalization-pass.rs
+++ b/src/test/ui/impl-trait/bound-normalization-pass.rs
@@ -2,7 +2,7 @@
 // edition:2018
 
 #![feature(async_await)]
-#![feature(existential_type)]
+#![feature(type_alias_impl_trait)]
 #![feature(impl_trait_in_bindings)]
 //~^ WARNING the feature `impl_trait_in_bindings` is incomplete
 
@@ -81,9 +81,9 @@ mod impl_trait_in_bindings {
 }
 
 /////////////////////////////////////////////
-// The same applied to `existential type`s
+// The same applied to `type Foo = impl Bar`s
 
-mod existential_types {
+mod opaque_types {
     trait Implemented {
         type Assoc;
     }
@@ -99,7 +99,7 @@ mod existential_types {
         type Out = u8;
     }
 
-    existential type Ex: Trait<Out = <() as Implemented>::Assoc>;
+    type Ex = impl Trait<Out = <() as Implemented>::Assoc>;
 
     fn define() -> Ex {
         ()
diff --git a/src/test/ui/impl-trait/issue-55872-1.rs b/src/test/ui/impl-trait/issue-55872-1.rs
index 5095b26f8a4..f99096b4d58 100644
--- a/src/test/ui/impl-trait/issue-55872-1.rs
+++ b/src/test/ui/impl-trait/issue-55872-1.rs
@@ -1,5 +1,5 @@
 // ignore-tidy-linelength
-#![feature(existential_type)]
+#![feature(type_alias_impl_trait)]
 
 pub trait Bar
 {
@@ -9,12 +9,12 @@ pub trait Bar
 }
 
 impl<S: Default> Bar for S {
-    existential type E: Copy;
+    type E = impl Copy;
     //~^ ERROR the trait bound `S: std::marker::Copy` is not satisfied in `(S, T)` [E0277]
     //~^^ ERROR the trait bound `T: std::marker::Copy` is not satisfied in `(S, T)` [E0277]
 
     fn foo<T: Default>() -> Self::E {
-    //~^ ERROR type parameter `T` is part of concrete type but not used in parameter list for existential type
+    //~^ ERROR type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
         (S::default(), T::default())
     }
 }
diff --git a/src/test/ui/impl-trait/issue-55872-1.stderr b/src/test/ui/impl-trait/issue-55872-1.stderr
index 04b4d2d4a50..d5756c01559 100644
--- a/src/test/ui/impl-trait/issue-55872-1.stderr
+++ b/src/test/ui/impl-trait/issue-55872-1.stderr
@@ -1,8 +1,8 @@
 error[E0277]: the trait bound `S: std::marker::Copy` is not satisfied in `(S, T)`
   --> $DIR/issue-55872-1.rs:12:5
    |
-LL |     existential type E: Copy;
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^ within `(S, T)`, the trait `std::marker::Copy` is not implemented for `S`
+LL |     type E = impl Copy;
+   |     ^^^^^^^^^^^^^^^^^^^ within `(S, T)`, the trait `std::marker::Copy` is not implemented for `S`
    |
    = help: consider adding a `where S: std::marker::Copy` bound
    = note: required because it appears within the type `(S, T)`
@@ -11,14 +11,14 @@ LL |     existential type E: Copy;
 error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied in `(S, T)`
   --> $DIR/issue-55872-1.rs:12:5
    |
-LL |     existential type E: Copy;
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^ within `(S, T)`, the trait `std::marker::Copy` is not implemented for `T`
+LL |     type E = impl Copy;
+   |     ^^^^^^^^^^^^^^^^^^^ within `(S, T)`, the trait `std::marker::Copy` is not implemented for `T`
    |
    = help: consider adding a `where T: std::marker::Copy` bound
    = note: required because it appears within the type `(S, T)`
    = note: the return type of a function must have a statically known size
 
-error: type parameter `T` is part of concrete type but not used in parameter list for existential type
+error: type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
   --> $DIR/issue-55872-1.rs:16:37
    |
 LL |       fn foo<T: Default>() -> Self::E {
diff --git a/src/test/ui/impl-trait/issue-55872-2.rs b/src/test/ui/impl-trait/issue-55872-2.rs
index 2bdeb14bdc3..dfee20ca649 100644
--- a/src/test/ui/impl-trait/issue-55872-2.rs
+++ b/src/test/ui/impl-trait/issue-55872-2.rs
@@ -1,6 +1,6 @@
 // edition:2018
 // ignore-tidy-linelength
-#![feature(async_await, existential_type)]
+#![feature(async_await, type_alias_impl_trait)]
 
 pub trait Bar {
     type E: Copy;
@@ -9,10 +9,10 @@ pub trait Bar {
 }
 
 impl<S> Bar for S {
-    existential type E: Copy;
+    type E = impl Copy;
     //~^ ERROR the trait bound `impl std::future::Future: std::marker::Copy` is not satisfied [E0277]
     fn foo<T>() -> Self::E {
-    //~^ ERROR type parameter `T` is part of concrete type but not used in parameter list for existential type
+    //~^ ERROR type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
         async {}
     }
 }
diff --git a/src/test/ui/impl-trait/issue-55872-2.stderr b/src/test/ui/impl-trait/issue-55872-2.stderr
index 2505a82ee23..676c3fe3d4c 100644
--- a/src/test/ui/impl-trait/issue-55872-2.stderr
+++ b/src/test/ui/impl-trait/issue-55872-2.stderr
@@ -1,12 +1,12 @@
 error[E0277]: the trait bound `impl std::future::Future: std::marker::Copy` is not satisfied
   --> $DIR/issue-55872-2.rs:12:5
    |
-LL |     existential type E: Copy;
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `impl std::future::Future`
+LL |     type E = impl Copy;
+   |     ^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `impl std::future::Future`
    |
    = note: the return type of a function must have a statically known size
 
-error: type parameter `T` is part of concrete type but not used in parameter list for existential type
+error: type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
   --> $DIR/issue-55872-2.rs:14:28
    |
 LL |       fn foo<T>() -> Self::E {
diff --git a/src/test/ui/impl-trait/issue-55872.rs b/src/test/ui/impl-trait/issue-55872.rs
index 95604545c37..bc91aae70c7 100644
--- a/src/test/ui/impl-trait/issue-55872.rs
+++ b/src/test/ui/impl-trait/issue-55872.rs
@@ -1,5 +1,5 @@
 // ignore-tidy-linelength
-#![feature(existential_type)]
+#![feature(type_alias_impl_trait)]
 
 pub trait Bar {
     type E: Copy;
@@ -8,10 +8,10 @@ pub trait Bar {
 }
 
 impl<S> Bar for S {
-    existential type E: Copy;
+    type E = impl Copy;
 
     fn foo<T>() -> Self::E {
-    //~^ ERROR type parameter `T` is part of concrete type but not used in parameter list for existential type
+    //~^ ERROR type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
         || ()
     }
 }
diff --git a/src/test/ui/impl-trait/issue-55872.stderr b/src/test/ui/impl-trait/issue-55872.stderr
index 487f276e317..60654ec3461 100644
--- a/src/test/ui/impl-trait/issue-55872.stderr
+++ b/src/test/ui/impl-trait/issue-55872.stderr
@@ -1,4 +1,4 @@
-error: type parameter `T` is part of concrete type but not used in parameter list for existential type
+error: type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
   --> $DIR/issue-55872.rs:13:28
    |
 LL |       fn foo<T>() -> Self::E {
diff --git a/src/test/ui/impl-trait/issues/issue-53457.rs b/src/test/ui/impl-trait/issues/issue-53457.rs
index 3f6a4fb2787..de8c579743f 100644
--- a/src/test/ui/impl-trait/issues/issue-53457.rs
+++ b/src/test/ui/impl-trait/issues/issue-53457.rs
@@ -1,8 +1,8 @@
 // run-pass
 
-#![feature(existential_type)]
+#![feature(type_alias_impl_trait)]
 
-existential type X: Clone;
+type X = impl Clone;
 
 fn bar<F: Fn(&i32) + Clone>(f: F) -> F {
     f
diff --git a/src/test/ui/impl-trait/multiple-lifetimes/error-handling.rs b/src/test/ui/impl-trait/multiple-lifetimes/error-handling.rs
index 61e858ee02d..b226cf058aa 100644
--- a/src/test/ui/impl-trait/multiple-lifetimes/error-handling.rs
+++ b/src/test/ui/impl-trait/multiple-lifetimes/error-handling.rs
@@ -1,14 +1,14 @@
 // compile-flags:-Zborrowck=mir
 
 #![feature(member_constraints)]
-#![feature(existential_type)]
+#![feature(type_alias_impl_trait)]
 
 #[derive(Clone)]
 struct CopyIfEq<T, U>(T, U);
 
 impl<T: Copy> Copy for CopyIfEq<T, T> {}
 
-existential type E<'a, 'b>: Sized;
+type E<'a, 'b> = impl Sized;
 
 fn foo<'a, 'b, 'c>(x: &'static i32, mut y: &'a i32) -> E<'b, 'c> {
     //~^ ERROR lifetime may not live long enough
diff --git a/src/test/ui/impl-trait/multiple-lifetimes/error-handling.stderr b/src/test/ui/impl-trait/multiple-lifetimes/error-handling.stderr
index b59dfbe9f2a..f27e6ff44a6 100644
--- a/src/test/ui/impl-trait/multiple-lifetimes/error-handling.stderr
+++ b/src/test/ui/impl-trait/multiple-lifetimes/error-handling.stderr
@@ -5,7 +5,7 @@ LL | fn foo<'a, 'b, 'c>(x: &'static i32, mut y: &'a i32) -> E<'b, 'c> {
    |        -- lifetime `'a` defined here                   ^^^^^^^^^ opaque type requires that `'a` must outlive `'static`
 help: to allow this `impl Trait` to capture borrowed data with lifetime `'a`, add `'a` as a constraint
    |
-LL | existential type E<'a, 'b>: Sized; + 'a
+LL | type E<'a, 'b> = impl Sized; + 'a
    |
 
 error: aborting due to previous error
diff --git a/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original-existential.rs b/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original-type-alias-impl-trait.rs
index 43915e05e88..ae44b371f4f 100644
--- a/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original-existential.rs
+++ b/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original-type-alias-impl-trait.rs
@@ -4,7 +4,7 @@
 //[mir]compile-flags: -Z borrowck=mir
 
 #![feature(member_constraints)]
-#![feature(existential_type)]
+#![feature(type_alias_impl_trait)]
 
 trait Trait<'a, 'b> { }
 impl<T> Trait<'_, '_> for T { }
@@ -12,7 +12,7 @@ impl<T> Trait<'_, '_> for T { }
 // Here we wind up selecting `'a` and `'b` in the hidden type because
 // those are the types that appear in the original values.
 
-existential type Foo<'a, 'b>: Trait<'a, 'b>;
+type Foo<'a, 'b> = impl Trait<'a, 'b>;
 
 fn upper_bounds<'a, 'b>(a: &'a u8, b: &'b u8) -> Foo<'a, 'b> {
     // In this simple case, you have a hidden type `(&'0 u8, &'1 u8)` and constraints like
diff --git a/src/test/ui/impl-trait/existential-minimal.rs b/src/test/ui/impl-trait/return-position-impl-trait-minimal.rs
index 6d3c0692970..6d3c0692970 100644
--- a/src/test/ui/impl-trait/existential-minimal.rs
+++ b/src/test/ui/impl-trait/return-position-impl-trait-minimal.rs
diff --git a/src/test/ui/impl-trait/existential_type_in_fn_body.rs b/src/test/ui/impl-trait/type-alias-impl-trait-in-fn-body.rs
index 32fc4a97ef4..91be4efd56a 100644
--- a/src/test/ui/impl-trait/existential_type_in_fn_body.rs
+++ b/src/test/ui/impl-trait/type-alias-impl-trait-in-fn-body.rs
@@ -1,11 +1,11 @@
 // build-pass (FIXME(62277): could be check-pass?)
 
-#![feature(existential_type)]
+#![feature(type_alias_impl_trait)]
 
 use std::fmt::Debug;
 
 fn main() {
-    existential type Existential: Debug;
+    type Existential = impl Debug;
 
     fn f() -> Existential {}
     println!("{:?}", f());
diff --git a/src/test/ui/impl-trait/where-allowed.rs b/src/test/ui/impl-trait/where-allowed.rs
index 31bc9f449a0..9eac6b714de 100644
--- a/src/test/ui/impl-trait/where-allowed.rs
+++ b/src/test/ui/impl-trait/where-allowed.rs
@@ -120,7 +120,8 @@ trait DummyTrait {
 }
 impl DummyTrait for () {
     type Out = impl Debug;
-    //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+    //~^ ERROR `impl Trait` in type aliases is unstable
+    //~^^ ERROR could not find defining uses
 
     fn in_trait_impl_parameter(_: impl Debug) { }
     // Allowed
@@ -155,7 +156,8 @@ extern "C" fn in_extern_fn_return() -> impl Debug {
 }
 
 type InTypeAlias<R> = impl Debug;
-//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+//~^ ERROR `impl Trait` in type aliases is unstable
+//~^^ ERROR could not find defining uses
 
 type InReturnInTypeAlias<R> = fn() -> impl Debug;
 //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
diff --git a/src/test/ui/impl-trait/where-allowed.stderr b/src/test/ui/impl-trait/where-allowed.stderr
index 9895b028a4e..1332fff84f5 100644
--- a/src/test/ui/impl-trait/where-allowed.stderr
+++ b/src/test/ui/impl-trait/where-allowed.stderr
@@ -16,6 +16,24 @@ LL | fn in_impl_Fn_parameter_in_return() -> &'static impl Fn(impl Debug) { panic
    |                                                 |       nested `impl Trait` here
    |                                                 outer `impl Trait`
 
+error[E0658]: `impl Trait` in type aliases is unstable
+  --> $DIR/where-allowed.rs:122:5
+   |
+LL |     type Out = impl Debug;
+   |     ^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: for more information, see https://github.com/rust-lang/rust/issues/63063
+   = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
+
+error[E0658]: `impl Trait` in type aliases is unstable
+  --> $DIR/where-allowed.rs:158:1
+   |
+LL | type InTypeAlias<R> = impl Debug;
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: for more information, see https://github.com/rust-lang/rust/issues/63063
+   = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
+
 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
   --> $DIR/where-allowed.rs:18:40
    |
@@ -137,97 +155,85 @@ LL |     fn in_return() -> impl Debug;
    |                       ^^^^^^^^^^
 
 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
-  --> $DIR/where-allowed.rs:122:16
-   |
-LL |     type Out = impl Debug;
-   |                ^^^^^^^^^^
-
-error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
-  --> $DIR/where-allowed.rs:128:34
+  --> $DIR/where-allowed.rs:129:34
    |
 LL |     fn in_trait_impl_return() -> impl Debug { () }
    |                                  ^^^^^^^^^^
 
 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
-  --> $DIR/where-allowed.rs:141:33
+  --> $DIR/where-allowed.rs:142:33
    |
 LL |     fn in_foreign_parameters(_: impl Debug);
    |                                 ^^^^^^^^^^
 
 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
-  --> $DIR/where-allowed.rs:144:31
+  --> $DIR/where-allowed.rs:145:31
    |
 LL |     fn in_foreign_return() -> impl Debug;
    |                               ^^^^^^^^^^
 
 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
-  --> $DIR/where-allowed.rs:157:23
-   |
-LL | type InTypeAlias<R> = impl Debug;
-   |                       ^^^^^^^^^^
-
-error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
-  --> $DIR/where-allowed.rs:160:39
+  --> $DIR/where-allowed.rs:162:39
    |
 LL | type InReturnInTypeAlias<R> = fn() -> impl Debug;
    |                                       ^^^^^^^^^^
 
 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
-  --> $DIR/where-allowed.rs:164:16
+  --> $DIR/where-allowed.rs:166:16
    |
 LL | impl PartialEq<impl Debug> for () {
    |                ^^^^^^^^^^
 
 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
-  --> $DIR/where-allowed.rs:169:24
+  --> $DIR/where-allowed.rs:171:24
    |
 LL | impl PartialEq<()> for impl Debug {
    |                        ^^^^^^^^^^
 
 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
-  --> $DIR/where-allowed.rs:174:6
+  --> $DIR/where-allowed.rs:176:6
    |
 LL | impl impl Debug {
    |      ^^^^^^^^^^
 
 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
-  --> $DIR/where-allowed.rs:180:24
+  --> $DIR/where-allowed.rs:182:24
    |
 LL | impl InInherentImplAdt<impl Debug> {
    |                        ^^^^^^^^^^
 
 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
-  --> $DIR/where-allowed.rs:186:11
+  --> $DIR/where-allowed.rs:188:11
    |
 LL |     where impl Debug: Debug
    |           ^^^^^^^^^^
 
 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
-  --> $DIR/where-allowed.rs:193:15
+  --> $DIR/where-allowed.rs:195:15
    |
 LL |     where Vec<impl Debug>: Debug
    |               ^^^^^^^^^^
 
 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
-  --> $DIR/where-allowed.rs:200:24
+  --> $DIR/where-allowed.rs:202:24
    |
 LL |     where T: PartialEq<impl Debug>
    |                        ^^^^^^^^^^
 
 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
-  --> $DIR/where-allowed.rs:207:17
+  --> $DIR/where-allowed.rs:209:17
    |
 LL |     where T: Fn(impl Debug)
    |                 ^^^^^^^^^^
 
 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
-  --> $DIR/where-allowed.rs:214:22
+  --> $DIR/where-allowed.rs:216:22
    |
 LL |     where T: Fn() -> impl Debug
    |                      ^^^^^^^^^^
 
 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
-  --> $DIR/where-allowed.rs:220:29
+  --> $DIR/where-allowed.rs:222:29
    |
 LL |     let _in_local_variable: impl Fn() = || {};
    |                             ^^^^^^^^^
@@ -235,11 +241,24 @@ LL |     let _in_local_variable: impl Fn() = || {};
    = help: add `#![feature(impl_trait_in_bindings)]` to the crate attributes to enable
 
 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
-  --> $DIR/where-allowed.rs:222:46
+  --> $DIR/where-allowed.rs:224:46
    |
 LL |     let _in_return_in_local_variable = || -> impl Fn() { || {} };
    |                                              ^^^^^^^^^
 
-error: aborting due to 39 previous errors
+error: could not find defining uses
+  --> $DIR/where-allowed.rs:158:1
+   |
+LL | type InTypeAlias<R> = impl Debug;
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: could not find defining uses
+  --> $DIR/where-allowed.rs:122:5
+   |
+LL |     type Out = impl Debug;
+   |     ^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 41 previous errors
 
-For more information about this error, try `rustc --explain E0562`.
+Some errors have detailed explanations: E0562, E0658.
+For more information about an error, try `rustc --explain E0562`.