diff --git a/src/test/ui/associated-type-bounds/duplicate.rs b/src/test/ui/associated-type-bounds/duplicate.rs index bee56d6f689..1f2d755ed71 100644 --- a/src/test/ui/associated-type-bounds/duplicate.rs +++ b/src/test/ui/associated-type-bounds/duplicate.rs @@ -3,7 +3,7 @@ // error-pattern:could not find defining uses #![feature(associated_type_bounds)] -#![feature(existential_type)] +#![feature(type_alias_impl_trait)] #![feature(impl_trait_in_bindings)] #![feature(untagged_unions)] @@ -107,17 +107,17 @@ type TAW2 where T: Iterator = T; type TAW3 where T: Iterator = T; //~^ the value of the associated type `Item` (from the trait `std::iter::Iterator`) is already specified [E0719] -existential type ETAI1>: Copy; +type ETAI1> = impl Copy; //~^ the value of the associated type `Item` (from the trait `std::iter::Iterator`) is already specified [E0719] -existential type ETAI2>: Copy; +type ETAI2> = impl Copy; //~^ the value of the associated type `Item` (from the trait `std::iter::Iterator`) is already specified [E0719] -existential type ETAI3>: Copy; +type ETAI3> = impl Copy; //~^ the value of the associated type `Item` (from the trait `std::iter::Iterator`) is already specified [E0719] -existential type ETAI4: Iterator; +type ETAI4 = impl Iterator; //~^ the value of the associated type `Item` (from the trait `std::iter::Iterator`) is already specified [E0719] -existential type ETAI5: Iterator; +type ETAI5 = impl Iterator; //~^ the value of the associated type `Item` (from the trait `std::iter::Iterator`) is already specified [E0719] -existential type ETAI6: Iterator; +type ETAI6 = impl Iterator; //~^ the value of the associated type `Item` (from the trait `std::iter::Iterator`) is already specified [E0719] trait TRI1> {} diff --git a/src/test/ui/associated-type-bounds/duplicate.stderr b/src/test/ui/associated-type-bounds/duplicate.stderr index 7f14a033688..7f3a65ab696 100644 --- a/src/test/ui/associated-type-bounds/duplicate.stderr +++ b/src/test/ui/associated-type-bounds/duplicate.stderr @@ -369,86 +369,86 @@ LL | type TAW3 where T: Iterator = T; error: could not find defining uses --> $DIR/duplicate.rs:110:1 | -LL | existential type ETAI1>: Copy; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | type ETAI1> = impl Copy; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0719]: the value of the associated type `Item` (from the trait `std::iter::Iterator`) is already specified - --> $DIR/duplicate.rs:110:48 + --> $DIR/duplicate.rs:110:36 | -LL | existential type ETAI1>: Copy; - | ---------- ^^^^^^^^^^ re-bound here - | | - | `Item` bound here first +LL | type ETAI1> = impl Copy; + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first error: could not find defining uses --> $DIR/duplicate.rs:112:1 | -LL | existential type ETAI2>: Copy; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | type ETAI2> = impl Copy; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0719]: the value of the associated type `Item` (from the trait `std::iter::Iterator`) is already specified - --> $DIR/duplicate.rs:112:48 + --> $DIR/duplicate.rs:112:36 | -LL | existential type ETAI2>: Copy; - | ---------- ^^^^^^^^^^ re-bound here - | | - | `Item` bound here first +LL | type ETAI2> = impl Copy; + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first error: could not find defining uses --> $DIR/duplicate.rs:114:1 | -LL | existential type ETAI3>: Copy; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | type ETAI3> = impl Copy; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0719]: the value of the associated type `Item` (from the trait `std::iter::Iterator`) is already specified - --> $DIR/duplicate.rs:114:51 + --> $DIR/duplicate.rs:114:39 | -LL | existential type ETAI3>: Copy; - | ------------- ^^^^^^^^^^^^^ re-bound here - | | - | `Item` bound here first +LL | type ETAI3> = impl Copy; + | ------------- ^^^^^^^^^^^^^ re-bound here + | | + | `Item` bound here first error: could not find defining uses --> $DIR/duplicate.rs:116:1 | -LL | existential type ETAI4: Iterator; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | type ETAI4 = impl Iterator; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0719]: the value of the associated type `Item` (from the trait `std::iter::Iterator`) is already specified - --> $DIR/duplicate.rs:116:46 + --> $DIR/duplicate.rs:116:40 | -LL | existential type ETAI4: Iterator; - | ---------- ^^^^^^^^^^ re-bound here - | | - | `Item` bound here first +LL | type ETAI4 = impl Iterator; + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first error: could not find defining uses --> $DIR/duplicate.rs:118:1 | -LL | existential type ETAI5: Iterator; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | type ETAI5 = impl Iterator; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0719]: the value of the associated type `Item` (from the trait `std::iter::Iterator`) is already specified - --> $DIR/duplicate.rs:118:46 + --> $DIR/duplicate.rs:118:40 | -LL | existential type ETAI5: Iterator; - | ---------- ^^^^^^^^^^ re-bound here - | | - | `Item` bound here first +LL | type ETAI5 = impl Iterator; + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first error: could not find defining uses --> $DIR/duplicate.rs:120:1 | -LL | existential type ETAI6: Iterator; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | type ETAI6 = impl Iterator; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0719]: the value of the associated type `Item` (from the trait `std::iter::Iterator`) is already specified - --> $DIR/duplicate.rs:120:49 + --> $DIR/duplicate.rs:120:43 | -LL | existential type ETAI6: Iterator; - | ------------- ^^^^^^^^^^^^^ re-bound here - | | - | `Item` bound here first +LL | type ETAI6 = impl Iterator; + | ------------- ^^^^^^^^^^^^^ re-bound here + | | + | `Item` bound here first error[E0719]: the value of the associated type `Item` (from the trait `std::iter::Iterator`) is already specified --> $DIR/duplicate.rs:123:36 diff --git a/src/test/ui/associated-type-bounds/dyn-existential-type.rs b/src/test/ui/associated-type-bounds/dyn-existential-type.rs index dc0afaa934a..fd9e52a6ff2 100644 --- a/src/test/ui/associated-type-bounds/dyn-existential-type.rs +++ b/src/test/ui/associated-type-bounds/dyn-existential-type.rs @@ -1,7 +1,6 @@ // run-pass #![feature(associated_type_bounds)] -#![feature(existential_type)] use std::ops::Add; diff --git a/src/test/ui/associated-type-bounds/existential-type.rs b/src/test/ui/associated-type-bounds/existential-type.rs index 87046aec5c4..9ee33e4149a 100644 --- a/src/test/ui/associated-type-bounds/existential-type.rs +++ b/src/test/ui/associated-type-bounds/existential-type.rs @@ -1,7 +1,7 @@ // run-pass #![feature(associated_type_bounds)] -#![feature(existential_type)] +#![feature(type_alias_impl_trait)] use std::ops::Add; @@ -17,15 +17,15 @@ struct S1; struct S2; impl Tr1 for S1 { type As1 = S2; fn mk(self) -> Self::As1 { S2 } } -existential type Et1: Tr1; +type Et1 = impl Tr1; fn def_et1() -> Et1 { S1 } pub fn use_et1() { assert_copy(def_et1().mk()); } -existential type Et2: Tr1; +type Et2 = impl Tr1; fn def_et2() -> Et2 { S1 } pub fn use_et2() { assert_static(def_et2().mk()); } -existential type Et3: Tr1>>>; +type Et3 = impl Tr1>>>; fn def_et3() -> Et3 { struct A; impl Tr1 for A { @@ -44,7 +44,7 @@ pub fn use_et3() { assert_eq!(s, (0..10).map(|x| x + 1).sum()); } -existential type Et4: Tr1 Tr2<'a>>; +type Et4 = impl Tr1 Tr2<'a>>; fn def_et4() -> Et4 { #[derive(Copy, Clone)] struct A; diff --git a/src/test/ui/async-await/issues/issue-60655-latebound-regions.rs b/src/test/ui/async-await/issues/issue-60655-latebound-regions.rs index 2328ceb144f..f11aff971bf 100644 --- a/src/test/ui/async-await/issues/issue-60655-latebound-regions.rs +++ b/src/test/ui/async-await/issues/issue-60655-latebound-regions.rs @@ -3,11 +3,12 @@ // build-pass (FIXME(62277): could be check-pass?) // edition:2018 -#![feature(async_await, existential_type)] +#![feature(async_await)] +#![feature(type_alias_impl_trait)] use std::future::Future; -pub existential type Func: Sized; +pub type Func = impl Sized; // Late bound region should be allowed to escape the function, since it's bound // in the type. @@ -17,7 +18,7 @@ fn null_function_ptr() -> Func { async fn async_nop(_: &u8) {} -pub existential type ServeFut: Future; +pub type ServeFut = impl Future; // Late bound regions occur in the generator witness type here. fn serve() -> ServeFut { diff --git a/src/test/ui/existential_types/auxiliary/cross_crate_ice.rs b/src/test/ui/existential_types/auxiliary/cross_crate_ice.rs index 96ab476061d..f6d86391388 100644 --- a/src/test/ui/existential_types/auxiliary/cross_crate_ice.rs +++ b/src/test/ui/existential_types/auxiliary/cross_crate_ice.rs @@ -2,9 +2,9 @@ #![crate_type="rlib"] -#![feature(existential_type)] +#![feature(type_alias_impl_trait)] -pub existential type Foo: std::fmt::Debug; +pub type Foo = impl std::fmt::Debug; pub fn foo() -> Foo { 5 diff --git a/src/test/ui/existential_types/auxiliary/cross_crate_ice2.rs b/src/test/ui/existential_types/auxiliary/cross_crate_ice2.rs index 39ec5394feb..2fa7d6ae5c4 100644 --- a/src/test/ui/existential_types/auxiliary/cross_crate_ice2.rs +++ b/src/test/ui/existential_types/auxiliary/cross_crate_ice2.rs @@ -2,7 +2,7 @@ #![crate_type="rlib"] -#![feature(existential_type)] +#![feature(type_alias_impl_trait)] pub trait View { type Tmp: Iterator; @@ -13,7 +13,7 @@ pub trait View { pub struct X; impl View for X { - existential type Tmp: Iterator; + type Tmp = impl Iterator; fn test(&self) -> Self::Tmp { vec![1,2,3].into_iter() diff --git a/src/test/ui/existential_types/bound_reduction.rs b/src/test/ui/existential_types/bound_reduction.rs index 46bc17293bc..18c840d8ed9 100644 --- a/src/test/ui/existential_types/bound_reduction.rs +++ b/src/test/ui/existential_types/bound_reduction.rs @@ -2,12 +2,12 @@ #![allow(warnings)] -#![feature(existential_type)] +#![feature(type_alias_impl_trait)] fn main() { } -existential type Foo: std::fmt::Debug; +type Foo = impl std::fmt::Debug; trait Trait {} diff --git a/src/test/ui/existential_types/bound_reduction2.rs b/src/test/ui/existential_types/bound_reduction2.rs index 542e076d88d..919446877a1 100644 --- a/src/test/ui/existential_types/bound_reduction2.rs +++ b/src/test/ui/existential_types/bound_reduction2.rs @@ -1,4 +1,4 @@ -#![feature(existential_type)] +#![feature(type_alias_impl_trait)] fn main() { } @@ -7,7 +7,7 @@ trait TraitWithAssoc { type Assoc; } -existential type Foo: Trait; +type Foo = impl Trait; //~^ ERROR could not find defining uses trait Trait {} diff --git a/src/test/ui/existential_types/bound_reduction2.stderr b/src/test/ui/existential_types/bound_reduction2.stderr index b8bad7db6b6..b88a364b852 100644 --- a/src/test/ui/existential_types/bound_reduction2.stderr +++ b/src/test/ui/existential_types/bound_reduction2.stderr @@ -9,8 +9,8 @@ LL | | } error: could not find defining uses --> $DIR/bound_reduction2.rs:10:1 | -LL | existential type Foo: Trait; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | type Foo = impl Trait; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/existential_types/declared_but_never_defined.rs b/src/test/ui/existential_types/declared_but_never_defined.rs index ff253391f2a..c4bf56a9197 100644 --- a/src/test/ui/existential_types/declared_but_never_defined.rs +++ b/src/test/ui/existential_types/declared_but_never_defined.rs @@ -1,6 +1,6 @@ -#![feature(existential_type)] +#![feature(type_alias_impl_trait)] fn main() {} // declared but never defined -existential type Bar: std::fmt::Debug; //~ ERROR could not find defining uses +type Bar = impl std::fmt::Debug; //~ ERROR could not find defining uses diff --git a/src/test/ui/existential_types/declared_but_never_defined.stderr b/src/test/ui/existential_types/declared_but_never_defined.stderr index 7294a074db6..ae0fee4333b 100644 --- a/src/test/ui/existential_types/declared_but_never_defined.stderr +++ b/src/test/ui/existential_types/declared_but_never_defined.stderr @@ -1,8 +1,8 @@ error: could not find defining uses --> $DIR/declared_but_never_defined.rs:6:1 | -LL | existential type Bar: std::fmt::Debug; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | type Bar = impl std::fmt::Debug; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/existential_types/declared_but_not_defined_in_scope.rs b/src/test/ui/existential_types/declared_but_not_defined_in_scope.rs index a6311ee964d..09873a8c8c3 100644 --- a/src/test/ui/existential_types/declared_but_not_defined_in_scope.rs +++ b/src/test/ui/existential_types/declared_but_not_defined_in_scope.rs @@ -1,10 +1,10 @@ -#![feature(existential_type)] +#![feature(type_alias_impl_trait)] fn main() {} mod boo { // declared in module but not defined inside of it - pub existential type Boo: ::std::fmt::Debug; //~ ERROR could not find defining uses + pub type Boo = impl ::std::fmt::Debug; //~ ERROR could not find defining uses } fn bomp() -> boo::Boo { diff --git a/src/test/ui/existential_types/declared_but_not_defined_in_scope.stderr b/src/test/ui/existential_types/declared_but_not_defined_in_scope.stderr index a72709f7194..0642407aba3 100644 --- a/src/test/ui/existential_types/declared_but_not_defined_in_scope.stderr +++ b/src/test/ui/existential_types/declared_but_not_defined_in_scope.stderr @@ -1,8 +1,8 @@ error: could not find defining uses --> $DIR/declared_but_not_defined_in_scope.rs:7:5 | -LL | pub existential type Boo: ::std::fmt::Debug; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | pub type Boo = impl ::std::fmt::Debug; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/existential_types/different_defining_uses.rs b/src/test/ui/existential_types/different_defining_uses.rs index a8670cc07f2..2d7780a126c 100644 --- a/src/test/ui/existential_types/different_defining_uses.rs +++ b/src/test/ui/existential_types/different_defining_uses.rs @@ -1,9 +1,9 @@ -#![feature(existential_type)] +#![feature(type_alias_impl_trait)] fn main() {} // two definitions with different types -existential type Foo: std::fmt::Debug; +type Foo = impl std::fmt::Debug; fn foo() -> Foo { "" diff --git a/src/test/ui/existential_types/different_defining_uses_never_type.rs b/src/test/ui/existential_types/different_defining_uses_never_type.rs index 13ada63e4bc..289b97b00ad 100644 --- a/src/test/ui/existential_types/different_defining_uses_never_type.rs +++ b/src/test/ui/existential_types/different_defining_uses_never_type.rs @@ -1,9 +1,9 @@ -#![feature(existential_type)] +#![feature(type_alias_impl_trait)] fn main() {} // two definitions with different types -existential type Foo: std::fmt::Debug; +type Foo = impl std::fmt::Debug; fn foo() -> Foo { "" diff --git a/src/test/ui/existential_types/different_defining_uses_never_type2.rs b/src/test/ui/existential_types/different_defining_uses_never_type2.rs index 0f02cfaad7e..8549687ea78 100644 --- a/src/test/ui/existential_types/different_defining_uses_never_type2.rs +++ b/src/test/ui/existential_types/different_defining_uses_never_type2.rs @@ -1,11 +1,11 @@ // build-pass (FIXME(62277): could be check-pass?) -#![feature(existential_type)] +#![feature(type_alias_impl_trait)] fn main() {} // two definitions with different types -existential type Foo: std::fmt::Debug; +type Foo = impl std::fmt::Debug; fn foo() -> Foo { "" diff --git a/src/test/ui/existential_types/existential-associated-type.rs b/src/test/ui/existential_types/existential-associated-type.rs index bfb91f68ffd..42f07d49ffe 100644 --- a/src/test/ui/existential_types/existential-associated-type.rs +++ b/src/test/ui/existential_types/existential-associated-type.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 { fn bar() -> Self::Assoc; } -existential type Helper: Bar; +type Helper = impl Bar; impl Foo for i32 { type Assoc = Helper; diff --git a/src/test/ui/existential_types/existential-types-with-cycle-error.rs b/src/test/ui/existential_types/existential-types-with-cycle-error.rs index 38fcabb5cc1..c009952eab7 100644 --- a/src/test/ui/existential_types/existential-types-with-cycle-error.rs +++ b/src/test/ui/existential_types/existential-types-with-cycle-error.rs @@ -1,6 +1,6 @@ -#![feature(existential_type)] +#![feature(type_alias_impl_trait)] -existential type Foo: Fn() -> Foo; +type Foo = impl Fn() -> Foo; //~^ ERROR: could not find defining uses fn crash(x: Foo) -> Foo { diff --git a/src/test/ui/existential_types/existential-types-with-cycle-error.stderr b/src/test/ui/existential_types/existential-types-with-cycle-error.stderr index 98a269d5271..e044bad37e8 100644 --- a/src/test/ui/existential_types/existential-types-with-cycle-error.stderr +++ b/src/test/ui/existential_types/existential-types-with-cycle-error.stderr @@ -1,8 +1,8 @@ error: could not find defining uses --> $DIR/existential-types-with-cycle-error.rs:3:1 | -LL | existential type Foo: Fn() -> Foo; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | type Foo = impl Fn() -> Foo; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/existential_types/existential-types-with-cycle-error2.rs b/src/test/ui/existential_types/existential-types-with-cycle-error2.rs index f9e6bdb67d4..32ecc366618 100644 --- a/src/test/ui/existential_types/existential-types-with-cycle-error2.rs +++ b/src/test/ui/existential_types/existential-types-with-cycle-error2.rs @@ -1,10 +1,10 @@ -#![feature(existential_type)] +#![feature(type_alias_impl_trait)] pub trait Bar { type Item; } -existential type Foo: Bar; +type Foo = impl Bar; //~^ ERROR: could not find defining uses fn crash(x: Foo) -> Foo { diff --git a/src/test/ui/existential_types/existential-types-with-cycle-error2.stderr b/src/test/ui/existential_types/existential-types-with-cycle-error2.stderr index 830305d8631..32c1424ad95 100644 --- a/src/test/ui/existential_types/existential-types-with-cycle-error2.stderr +++ b/src/test/ui/existential_types/existential-types-with-cycle-error2.stderr @@ -1,8 +1,8 @@ error: could not find defining uses --> $DIR/existential-types-with-cycle-error2.rs:7:1 | -LL | existential type Foo: Bar; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | type Foo = impl Bar; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/existential_types/existential-types-with-no-traits.rs b/src/test/ui/existential_types/existential-types-with-no-traits.rs index 46339c73b1f..8ca279eec92 100644 --- a/src/test/ui/existential_types/existential-types-with-no-traits.rs +++ b/src/test/ui/existential_types/existential-types-with-no-traits.rs @@ -1,6 +1,6 @@ -#![feature(existential_type)] +#![feature(type_alias_impl_trait)] -existential type Foo: 'static; +type Foo = impl 'static; //~^ ERROR: at least one trait must be specified fn foo() -> Foo { diff --git a/src/test/ui/existential_types/existential-types-with-no-traits.stderr b/src/test/ui/existential_types/existential-types-with-no-traits.stderr index 4b2fbc79d3b..9703a367ddc 100644 --- a/src/test/ui/existential_types/existential-types-with-no-traits.stderr +++ b/src/test/ui/existential_types/existential-types-with-no-traits.stderr @@ -1,8 +1,8 @@ error: at least one trait must be specified - --> $DIR/existential-types-with-no-traits.rs:3:23 + --> $DIR/existential-types-with-no-traits.rs:3:17 | -LL | existential type Foo: 'static; - | ^^^^^^^ +LL | type Foo = impl 'static; + | ^^^^^^^ error: at least one trait must be specified --> $DIR/existential-types-with-no-traits.rs:10:13 diff --git a/src/test/ui/existential_types/existential_type-pass.rs b/src/test/ui/existential_types/existential_type-pass.rs index c2cf0eeed3d..209134acf01 100644 --- a/src/test/ui/existential_types/existential_type-pass.rs +++ b/src/test/ui/existential_types/existential_type-pass.rs @@ -3,7 +3,7 @@ #![allow(dead_code)] #![allow(unused_assignments)] #![allow(unused_variables)] -#![feature(existential_type)] +#![feature(type_alias_impl_trait)] fn main() { assert_eq!(foo().to_string(), "foo"); @@ -16,14 +16,14 @@ fn main() { } // single definition -existential type Foo: std::fmt::Display; +type Foo = impl std::fmt::Display; fn foo() -> Foo { "foo" } // two definitions -existential type Bar: std::fmt::Display; +type Bar = impl std::fmt::Display; fn bar1() -> Bar { "bar1" @@ -34,7 +34,7 @@ fn bar2() -> Bar { } // definition in submodule -existential type Boo: std::fmt::Display; +type Boo = impl std::fmt::Display; mod boo { pub fn boo() -> super::Boo { @@ -42,7 +42,7 @@ mod boo { } } -existential type MyIter: Iterator; +type MyIter = impl Iterator; fn my_iter(t: T) -> MyIter { std::iter::once(t) @@ -63,21 +63,21 @@ fn my_iter4(_: U, v: V) -> MyIter { } // param names should not have an effect! -existential type MyOtherIter: Iterator; +type MyOtherIter = impl Iterator; fn my_other_iter(u: U) -> MyOtherIter { std::iter::once(u) } trait Trait {} -existential type GenericBound<'a, T: Trait>: Sized + 'a; +type GenericBound<'a, T: Trait> = impl Sized + 'a; fn generic_bound<'a, T: Trait + 'a>(t: T) -> GenericBound<'a, T> { t } mod pass_through { - pub existential type Passthrough: Sized + 'static; + pub type Passthrough = impl Sized + 'static; fn define_passthrough(t: T) -> Passthrough { t diff --git a/src/test/ui/existential_types/existential_type_const.rs b/src/test/ui/existential_types/existential_type_const.rs index 646e9a73424..fdfd4ac8759 100644 --- a/src/test/ui/existential_types/existential_type_const.rs +++ b/src/test/ui/existential_types/existential_type_const.rs @@ -1,7 +1,7 @@ // check-pass -#![feature(existential_type)] -// Currently, the `existential_type` feature implicitly +#![feature(type_alias_impl_trait)] +// Currently, the `type_alias_impl_trait` feature implicitly // depends on `impl_trait_in_bindings` in order to work properly. // Specifically, this line requires `impl_trait_in_bindings` to be enabled: // https://github.com/rust-lang/rust/blob/481068a707679257e2a738b40987246e0420e787/src/librustc_typeck/check/mod.rs#L856 @@ -12,7 +12,7 @@ use std::fmt::Debug; -pub existential type Foo: Debug; +pub type Foo = impl Debug; const _FOO: Foo = 5; diff --git a/src/test/ui/existential_types/existential_type_fns.rs b/src/test/ui/existential_types/existential_type_fns.rs index 6f22eef2849..a22b12cae6b 100644 --- a/src/test/ui/existential_types/existential_type_fns.rs +++ b/src/test/ui/existential_types/existential_type_fns.rs @@ -1,6 +1,6 @@ // check-pass -#![feature(existential_type)] +#![feature(type_alias_impl_trait)] // Regression test for issue #61863 @@ -22,6 +22,6 @@ pub fn bla2() -> TE { } -existential type TE: MyTrait; +type TE = impl MyTrait; fn main() {} diff --git a/src/test/ui/existential_types/existential_type_tuple.rs b/src/test/ui/existential_types/existential_type_tuple.rs index 0f134a52897..86c9d482143 100644 --- a/src/test/ui/existential_types/existential_type_tuple.rs +++ b/src/test/ui/existential_types/existential_type_tuple.rs @@ -1,6 +1,6 @@ // check-pass -#![feature(existential_type)] +#![feature(type_alias_impl_trait)] #![allow(dead_code)] pub trait MyTrait {} @@ -28,6 +28,6 @@ fn make_foo() -> Foo { true } -existential type Foo: MyTrait; +type Foo = impl MyTrait; fn main() {} diff --git a/src/test/ui/existential_types/generic_different_defining_uses.rs b/src/test/ui/existential_types/generic_different_defining_uses.rs index ce3ab88a1c0..ac87c2d446a 100644 --- a/src/test/ui/existential_types/generic_different_defining_uses.rs +++ b/src/test/ui/existential_types/generic_different_defining_uses.rs @@ -1,8 +1,8 @@ -#![feature(existential_type)] +#![feature(type_alias_impl_trait)] fn main() {} -existential type MyIter: Iterator; +type MyIter = impl Iterator; fn my_iter(t: T) -> MyIter { std::iter::once(t) diff --git a/src/test/ui/existential_types/generic_duplicate_lifetime_param.rs b/src/test/ui/existential_types/generic_duplicate_lifetime_param.rs index e9943beddbf..e88aa07b6f0 100644 --- a/src/test/ui/existential_types/generic_duplicate_lifetime_param.rs +++ b/src/test/ui/existential_types/generic_duplicate_lifetime_param.rs @@ -1,8 +1,8 @@ -#![feature(existential_type)] +#![feature(type_alias_impl_trait)] fn main() {} -existential type Two<'a, 'b>: std::fmt::Debug; +type Two<'a, 'b> = impl std::fmt::Debug; fn one<'a>(t: &'a ()) -> Two<'a, 'a> { //~ ERROR non-defining existential type use t diff --git a/src/test/ui/existential_types/generic_duplicate_lifetime_param.stderr b/src/test/ui/existential_types/generic_duplicate_lifetime_param.stderr index 29bd252babe..f63defe8ff7 100644 --- a/src/test/ui/existential_types/generic_duplicate_lifetime_param.stderr +++ b/src/test/ui/existential_types/generic_duplicate_lifetime_param.stderr @@ -7,10 +7,10 @@ LL | | } | |_^ | note: lifetime used multiple times - --> $DIR/generic_duplicate_lifetime_param.rs:5:22 + --> $DIR/generic_duplicate_lifetime_param.rs:5:10 | -LL | existential type Two<'a, 'b>: std::fmt::Debug; - | ^^ ^^ +LL | type Two<'a, 'b> = impl std::fmt::Debug; + | ^^ ^^ error: aborting due to previous error diff --git a/src/test/ui/existential_types/generic_duplicate_param_use.rs b/src/test/ui/existential_types/generic_duplicate_param_use.rs index 3f8753333aa..7ae82a972da 100644 --- a/src/test/ui/existential_types/generic_duplicate_param_use.rs +++ b/src/test/ui/existential_types/generic_duplicate_param_use.rs @@ -1,11 +1,11 @@ -#![feature(existential_type)] +#![feature(type_alias_impl_trait)] use std::fmt::Debug; fn main() {} // test that unused generic parameters are ok -existential type Two: Debug; +type Two = impl Debug; //~^ could not find defining uses fn one(t: T) -> Two { diff --git a/src/test/ui/existential_types/generic_duplicate_param_use.stderr b/src/test/ui/existential_types/generic_duplicate_param_use.stderr index a3827943b6d..8c727bae8e7 100644 --- a/src/test/ui/existential_types/generic_duplicate_param_use.stderr +++ b/src/test/ui/existential_types/generic_duplicate_param_use.stderr @@ -10,8 +10,8 @@ LL | | } error: could not find defining uses --> $DIR/generic_duplicate_param_use.rs:8:1 | -LL | existential type Two: Debug; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | type Two = impl Debug; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/existential_types/generic_duplicate_param_use10.rs b/src/test/ui/existential_types/generic_duplicate_param_use10.rs index 0d9c7cdfe71..898dab1b0b9 100644 --- a/src/test/ui/existential_types/generic_duplicate_param_use10.rs +++ b/src/test/ui/existential_types/generic_duplicate_param_use10.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 Two: Debug; +type Two = impl Debug; fn two(t: T, _: U) -> Two { (t, 4u32) diff --git a/src/test/ui/existential_types/generic_duplicate_param_use2.rs b/src/test/ui/existential_types/generic_duplicate_param_use2.rs index 3842292decd..cf3f5fd8e00 100644 --- a/src/test/ui/existential_types/generic_duplicate_param_use2.rs +++ b/src/test/ui/existential_types/generic_duplicate_param_use2.rs @@ -1,11 +1,11 @@ -#![feature(existential_type)] +#![feature(type_alias_impl_trait)] use std::fmt::Debug; fn main() {} // test that unused generic parameters are ok -existential type Two: Debug; +type Two = impl Debug; fn one(t: T) -> Two { //~^ defining existential type use restricts existential type diff --git a/src/test/ui/existential_types/generic_duplicate_param_use3.rs b/src/test/ui/existential_types/generic_duplicate_param_use3.rs index 05c77c89473..b980e831b73 100644 --- a/src/test/ui/existential_types/generic_duplicate_param_use3.rs +++ b/src/test/ui/existential_types/generic_duplicate_param_use3.rs @@ -1,11 +1,11 @@ -#![feature(existential_type)] +#![feature(type_alias_impl_trait)] use std::fmt::Debug; fn main() {} // test that unused generic parameters are ok -existential type Two: Debug; +type Two = impl Debug; fn one(t: T) -> Two { //~^ defining existential type use restricts existential type diff --git a/src/test/ui/existential_types/generic_duplicate_param_use4.rs b/src/test/ui/existential_types/generic_duplicate_param_use4.rs index 609dbe06cd7..34a4a1ed53b 100644 --- a/src/test/ui/existential_types/generic_duplicate_param_use4.rs +++ b/src/test/ui/existential_types/generic_duplicate_param_use4.rs @@ -1,11 +1,11 @@ -#![feature(existential_type)] +#![feature(type_alias_impl_trait)] use std::fmt::Debug; fn main() {} // test that unused generic parameters are ok -existential type Two: Debug; +type Two = impl Debug; fn one(t: T) -> Two { //~^ ERROR defining existential type use restricts existential type diff --git a/src/test/ui/existential_types/generic_duplicate_param_use5.rs b/src/test/ui/existential_types/generic_duplicate_param_use5.rs index 3f4a23b8b41..ac877310414 100644 --- a/src/test/ui/existential_types/generic_duplicate_param_use5.rs +++ b/src/test/ui/existential_types/generic_duplicate_param_use5.rs @@ -1,11 +1,11 @@ -#![feature(existential_type)] +#![feature(type_alias_impl_trait)] use std::fmt::Debug; fn main() {} // test that unused generic parameters are ok -existential type Two: Debug; +type Two = impl Debug; fn two(t: T, u: U) -> Two { (t, u) diff --git a/src/test/ui/existential_types/generic_duplicate_param_use6.rs b/src/test/ui/existential_types/generic_duplicate_param_use6.rs index 3b8c56352bd..59e7de413a2 100644 --- a/src/test/ui/existential_types/generic_duplicate_param_use6.rs +++ b/src/test/ui/existential_types/generic_duplicate_param_use6.rs @@ -1,11 +1,11 @@ -#![feature(existential_type)] +#![feature(type_alias_impl_trait)] use std::fmt::Debug; fn main() {} // test that unused generic parameters are ok -existential type Two: Debug; +type Two = impl Debug; fn two(t: T, u: U) -> Two { (t, t) diff --git a/src/test/ui/existential_types/generic_duplicate_param_use7.rs b/src/test/ui/existential_types/generic_duplicate_param_use7.rs index 56e1528c213..712a6539f01 100644 --- a/src/test/ui/existential_types/generic_duplicate_param_use7.rs +++ b/src/test/ui/existential_types/generic_duplicate_param_use7.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 Two: Debug; +type Two = impl Debug; fn two(t: T, u: U) -> Two { (t, t) diff --git a/src/test/ui/existential_types/generic_duplicate_param_use8.rs b/src/test/ui/existential_types/generic_duplicate_param_use8.rs index 83501ad8c41..777ded52609 100644 --- a/src/test/ui/existential_types/generic_duplicate_param_use8.rs +++ b/src/test/ui/existential_types/generic_duplicate_param_use8.rs @@ -1,10 +1,10 @@ -#![feature(existential_type)] +#![feature(type_alias_impl_trait)] use std::fmt::Debug; fn main() {} -existential type Two: Debug; +type Two = impl Debug; fn two(t: T, _: U) -> Two { (t, 4u32) diff --git a/src/test/ui/existential_types/generic_duplicate_param_use9.rs b/src/test/ui/existential_types/generic_duplicate_param_use9.rs index 4c6897298c4..491e6647f45 100644 --- a/src/test/ui/existential_types/generic_duplicate_param_use9.rs +++ b/src/test/ui/existential_types/generic_duplicate_param_use9.rs @@ -1,10 +1,10 @@ -#![feature(existential_type)] +#![feature(type_alias_impl_trait)] use std::fmt::Debug; fn main() {} -existential type Two: Debug; +type Two = impl Debug; trait Foo { type Bar: Debug; diff --git a/src/test/ui/existential_types/generic_lifetime_param.rs b/src/test/ui/existential_types/generic_lifetime_param.rs index 1ea01f17b70..e109c38c986 100644 --- a/src/test/ui/existential_types/generic_lifetime_param.rs +++ b/src/test/ui/existential_types/generic_lifetime_param.rs @@ -1,10 +1,10 @@ // build-pass (FIXME(62277): could be check-pass?) -#![feature(existential_type)] +#![feature(type_alias_impl_trait)] fn main() {} -existential type Region<'a>: std::fmt::Debug; +type Region<'a> = impl std::fmt::Debug; fn region<'b>(a: &'b ()) -> Region<'b> { a diff --git a/src/test/ui/existential_types/generic_nondefining_use.rs b/src/test/ui/existential_types/generic_nondefining_use.rs index ffc965aca47..e98445e3a0f 100644 --- a/src/test/ui/existential_types/generic_nondefining_use.rs +++ b/src/test/ui/existential_types/generic_nondefining_use.rs @@ -1,8 +1,8 @@ -#![feature(existential_type)] +#![feature(type_alias_impl_trait)] fn main() {} -existential type Cmp: 'static; +type Cmp = impl 'static; //~^ ERROR could not find defining uses //~^^ ERROR: at least one trait must be specified diff --git a/src/test/ui/existential_types/generic_nondefining_use.stderr b/src/test/ui/existential_types/generic_nondefining_use.stderr index d205d44c68c..e50d545a8ad 100644 --- a/src/test/ui/existential_types/generic_nondefining_use.stderr +++ b/src/test/ui/existential_types/generic_nondefining_use.stderr @@ -1,8 +1,8 @@ error: at least one trait must be specified - --> $DIR/generic_nondefining_use.rs:5:26 + --> $DIR/generic_nondefining_use.rs:5:20 | -LL | existential type Cmp: 'static; - | ^^^^^^^ +LL | type Cmp = impl 'static; + | ^^^^^^^ error: defining existential type use does not fully define existential type --> $DIR/generic_nondefining_use.rs:11:1 @@ -15,8 +15,8 @@ LL | | } error: could not find defining uses --> $DIR/generic_nondefining_use.rs:5:1 | -LL | existential type Cmp: 'static; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | type Cmp = impl 'static; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 3 previous errors diff --git a/src/test/ui/existential_types/generic_not_used.rs b/src/test/ui/existential_types/generic_not_used.rs index 054e6f5f2ad..ace52dc83ad 100644 --- a/src/test/ui/existential_types/generic_not_used.rs +++ b/src/test/ui/existential_types/generic_not_used.rs @@ -1,8 +1,8 @@ -#![feature(existential_type)] +#![feature(type_alias_impl_trait)] fn main() {} -existential type WrongGeneric: 'static; +type WrongGeneric = impl 'static; //~^ ERROR: at least one trait must be specified fn wrong_generic(_: U, v: V) -> WrongGeneric { diff --git a/src/test/ui/existential_types/generic_not_used.stderr b/src/test/ui/existential_types/generic_not_used.stderr index d243233992b..250296d9de9 100644 --- a/src/test/ui/existential_types/generic_not_used.stderr +++ b/src/test/ui/existential_types/generic_not_used.stderr @@ -1,8 +1,8 @@ error: at least one trait must be specified - --> $DIR/generic_not_used.rs:5:44 + --> $DIR/generic_not_used.rs:5:38 | -LL | existential type WrongGeneric: 'static; - | ^^^^^^^ +LL | type WrongGeneric = impl 'static; + | ^^^^^^^ error: type parameter `V` is part of concrete type but not used in parameter list for existential type --> $DIR/generic_not_used.rs:8:73 diff --git a/src/test/ui/existential_types/generic_type_does_not_live_long_enough.rs b/src/test/ui/existential_types/generic_type_does_not_live_long_enough.rs index d9eedd6dca7..c0f939a5048 100644 --- a/src/test/ui/existential_types/generic_type_does_not_live_long_enough.rs +++ b/src/test/ui/existential_types/generic_type_does_not_live_long_enough.rs @@ -1,4 +1,4 @@ -#![feature(existential_type)] +#![feature(type_alias_impl_trait)] fn main() { let y = 42; @@ -6,7 +6,7 @@ fn main() { let z: i32 = x; //~ ERROR mismatched types } -existential type WrongGeneric: 'static; +type WrongGeneric = impl 'static; //~^ ERROR the parameter type `T` may not live long enough //~^^ ERROR: at least one trait must be specified diff --git a/src/test/ui/existential_types/generic_type_does_not_live_long_enough.stderr b/src/test/ui/existential_types/generic_type_does_not_live_long_enough.stderr index 2f76eea4460..12569211df3 100644 --- a/src/test/ui/existential_types/generic_type_does_not_live_long_enough.stderr +++ b/src/test/ui/existential_types/generic_type_does_not_live_long_enough.stderr @@ -1,8 +1,8 @@ error: at least one trait must be specified - --> $DIR/generic_type_does_not_live_long_enough.rs:9:35 + --> $DIR/generic_type_does_not_live_long_enough.rs:9:29 | -LL | existential type WrongGeneric: 'static; - | ^^^^^^^ +LL | type WrongGeneric = impl 'static; + | ^^^^^^^ error[E0308]: mismatched types --> $DIR/generic_type_does_not_live_long_enough.rs:6:18 @@ -16,8 +16,8 @@ LL | let z: i32 = x; error[E0310]: the parameter type `T` may not live long enough --> $DIR/generic_type_does_not_live_long_enough.rs:9:1 | -LL | existential type WrongGeneric: 'static; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | type WrongGeneric = impl 'static; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ... LL | fn wrong_generic(t: T) -> WrongGeneric { | - help: consider adding an explicit lifetime bound `T: 'static`... @@ -25,8 +25,8 @@ LL | fn wrong_generic(t: T) -> WrongGeneric { note: ...so that the type `T` will meet its required lifetime bounds --> $DIR/generic_type_does_not_live_long_enough.rs:9:1 | -LL | existential type WrongGeneric: 'static; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | type WrongGeneric = impl 'static; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 3 previous errors diff --git a/src/test/ui/existential_types/generic_underconstrained.rs b/src/test/ui/existential_types/generic_underconstrained.rs index cc0db893c6a..589612d5ed6 100644 --- a/src/test/ui/existential_types/generic_underconstrained.rs +++ b/src/test/ui/existential_types/generic_underconstrained.rs @@ -1,9 +1,9 @@ -#![feature(existential_type)] +#![feature(type_alias_impl_trait)] fn main() {} trait Trait {} -existential type Underconstrained: 'static; //~ ERROR the trait bound `T: Trait` +type Underconstrained = impl 'static; //~ ERROR the trait bound `T: Trait` //~^ ERROR: at least one trait must be specified // no `Trait` bound diff --git a/src/test/ui/existential_types/generic_underconstrained.stderr b/src/test/ui/existential_types/generic_underconstrained.stderr index 35083a53eb3..dd90dd1b06f 100644 --- a/src/test/ui/existential_types/generic_underconstrained.stderr +++ b/src/test/ui/existential_types/generic_underconstrained.stderr @@ -1,14 +1,14 @@ error: at least one trait must be specified - --> $DIR/generic_underconstrained.rs:6:46 + --> $DIR/generic_underconstrained.rs:6:40 | -LL | existential type Underconstrained: 'static; - | ^^^^^^^ +LL | type Underconstrained = impl 'static; + | ^^^^^^^ error[E0277]: the trait bound `T: Trait` is not satisfied --> $DIR/generic_underconstrained.rs:6:1 | -LL | existential type Underconstrained: 'static; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `T` +LL | type Underconstrained = impl 'static; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `T` | = help: consider adding a `where T: Trait` bound = note: the return type of a function must have a statically known size diff --git a/src/test/ui/existential_types/generic_underconstrained2.rs b/src/test/ui/existential_types/generic_underconstrained2.rs index c6263eacd53..87b8aaad957 100644 --- a/src/test/ui/existential_types/generic_underconstrained2.rs +++ b/src/test/ui/existential_types/generic_underconstrained2.rs @@ -1,8 +1,8 @@ -#![feature(existential_type)] +#![feature(type_alias_impl_trait)] fn main() {} -existential type Underconstrained: 'static; +type Underconstrained = impl 'static; //~^ ERROR `U` doesn't implement `std::fmt::Debug` //~^^ ERROR: at least one trait must be specified @@ -11,7 +11,7 @@ fn underconstrained(_: U) -> Underconstrained { 5u32 } -existential type Underconstrained2: 'static; +type Underconstrained2 = impl 'static; //~^ ERROR `V` doesn't implement `std::fmt::Debug` //~^^ ERROR: at least one trait must be specified diff --git a/src/test/ui/existential_types/generic_underconstrained2.stderr b/src/test/ui/existential_types/generic_underconstrained2.stderr index 6ff783f33b9..574432bdcf6 100644 --- a/src/test/ui/existential_types/generic_underconstrained2.stderr +++ b/src/test/ui/existential_types/generic_underconstrained2.stderr @@ -1,20 +1,20 @@ error: at least one trait must be specified - --> $DIR/generic_underconstrained2.rs:5:56 + --> $DIR/generic_underconstrained2.rs:5:50 | -LL | existential type Underconstrained: 'static; - | ^^^^^^^ +LL | type Underconstrained = impl 'static; + | ^^^^^^^ error: at least one trait must be specified - --> $DIR/generic_underconstrained2.rs:14:57 + --> $DIR/generic_underconstrained2.rs:14:51 | -LL | existential type Underconstrained2: 'static; - | ^^^^^^^ +LL | type Underconstrained2 = impl 'static; + | ^^^^^^^ error[E0277]: `U` doesn't implement `std::fmt::Debug` --> $DIR/generic_underconstrained2.rs:5:1 | -LL | existential type Underconstrained: 'static; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `U` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug` +LL | type Underconstrained = impl 'static; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `U` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug` | = help: the trait `std::fmt::Debug` is not implemented for `U` = help: consider adding a `where U: std::fmt::Debug` bound @@ -23,8 +23,8 @@ LL | existential type Underconstrained: 'static; error[E0277]: `V` doesn't implement `std::fmt::Debug` --> $DIR/generic_underconstrained2.rs:14:1 | -LL | existential type Underconstrained2: 'static; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `V` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug` +LL | type Underconstrained2 = impl 'static; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `V` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug` | = help: the trait `std::fmt::Debug` is not implemented for `V` = help: consider adding a `where V: std::fmt::Debug` bound diff --git a/src/test/ui/existential_types/issue-58887.rs b/src/test/ui/existential_types/issue-58887.rs index f038648ec21..92ba50ae6cf 100644 --- a/src/test/ui/existential_types/issue-58887.rs +++ b/src/test/ui/existential_types/issue-58887.rs @@ -1,4 +1,4 @@ -#![feature(existential_type)] +#![feature(type_alias_impl_trait)] trait UnwrapItemsExt { type Iter; @@ -10,7 +10,7 @@ where I: Iterator>, E: std::fmt::Debug, { - existential type Iter: Iterator; + type Iter = impl Iterator; //~^ ERROR: could not find defining uses fn unwrap_items(self) -> Self::Iter { diff --git a/src/test/ui/existential_types/issue-58887.stderr b/src/test/ui/existential_types/issue-58887.stderr index 800f4b7e059..cb786f5e161 100644 --- a/src/test/ui/existential_types/issue-58887.stderr +++ b/src/test/ui/existential_types/issue-58887.stderr @@ -23,8 +23,8 @@ LL | | } error: could not find defining uses --> $DIR/issue-58887.rs:13:5 | -LL | existential type Iter: Iterator; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | type Iter = impl Iterator; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 3 previous errors diff --git a/src/test/ui/existential_types/issue-60371.rs b/src/test/ui/existential_types/issue-60371.rs index f9def11d193..cfb343f96ca 100644 --- a/src/test/ui/existential_types/issue-60371.rs +++ b/src/test/ui/existential_types/issue-60371.rs @@ -5,7 +5,7 @@ trait Bug { } impl Bug for &() { - existential type Item: Bug; //~ ERROR existential types are unstable + type Item = impl Bug; //~ ERROR existential types are unstable //~^ ERROR the trait bound `(): Bug` is not satisfied //~^^ ERROR could not find defining uses diff --git a/src/test/ui/existential_types/issue-60371.stderr b/src/test/ui/existential_types/issue-60371.stderr index 092cb31f97d..34936c73a46 100644 --- a/src/test/ui/existential_types/issue-60371.stderr +++ b/src/test/ui/existential_types/issue-60371.stderr @@ -1,17 +1,17 @@ error[E0658]: existential types are unstable --> $DIR/issue-60371.rs:8:5 | -LL | existential type Item: Bug; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | type Item = impl Bug; + | ^^^^^^^^^^^^^^^^^^^^^ | = note: for more information, see https://github.com/rust-lang/rust/issues/63063 - = help: add `#![feature(existential_type)]` to the crate attributes to enable + = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable error[E0277]: the trait bound `(): Bug` is not satisfied --> $DIR/issue-60371.rs:8:5 | -LL | existential type Item: Bug; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Bug` is not implemented for `()` +LL | type Item = impl Bug; + | ^^^^^^^^^^^^^^^^^^^^^ the trait `Bug` is not implemented for `()` | = help: the following implementations were found: <&() as Bug> @@ -20,8 +20,8 @@ LL | existential type Item: Bug; error: could not find defining uses --> $DIR/issue-60371.rs:8:5 | -LL | existential type Item: Bug; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | type Item = impl Bug; + | ^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 3 previous errors diff --git a/src/test/ui/existential_types/nested_existential_types.rs b/src/test/ui/existential_types/nested_existential_types.rs index de52e88bae2..82c9ecd2ac6 100644 --- a/src/test/ui/existential_types/nested_existential_types.rs +++ b/src/test/ui/existential_types/nested_existential_types.rs @@ -1,10 +1,10 @@ -#![feature(existential_type)] +#![feature(type_alias_impl_trait)] // build-pass (FIXME(62277): could be check-pass?) mod my_mod { use std::fmt::Debug; - pub existential type Foo: Debug; - pub existential type Foot: Debug; + pub type Foo = impl Debug; + pub type Foot = impl Debug; pub fn get_foo() -> Foo { 5i32 diff --git a/src/test/ui/existential_types/never_reveal_concrete_type.rs b/src/test/ui/existential_types/never_reveal_concrete_type.rs index 04da394848e..8787c023eb0 100644 --- a/src/test/ui/existential_types/never_reveal_concrete_type.rs +++ b/src/test/ui/existential_types/never_reveal_concrete_type.rs @@ -1,9 +1,9 @@ -#![feature(existential_type)] +#![feature(type_alias_impl_trait)] fn main() {} // don't reveal the concrete type -existential type NoReveal: std::fmt::Debug; +type NoReveal = impl std::fmt::Debug; fn define_no_reveal() -> NoReveal { "" diff --git a/src/test/ui/existential_types/no_inferrable_concrete_type.rs b/src/test/ui/existential_types/no_inferrable_concrete_type.rs index eec8a4be63d..f096dd162d5 100644 --- a/src/test/ui/existential_types/no_inferrable_concrete_type.rs +++ b/src/test/ui/existential_types/no_inferrable_concrete_type.rs @@ -1,9 +1,9 @@ // Issue 52985: user code provides no use case that allows an existential type // We now emit a 'could not find defining uses' error -#![feature(existential_type)] +#![feature(type_alias_impl_trait)] -existential type Foo: Copy; //~ could not find defining uses +type Foo = impl Copy; //~ could not find defining uses // make compiler happy about using 'Foo' fn bar(x: Foo) -> Foo { x } diff --git a/src/test/ui/existential_types/no_inferrable_concrete_type.stderr b/src/test/ui/existential_types/no_inferrable_concrete_type.stderr index bc9a883c836..444e6e8214f 100644 --- a/src/test/ui/existential_types/no_inferrable_concrete_type.stderr +++ b/src/test/ui/existential_types/no_inferrable_concrete_type.stderr @@ -1,8 +1,8 @@ error: could not find defining uses --> $DIR/no_inferrable_concrete_type.rs:6:1 | -LL | existential type Foo: Copy; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | type Foo = impl Copy; + | ^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/existential_types/no_revealing_outside_defining_module.rs b/src/test/ui/existential_types/no_revealing_outside_defining_module.rs index 04793c67b56..61153b1e171 100644 --- a/src/test/ui/existential_types/no_revealing_outside_defining_module.rs +++ b/src/test/ui/existential_types/no_revealing_outside_defining_module.rs @@ -1,9 +1,9 @@ -#![feature(existential_type)] +#![feature(type_alias_impl_trait)] fn main() {} mod boo { - pub existential type Boo: ::std::fmt::Debug; + pub type Boo = impl ::std::fmt::Debug; fn bomp() -> Boo { "" } diff --git a/src/test/ui/existential_types/not_a_defining_use.rs b/src/test/ui/existential_types/not_a_defining_use.rs index 3f81f5177d0..c49e9bc80f6 100644 --- a/src/test/ui/existential_types/not_a_defining_use.rs +++ b/src/test/ui/existential_types/not_a_defining_use.rs @@ -1,10 +1,10 @@ -#![feature(existential_type)] +#![feature(type_alias_impl_trait)] use std::fmt::Debug; fn main() {} -existential type Two: Debug; +type Two = impl Debug; fn two(t: T) -> Two { //~^ ERROR defining existential type use does not fully define existential type diff --git a/src/test/ui/existential_types/not_well_formed.rs b/src/test/ui/existential_types/not_well_formed.rs index 073fa90cb35..36ec9b34ebd 100644 --- a/src/test/ui/existential_types/not_well_formed.rs +++ b/src/test/ui/existential_types/not_well_formed.rs @@ -1,4 +1,4 @@ -#![feature(existential_type)] +#![feature(type_alias_impl_trait)] fn main() { } @@ -7,7 +7,7 @@ trait TraitWithAssoc { type Assoc; } -existential type Foo: Trait; //~ associated type `Assoc` not found for `V` +type Foo = impl Trait; //~ associated type `Assoc` not found for `V` trait Trait {} diff --git a/src/test/ui/existential_types/not_well_formed.stderr b/src/test/ui/existential_types/not_well_formed.stderr index 05f84d57623..d374d6d33ee 100644 --- a/src/test/ui/existential_types/not_well_formed.stderr +++ b/src/test/ui/existential_types/not_well_formed.stderr @@ -1,8 +1,8 @@ error[E0220]: associated type `Assoc` not found for `V` - --> $DIR/not_well_formed.rs:10:32 + --> $DIR/not_well_formed.rs:10:26 | -LL | existential type Foo: Trait; - | ^^^^^^^^ associated type `Assoc` not found +LL | type Foo = impl Trait; + | ^^^^^^^^ associated type `Assoc` not found error: aborting due to previous error diff --git a/src/test/ui/existential_types/unused_generic_param.rs b/src/test/ui/existential_types/unused_generic_param.rs index 5455b39f4cb..a9ab727b193 100644 --- a/src/test/ui/existential_types/unused_generic_param.rs +++ b/src/test/ui/existential_types/unused_generic_param.rs @@ -1,16 +1,16 @@ -#![feature(existential_type)] +#![feature(type_alias_impl_trait)] fn main() { } -existential type PartiallyDefined: 'static; +type PartiallyDefined = impl 'static; //~^ ERROR: at least one trait must be specified fn partially_defined(_: T) -> PartiallyDefined { 4u32 } -existential type PartiallyDefined2: 'static; +type PartiallyDefined2 = impl 'static; //~^ ERROR: at least one trait must be specified fn partially_defined2(_: T) -> PartiallyDefined2 { diff --git a/src/test/ui/existential_types/unused_generic_param.stderr b/src/test/ui/existential_types/unused_generic_param.stderr index 9d628d069d3..23105026964 100644 --- a/src/test/ui/existential_types/unused_generic_param.stderr +++ b/src/test/ui/existential_types/unused_generic_param.stderr @@ -1,14 +1,14 @@ error: at least one trait must be specified - --> $DIR/unused_generic_param.rs:6:39 + --> $DIR/unused_generic_param.rs:6:33 | -LL | existential type PartiallyDefined: 'static; - | ^^^^^^^ +LL | type PartiallyDefined = impl 'static; + | ^^^^^^^ error: at least one trait must be specified - --> $DIR/unused_generic_param.rs:13:40 + --> $DIR/unused_generic_param.rs:13:34 | -LL | existential type PartiallyDefined2: 'static; - | ^^^^^^^ +LL | type PartiallyDefined2 = impl 'static; + | ^^^^^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/impl-trait/associated-existential-type-generic-trait.rs b/src/test/ui/impl-trait/associated-existential-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-existential-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 { } impl Foo 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 Foo 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-existential-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-existential-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-existential-type.rs index 58966aefe1c..d0661d66f4b 100644 --- a/src/test/ui/impl-trait/associated-existential-type.rs +++ b/src/test/ui/impl-trait/associated-existential-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 ` as FooLike>::Output == ::Assoc` - --> $DIR/bound-normalization-fail.rs:30:32 + --> $DIR/bound-normalization-fail.rs:29:32 | LL | fn foo_fail() -> impl FooLike { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found associated type @@ -17,7 +17,7 @@ LL | fn foo_fail() -> impl FooLike { = note: the return type of a function must have a statically known size error[E0271]: type mismatch resolving ` as FooLike>::Output == >::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 { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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..33348340bce 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 @@ -99,7 +99,7 @@ mod existential_types { type Out = u8; } - existential type Ex: Trait::Assoc>; + type Ex = impl Trait::Assoc>; fn define() -> Ex { () diff --git a/src/test/ui/impl-trait/existential_type_in_fn_body.rs b/src/test/ui/impl-trait/existential_type_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/existential_type_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/issue-55872-1.rs b/src/test/ui/impl-trait/issue-55872-1.rs index 5095b26f8a4..c127e4cef49 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,7 +9,7 @@ pub trait Bar } impl 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] diff --git a/src/test/ui/impl-trait/issue-55872-1.stderr b/src/test/ui/impl-trait/issue-55872-1.stderr index 04b4d2d4a50..8a429626a5b 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,8 +11,8 @@ 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)` diff --git a/src/test/ui/impl-trait/issue-55872-2.rs b/src/test/ui/impl-trait/issue-55872-2.rs index 2bdeb14bdc3..d7432bda839 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,7 +9,7 @@ pub trait Bar { } impl 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() -> Self::E { //~^ ERROR type parameter `T` is part of concrete type but not used in parameter list for existential type diff --git a/src/test/ui/impl-trait/issue-55872-2.stderr b/src/test/ui/impl-trait/issue-55872-2.stderr index 2505a82ee23..c9cc178d3f8 100644 --- a/src/test/ui/impl-trait/issue-55872-2.stderr +++ b/src/test/ui/impl-trait/issue-55872-2.stderr @@ -1,8 +1,8 @@ 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 diff --git a/src/test/ui/impl-trait/issue-55872.rs b/src/test/ui/impl-trait/issue-55872.rs index 95604545c37..bf2c5c82208 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,7 +8,7 @@ pub trait Bar { } impl Bar for S { - existential type E: Copy; + type E = impl Copy; fn foo() -> Self::E { //~^ ERROR type parameter `T` is part of concrete type but not used in parameter list for existential type 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: 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); impl Copy for CopyIfEq {} -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-existential.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-existential.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 Trait<'_, '_> for T { } @@ -12,7 +12,7 @@ impl 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/where-allowed.rs b/src/test/ui/impl-trait/where-allowed.rs index 31bc9f449a0..5b6105421fe 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 existential types are 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 = impl Debug; -//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types +//~^ ERROR existential types are unstable +//~^^ ERROR could not find defining uses type InReturnInTypeAlias = 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..08f456199e9 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]: existential types are 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]: existential types are unstable + --> $DIR/where-allowed.rs:158:1 + | +LL | type InTypeAlias = 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 = 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 = 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 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 { | ^^^^^^^^^^ 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: 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 | ^^^^^^^^^^ 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 = impl Debug; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -For more information about this error, try `rustc --explain E0562`. +error: could not find defining uses + --> $DIR/where-allowed.rs:122:5 + | +LL | type Out = impl Debug; + | ^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 41 previous errors + +Some errors have detailed explanations: E0562, E0658. +For more information about an error, try `rustc --explain E0562`. diff --git a/src/test/ui/issues/issue-58856-2.rs b/src/test/ui/issues/issue-58856-2.rs index acc38e4c201..745f0300bd5 100644 --- a/src/test/ui/issues/issue-58856-2.rs +++ b/src/test/ui/issues/issue-58856-2.rs @@ -9,6 +9,6 @@ impl Howness for () { Empty } } -//~^ ERROR expected one of `async`, `const`, `crate`, `default`, `existential`, `extern`, `fn`, +//~^ ERROR expected one of `async`, `const`, `crate`, `default`, `extern`, `fn`, fn main() {} diff --git a/src/test/ui/issues/issue-58856-2.stderr b/src/test/ui/issues/issue-58856-2.stderr index b760fd6768a..a83dd674a87 100644 --- a/src/test/ui/issues/issue-58856-2.stderr +++ b/src/test/ui/issues/issue-58856-2.stderr @@ -7,11 +7,11 @@ LL | fn how_are_you(&self -> Empty { | | help: `)` may belong here | unclosed delimiter -error: expected one of `async`, `const`, `crate`, `default`, `existential`, `extern`, `fn`, `pub`, `type`, `unsafe`, or `}`, found `)` +error: expected one of `async`, `const`, `crate`, `default`, `extern`, `fn`, `pub`, `type`, `unsafe`, or `}`, found `)` --> $DIR/issue-58856-2.rs:11:1 | LL | } - | - expected one of 11 possible tokens here + | - expected one of 10 possible tokens here LL | } | ^ unexpected token diff --git a/src/test/ui/issues/issue-60662.rs b/src/test/ui/issues/issue-60662.rs index dca1e5979ef..dcf935c5780 100644 --- a/src/test/ui/issues/issue-60662.rs +++ b/src/test/ui/issues/issue-60662.rs @@ -1,11 +1,11 @@ // build-pass (FIXME(62277): could be check-pass?) // compile-flags: -Z unpretty=hir -#![feature(existential_type)] +#![feature(type_alias_impl_trait)] trait Animal { } fn main() { - pub existential type ServeFut: Animal; + pub type ServeFut = impl Animal; } diff --git a/src/test/ui/issues/issue-60662.stdout b/src/test/ui/issues/issue-60662.stdout index 139808974c6..6389c86ecf7 100644 --- a/src/test/ui/issues/issue-60662.stdout +++ b/src/test/ui/issues/issue-60662.stdout @@ -1,7 +1,7 @@ // build-pass (FIXME(62277): could be check-pass?) // compile-flags: -Z unpretty=hir -#![feature(existential_type)] +#![feature(type_alias_impl_trait)] #[prelude_import] use ::std::prelude::v1::*; #[macro_use] diff --git a/src/test/ui/parser/default.stderr b/src/test/ui/parser/default.stderr index ded088acfc4..e199045134e 100644 --- a/src/test/ui/parser/default.stderr +++ b/src/test/ui/parser/default.stderr @@ -1,8 +1,8 @@ -error: expected one of `async`, `const`, `existential`, `extern`, `fn`, `type`, or `unsafe`, found `pub` +error: expected one of `async`, `const`, `extern`, `fn`, `type`, or `unsafe`, found `pub` --> $DIR/default.rs:22:13 | LL | default pub fn foo() -> T { T::default() } - | ^^^ expected one of 7 possible tokens here + | ^^^ expected one of `async`, `const`, `extern`, `fn`, `type`, or `unsafe` here error[E0449]: unnecessary visibility qualifier --> $DIR/default.rs:16:5 diff --git a/src/test/ui/parser/issue-20711-2.rs b/src/test/ui/parser/issue-20711-2.rs index 49b8de03c37..0063a334182 100644 --- a/src/test/ui/parser/issue-20711-2.rs +++ b/src/test/ui/parser/issue-20711-2.rs @@ -1,11 +1,9 @@ -// ignore-tidy-linelength - struct Foo; impl Foo { fn foo() {} #[stable(feature = "rust1", since = "1.0.0")] -} //~ ERROR expected one of `async`, `const`, `crate`, `default`, `existential`, `extern`, `fn`, `pub`, `type`, or +} //~ ERROR expected one of `async`, `const`, `crate`, `default`, `extern`, `fn`, `pub`, `type`, or fn main() {} diff --git a/src/test/ui/parser/issue-20711-2.stderr b/src/test/ui/parser/issue-20711-2.stderr index f67dfa09aca..56749c107d1 100644 --- a/src/test/ui/parser/issue-20711-2.stderr +++ b/src/test/ui/parser/issue-20711-2.stderr @@ -1,8 +1,8 @@ -error: expected one of `async`, `const`, `crate`, `default`, `existential`, `extern`, `fn`, `pub`, `type`, or `unsafe`, found `}` - --> $DIR/issue-20711-2.rs:9:1 +error: expected one of `async`, `const`, `crate`, `default`, `extern`, `fn`, `pub`, `type`, or `unsafe`, found `}` + --> $DIR/issue-20711-2.rs:7:1 | LL | #[stable(feature = "rust1", since = "1.0.0")] - | - expected one of 10 possible tokens here + | - expected one of 9 possible tokens here LL | } | ^ unexpected token diff --git a/src/test/ui/parser/issue-20711.rs b/src/test/ui/parser/issue-20711.rs index 8d8401da61a..dc216167b8a 100644 --- a/src/test/ui/parser/issue-20711.rs +++ b/src/test/ui/parser/issue-20711.rs @@ -1,9 +1,7 @@ -// ignore-tidy-linelength - struct Foo; impl Foo { #[stable(feature = "rust1", since = "1.0.0")] -} //~ ERROR expected one of `async`, `const`, `crate`, `default`, `existential`, `extern`, `fn`, `pub`, `type`, or +} //~ ERROR expected one of `async`, `const`, `crate`, `default`, `extern`, `fn`, `pub`, `type`, or fn main() {} diff --git a/src/test/ui/parser/issue-20711.stderr b/src/test/ui/parser/issue-20711.stderr index 26b819fa298..f7b99a91b51 100644 --- a/src/test/ui/parser/issue-20711.stderr +++ b/src/test/ui/parser/issue-20711.stderr @@ -1,8 +1,8 @@ -error: expected one of `async`, `const`, `crate`, `default`, `existential`, `extern`, `fn`, `pub`, `type`, or `unsafe`, found `}` - --> $DIR/issue-20711.rs:7:1 +error: expected one of `async`, `const`, `crate`, `default`, `extern`, `fn`, `pub`, `type`, or `unsafe`, found `}` + --> $DIR/issue-20711.rs:5:1 | LL | #[stable(feature = "rust1", since = "1.0.0")] - | - expected one of 10 possible tokens here + | - expected one of 9 possible tokens here LL | } | ^ unexpected token diff --git a/src/test/ui/parser/issue-41155.stderr b/src/test/ui/parser/issue-41155.stderr index 719845e6999..624d1a3d11e 100644 --- a/src/test/ui/parser/issue-41155.stderr +++ b/src/test/ui/parser/issue-41155.stderr @@ -1,8 +1,8 @@ -error: expected one of `(`, `async`, `const`, `default`, `existential`, `extern`, `fn`, `type`, or `unsafe`, found `}` +error: expected one of `(`, `async`, `const`, `default`, `extern`, `fn`, `type`, or `unsafe`, found `}` --> $DIR/issue-41155.rs:5:1 | LL | pub - | - expected one of 9 possible tokens here + | - expected one of 8 possible tokens here LL | } | ^ unexpected token diff --git a/src/test/ui/parser/removed-syntax-static-fn.rs b/src/test/ui/parser/removed-syntax-static-fn.rs index df3964196b8..0caddb9855d 100644 --- a/src/test/ui/parser/removed-syntax-static-fn.rs +++ b/src/test/ui/parser/removed-syntax-static-fn.rs @@ -1,10 +1,8 @@ -// ignore-tidy-linelength - struct S; impl S { static fn f() {} + //~^ ERROR expected one of `async`, `const`, `crate`, `default`, `extern`, `fn`, `pub`, `type`, } -//~^^ ERROR expected one of `async`, `const`, `crate`, `default`, `existential`, `extern`, `fn`, `pub`, `type`, fn main() {} diff --git a/src/test/ui/parser/removed-syntax-static-fn.stderr b/src/test/ui/parser/removed-syntax-static-fn.stderr index 84e0432c48c..21cb71df657 100644 --- a/src/test/ui/parser/removed-syntax-static-fn.stderr +++ b/src/test/ui/parser/removed-syntax-static-fn.stderr @@ -1,8 +1,8 @@ -error: expected one of `async`, `const`, `crate`, `default`, `existential`, `extern`, `fn`, `pub`, `type`, `unsafe`, or `}`, found `static` - --> $DIR/removed-syntax-static-fn.rs:6:5 +error: expected one of `async`, `const`, `crate`, `default`, `extern`, `fn`, `pub`, `type`, `unsafe`, or `}`, found `static` + --> $DIR/removed-syntax-static-fn.rs:4:5 | LL | impl S { - | - expected one of 11 possible tokens here + | - expected one of 10 possible tokens here LL | static fn f() {} | ^^^^^^ unexpected token diff --git a/src/test/ui/privacy/private-in-public-assoc-ty.rs b/src/test/ui/privacy/private-in-public-assoc-ty.rs index 81d23959fd4..3c42f24d5ff 100644 --- a/src/test/ui/privacy/private-in-public-assoc-ty.rs +++ b/src/test/ui/privacy/private-in-public-assoc-ty.rs @@ -1,7 +1,8 @@ // Private types and traits are not allowed in interfaces of associated types. // This test also ensures that the checks are performed even inside private modules. -#![feature(associated_type_defaults, existential_type)] +#![feature(associated_type_defaults)] +#![feature(type_alias_impl_trait)] mod m { struct Priv; @@ -31,7 +32,7 @@ mod m { type Alias1 = Priv; //~^ ERROR private type `m::Priv` in public interface - existential type Exist: PrivTr; + type Exist = impl PrivTr; //~^ ERROR private trait `m::PrivTr` in public interface fn infer_exist() -> Self::Exist { Priv } } diff --git a/src/test/ui/privacy/private-in-public-assoc-ty.stderr b/src/test/ui/privacy/private-in-public-assoc-ty.stderr index 0b32e4cd306..158862f9228 100644 --- a/src/test/ui/privacy/private-in-public-assoc-ty.stderr +++ b/src/test/ui/privacy/private-in-public-assoc-ty.stderr @@ -1,5 +1,5 @@ warning: private trait `m::PrivTr` in public interface (error E0445) - --> $DIR/private-in-public-assoc-ty.rs:15:5 + --> $DIR/private-in-public-assoc-ty.rs:16:5 | LL | / pub trait PubTr { LL | | @@ -15,7 +15,7 @@ LL | | } = note: for more information, see issue #34537 warning: private type `m::Priv` in public interface (error E0446) - --> $DIR/private-in-public-assoc-ty.rs:15:5 + --> $DIR/private-in-public-assoc-ty.rs:16:5 | LL | / pub trait PubTr { LL | | @@ -30,7 +30,7 @@ LL | | } = note: for more information, see issue #34537 error[E0446]: private type `m::Priv` in public interface - --> $DIR/private-in-public-assoc-ty.rs:24:9 + --> $DIR/private-in-public-assoc-ty.rs:25:9 | LL | struct Priv; | - `m::Priv` declared as private @@ -39,7 +39,7 @@ LL | type Alias4 = Priv; | ^^^^^^^^^^^^^^^^^^^ can't leak private type error[E0446]: private type `m::Priv` in public interface - --> $DIR/private-in-public-assoc-ty.rs:31:9 + --> $DIR/private-in-public-assoc-ty.rs:32:9 | LL | struct Priv; | - `m::Priv` declared as private @@ -48,13 +48,13 @@ LL | type Alias1 = Priv; | ^^^^^^^^^^^^^^^^^^^ can't leak private type error[E0445]: private trait `m::PrivTr` in public interface - --> $DIR/private-in-public-assoc-ty.rs:34:9 + --> $DIR/private-in-public-assoc-ty.rs:35:9 | LL | trait PrivTr {} | - `m::PrivTr` declared as private ... -LL | existential type Exist: PrivTr; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait +LL | type Exist = impl PrivTr; + | ^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait error: aborting due to 3 previous errors diff --git a/src/test/ui/privacy/private-in-public-existential.rs b/src/test/ui/privacy/private-in-public-existential.rs index ef50875dcf6..40bba720b0f 100644 --- a/src/test/ui/privacy/private-in-public-existential.rs +++ b/src/test/ui/privacy/private-in-public-existential.rs @@ -1,9 +1,9 @@ // build-pass (FIXME(62277): could be check-pass?) -#![feature(existential_type)] +#![feature(type_alias_impl_trait)] #![deny(private_in_public)] -pub existential type Pub: Default; +pub type Pub = impl Default; #[derive(Default)] struct Priv; @@ -18,7 +18,7 @@ pub trait Trait { } impl Trait for u8 { - existential type Pub: Default; + type Pub = impl Default; fn method() -> Self::Pub { Priv } }