diff --git a/compiler/rustc_ast_passes/src/feature_gate.rs b/compiler/rustc_ast_passes/src/feature_gate.rs index 3e757e3843e..89b59e5f00f 100644 --- a/compiler/rustc_ast_passes/src/feature_gate.rs +++ b/compiler/rustc_ast_passes/src/feature_gate.rs @@ -287,7 +287,7 @@ impl<'a> PostExpansionVisitor<'a> { if let ast::TyKind::ImplTrait(..) = ty.kind { gate_feature_post!( &self.vis, - min_type_alias_impl_trait, + type_alias_impl_trait, ty.span, "`impl Trait` in type aliases is unstable" ); diff --git a/src/test/rustdoc-ui/coverage/traits.rs b/src/test/rustdoc-ui/coverage/traits.rs index 2a108dac2a5..daa08ec2582 100644 --- a/src/test/rustdoc-ui/coverage/traits.rs +++ b/src/test/rustdoc-ui/coverage/traits.rs @@ -2,7 +2,7 @@ // check-pass #![feature(trait_alias)] -#![feature(min_type_alias_impl_trait)] +#![feature(type_alias_impl_trait)] /// look at this trait right here pub trait ThisTrait { diff --git a/src/test/rustdoc-ui/error-in-impl-trait/trait-alias-closure.rs b/src/test/rustdoc-ui/error-in-impl-trait/trait-alias-closure.rs index 3e7b4280234..31dd786cbbf 100644 --- a/src/test/rustdoc-ui/error-in-impl-trait/trait-alias-closure.rs +++ b/src/test/rustdoc-ui/error-in-impl-trait/trait-alias-closure.rs @@ -1,5 +1,5 @@ // check-pass -#![feature(min_type_alias_impl_trait)] +#![feature(type_alias_impl_trait)] pub trait ValidTrait {} type ImplTrait = impl ValidTrait; diff --git a/src/test/rustdoc-ui/error-in-impl-trait/trait-alias.rs b/src/test/rustdoc-ui/error-in-impl-trait/trait-alias.rs index 7ebf4d544de..c18a024af4b 100644 --- a/src/test/rustdoc-ui/error-in-impl-trait/trait-alias.rs +++ b/src/test/rustdoc-ui/error-in-impl-trait/trait-alias.rs @@ -1,5 +1,5 @@ // check-pass -#![feature(min_type_alias_impl_trait)] +#![feature(type_alias_impl_trait)] pub trait ValidTrait {} type ImplTrait = impl ValidTrait; diff --git a/src/test/rustdoc/auxiliary/issue-73061.rs b/src/test/rustdoc/auxiliary/issue-73061.rs index 9b4129e771f..e05a3bc6d91 100644 --- a/src/test/rustdoc/auxiliary/issue-73061.rs +++ b/src/test/rustdoc/auxiliary/issue-73061.rs @@ -1,6 +1,6 @@ //edition:2018 -#![feature(min_type_alias_impl_trait)] +#![feature(type_alias_impl_trait)] pub trait Foo { type X: std::future::Future; diff --git a/src/test/rustdoc/impl-trait-alias.rs b/src/test/rustdoc/impl-trait-alias.rs index bf73a833580..54c3f856ddb 100644 --- a/src/test/rustdoc/impl-trait-alias.rs +++ b/src/test/rustdoc/impl-trait-alias.rs @@ -1,4 +1,4 @@ -#![feature(min_type_alias_impl_trait)] +#![feature(type_alias_impl_trait)] trait MyTrait {} impl MyTrait for i32 {} diff --git a/src/test/rustdoc/return-impl-trait.rs b/src/test/rustdoc/return-impl-trait.rs index da4945aadf7..1ccf5ac4611 100644 --- a/src/test/rustdoc/return-impl-trait.rs +++ b/src/test/rustdoc/return-impl-trait.rs @@ -1,4 +1,4 @@ -#![feature(min_type_alias_impl_trait)] +#![feature(type_alias_impl_trait)] pub trait Backend {} diff --git a/src/test/ui/associated-type-bounds/duplicate.rs b/src/test/ui/associated-type-bounds/duplicate.rs index e1a2ab37a3a..e1dc6f8f4b6 100644 --- a/src/test/ui/associated-type-bounds/duplicate.rs +++ b/src/test/ui/associated-type-bounds/duplicate.rs @@ -1,7 +1,5 @@ #![feature(associated_type_bounds)] -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] #![feature(untagged_unions)] use std::iter; diff --git a/src/test/ui/associated-type-bounds/duplicate.stderr b/src/test/ui/associated-type-bounds/duplicate.stderr new file mode 100644 index 00000000000..e4f4836f71a --- /dev/null +++ b/src/test/ui/associated-type-bounds/duplicate.stderr @@ -0,0 +1,483 @@ +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:7:36 + | +LL | struct SI1> { + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:11:36 + | +LL | struct SI2> { + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:15:39 + | +LL | struct SI3> { + | ------------- ^^^^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:21:29 + | +LL | T: Iterator, + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:28:29 + | +LL | T: Iterator, + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:35:32 + | +LL | T: Iterator, + | ------------- ^^^^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:41:34 + | +LL | enum EI1> { + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:45:34 + | +LL | enum EI2> { + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:49:37 + | +LL | enum EI3> { + | ------------- ^^^^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:55:29 + | +LL | T: Iterator, + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:62:29 + | +LL | T: Iterator, + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:69:32 + | +LL | T: Iterator, + | ------------- ^^^^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:75:35 + | +LL | union UI1> { + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:79:35 + | +LL | union UI2> { + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:83:38 + | +LL | union UI3> { + | ------------- ^^^^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:89:29 + | +LL | T: Iterator, + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:96:29 + | +LL | T: Iterator, + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:103:32 + | +LL | T: Iterator, + | ------------- ^^^^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:109:32 + | +LL | fn FI1>() {} + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:111:32 + | +LL | fn FI2>() {} + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:113:35 + | +LL | fn FI3>() {} + | ------------- ^^^^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:117:29 + | +LL | T: Iterator, + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:123:29 + | +LL | T: Iterator, + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:129:32 + | +LL | T: Iterator, + | ------------- ^^^^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:143:40 + | +LL | fn FAPIT1(_: impl Iterator) {} + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:145:40 + | +LL | fn FAPIT2(_: impl Iterator) {} + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:147:43 + | +LL | fn FAPIT3(_: impl Iterator) {} + | ------------- ^^^^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:150:35 + | +LL | type TAI1> = T; + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:152:35 + | +LL | type TAI2> = T; + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:154:38 + | +LL | type TAI3> = T; + | ------------- ^^^^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:158:29 + | +LL | T: Iterator, + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:163:29 + | +LL | T: Iterator, + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:168:32 + | +LL | T: Iterator, + | ------------- ^^^^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:172:36 + | +LL | type ETAI1> = impl Copy; + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:174:36 + | +LL | type ETAI2> = impl Copy; + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:176:39 + | +LL | type ETAI3> = impl Copy; + | ------------- ^^^^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:178:40 + | +LL | type ETAI4 = impl Iterator; + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:180:40 + | +LL | type ETAI5 = impl Iterator; + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:182:43 + | +LL | type ETAI6 = impl Iterator; + | ------------- ^^^^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:185:36 + | +LL | trait TRI1> {} + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:187:36 + | +LL | trait TRI2> {} + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:189:39 + | +LL | trait TRI3> {} + | ------------- ^^^^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:191:34 + | +LL | trait TRS1: Iterator {} + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:193:34 + | +LL | trait TRS2: Iterator {} + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:195:37 + | +LL | trait TRS3: Iterator {} + | ------------- ^^^^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:199:29 + | +LL | T: Iterator, + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:205:29 + | +LL | T: Iterator, + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:211:32 + | +LL | T: Iterator, + | ------------- ^^^^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:217:32 + | +LL | Self: Iterator, + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:217:32 + | +LL | Self: Iterator, + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:224:32 + | +LL | Self: Iterator, + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:224:32 + | +LL | Self: Iterator, + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:231:35 + | +LL | Self: Iterator, + | ------------- ^^^^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:231:35 + | +LL | Self: Iterator, + | ------------- ^^^^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:249:40 + | +LL | type TADyn1 = dyn Iterator; + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:251:44 + | +LL | type TADyn2 = Box>; + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:253:43 + | +LL | type TADyn3 = dyn Iterator; + | ------------- ^^^^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:237:34 + | +LL | type A: Iterator; + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:241:34 + | +LL | type A: Iterator; + | ---------- ^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error[E0719]: the value of the associated type `Item` (from trait `Iterator`) is already specified + --> $DIR/duplicate.rs:245:37 + | +LL | type A: Iterator; + | ------------- ^^^^^^^^^^^^^ re-bound here + | | + | `Item` bound here first + +error: aborting due to 60 previous errors + +For more information about this error, try `rustc --explain E0719`. diff --git a/src/test/ui/associated-type-bounds/trait-alias-impl-trait.rs b/src/test/ui/associated-type-bounds/trait-alias-impl-trait.rs index 9a9031043b6..e223a895741 100644 --- a/src/test/ui/associated-type-bounds/trait-alias-impl-trait.rs +++ b/src/test/ui/associated-type-bounds/trait-alias-impl-trait.rs @@ -1,9 +1,7 @@ // run-pass #![feature(associated_type_bounds)] -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] use std::ops::Add; diff --git a/src/test/ui/associated-types/issue-63591.rs b/src/test/ui/associated-types/issue-63591.rs index 04b68867496..4d2e39f4da6 100644 --- a/src/test/ui/associated-types/issue-63591.rs +++ b/src/test/ui/associated-types/issue-63591.rs @@ -1,9 +1,7 @@ // check-pass #![feature(associated_type_bounds)] -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] fn main() {} 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 c132d9b9d7d..66a3b07c3bd 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,9 +3,7 @@ // check-pass // edition:2018 -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] use std::future::Future; diff --git a/src/test/ui/entry-point/imported_main_const_fn_item_type_forbidden.rs b/src/test/ui/entry-point/imported_main_const_fn_item_type_forbidden.rs index d8553815b75..e0bb7dbfae9 100644 --- a/src/test/ui/entry-point/imported_main_const_fn_item_type_forbidden.rs +++ b/src/test/ui/entry-point/imported_main_const_fn_item_type_forbidden.rs @@ -1,5 +1,5 @@ #![feature(imported_main)] -#![feature(min_type_alias_impl_trait)] +#![feature(type_alias_impl_trait)] #![allow(incomplete_features)] //~^^^ ERROR `main` function not found in crate pub mod foo { diff --git a/src/test/ui/entry-point/imported_main_const_fn_item_type_forbidden.stderr b/src/test/ui/entry-point/imported_main_const_fn_item_type_forbidden.stderr index c4c0afc5687..6aa170fdfd2 100644 --- a/src/test/ui/entry-point/imported_main_const_fn_item_type_forbidden.stderr +++ b/src/test/ui/entry-point/imported_main_const_fn_item_type_forbidden.stderr @@ -2,7 +2,7 @@ error[E0601]: `main` function not found in crate `imported_main_const_fn_item_ty --> $DIR/imported_main_const_fn_item_type_forbidden.rs:1:1 | LL | / #![feature(imported_main)] -LL | | #![feature(min_type_alias_impl_trait)] +LL | | #![feature(type_alias_impl_trait)] LL | | #![allow(incomplete_features)] LL | | ... | diff --git a/src/test/ui/feature-gates/feature-gate-min_type_alias_impl_trait.stderr b/src/test/ui/feature-gates/feature-gate-min_type_alias_impl_trait.stderr index 07857289aae..c87f1f4f00d 100644 --- a/src/test/ui/feature-gates/feature-gate-min_type_alias_impl_trait.stderr +++ b/src/test/ui/feature-gates/feature-gate-min_type_alias_impl_trait.stderr @@ -5,7 +5,7 @@ LL | type Foo = impl Debug; | ^^^^^^^^^^ | = note: see issue #63063 for more information - = help: add `#![feature(min_type_alias_impl_trait)]` to the crate attributes to enable + = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable error[E0658]: `impl Trait` in type aliases is unstable --> $DIR/feature-gate-min_type_alias_impl_trait.rs:12:16 @@ -14,7 +14,7 @@ LL | type Baa = impl Debug; | ^^^^^^^^^^ | = note: see issue #63063 for more information - = help: add `#![feature(min_type_alias_impl_trait)]` to the crate attributes to enable + = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable error[E0658]: associated type defaults are unstable --> $DIR/feature-gate-min_type_alias_impl_trait.rs:23:5 @@ -32,7 +32,7 @@ LL | type Assoc = impl Debug; | ^^^^^^^^^^ | = note: see issue #63063 for more information - = help: add `#![feature(min_type_alias_impl_trait)]` to the crate attributes to enable + = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable error[E0658]: `impl Trait` in type aliases is unstable --> $DIR/feature-gate-min_type_alias_impl_trait.rs:29:24 @@ -41,7 +41,7 @@ LL | type NestedFree = (Vec, impl Debug, impl Iterator for more information - = help: add `#![feature(min_type_alias_impl_trait)]` to the crate attributes to enable + = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable error[E0658]: `impl Trait` in type aliases is unstable --> $DIR/feature-gate-min_type_alias_impl_trait.rs:29:37 @@ -50,7 +50,7 @@ LL | type NestedFree = (Vec, impl Debug, impl Iterator for more information - = help: add `#![feature(min_type_alias_impl_trait)]` to the crate attributes to enable + = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable error[E0658]: `impl Trait` in type aliases is unstable --> $DIR/feature-gate-min_type_alias_impl_trait.rs:29:49 @@ -59,7 +59,7 @@ LL | type NestedFree = (Vec, impl Debug, impl Iterator for more information - = help: add `#![feature(min_type_alias_impl_trait)]` to the crate attributes to enable + = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable error[E0658]: `impl Trait` in type aliases is unstable --> $DIR/feature-gate-min_type_alias_impl_trait.rs:29:70 @@ -68,7 +68,7 @@ LL | type NestedFree = (Vec, impl Debug, impl Iterator for more information - = help: add `#![feature(min_type_alias_impl_trait)]` to the crate attributes to enable + = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable error[E0658]: `impl Trait` in type aliases is unstable --> $DIR/feature-gate-min_type_alias_impl_trait.rs:40:21 @@ -77,7 +77,7 @@ LL | type Baa = (Vec, impl Debug, impl Iterator for more information - = help: add `#![feature(min_type_alias_impl_trait)]` to the crate attributes to enable + = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable error[E0658]: `impl Trait` in type aliases is unstable --> $DIR/feature-gate-min_type_alias_impl_trait.rs:40:34 @@ -86,7 +86,7 @@ LL | type Baa = (Vec, impl Debug, impl Iterator for more information - = help: add `#![feature(min_type_alias_impl_trait)]` to the crate attributes to enable + = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable error[E0658]: `impl Trait` in type aliases is unstable --> $DIR/feature-gate-min_type_alias_impl_trait.rs:40:46 @@ -95,7 +95,7 @@ LL | type Baa = (Vec, impl Debug, impl Iterator for more information - = help: add `#![feature(min_type_alias_impl_trait)]` to the crate attributes to enable + = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable error[E0658]: `impl Trait` in type aliases is unstable --> $DIR/feature-gate-min_type_alias_impl_trait.rs:40:67 @@ -104,7 +104,7 @@ LL | type Baa = (Vec, impl Debug, impl Iterator for more information - = help: add `#![feature(min_type_alias_impl_trait)]` to the crate attributes to enable + = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable error[E0562]: `impl Trait` not allowed outside of function and method return types --> $DIR/feature-gate-min_type_alias_impl_trait.rs:23:18 diff --git a/src/test/ui/feature-gates/feature-gate-type_alias_impl_trait.rs b/src/test/ui/feature-gates/feature-gate-type_alias_impl_trait.rs index 4fb1cd2aae1..ea82837d4bf 100644 --- a/src/test/ui/feature-gates/feature-gate-type_alias_impl_trait.rs +++ b/src/test/ui/feature-gates/feature-gate-type_alias_impl_trait.rs @@ -1,5 +1,5 @@ // ignore-compare-mode-chalk -#![feature(min_type_alias_impl_trait)] +#![feature(type_alias_impl_trait)] use std::fmt::Debug; type Foo = impl Debug; @@ -13,7 +13,7 @@ fn define() -> Bar { type Foo2 = impl Debug; fn define2() { - let x = || -> Foo2 { 42 }; //~ ERROR not permitted here + let x = || -> Foo2 { 42 }; } type Foo3 = impl Debug; diff --git a/src/test/ui/feature-gates/feature-gate-type_alias_impl_trait.stderr b/src/test/ui/feature-gates/feature-gate-type_alias_impl_trait.stderr index 10409d5fc4b..da3ddb1c509 100644 --- a/src/test/ui/feature-gates/feature-gate-type_alias_impl_trait.stderr +++ b/src/test/ui/feature-gates/feature-gate-type_alias_impl_trait.stderr @@ -10,15 +10,6 @@ LL | Bar(42) = note: expected opaque type `impl Debug` found type `{integer}` -error[E0658]: type alias impl trait is not permitted here - --> $DIR/feature-gate-type_alias_impl_trait.rs:16:19 - | -LL | let x = || -> Foo2 { 42 }; - | ^^^^ - | - = note: see issue #63063 for more information - = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable - error[E0308]: mismatched types --> $DIR/feature-gate-type_alias_impl_trait.rs:23:18 | @@ -77,7 +68,6 @@ error: could not find defining uses LL | type Foo4 = impl Debug; | ^^^^^^^^^^ -error: aborting due to 8 previous errors +error: aborting due to 7 previous errors -Some errors have detailed explanations: E0308, E0658. -For more information about an error, try `rustc --explain E0308`. +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/generator/layout-error.rs b/src/test/ui/generator/layout-error.rs index e8fd4f807e0..7c3d187409a 100644 --- a/src/test/ui/generator/layout-error.rs +++ b/src/test/ui/generator/layout-error.rs @@ -3,9 +3,7 @@ // // edition:2018 -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] use std::future::Future; pub struct Task(F); @@ -26,5 +24,5 @@ fn main() { type F = impl Future; // Check that statics are inhabited computes they layout. static POOL: Task = Task::new(); - Task::spawn(&POOL, || cb()); //[min_tait]~ ERROR type alias impl trait is not permitted here + Task::spawn(&POOL, || cb()); } diff --git a/src/test/ui/generator/layout-error.stderr b/src/test/ui/generator/layout-error.stderr new file mode 100644 index 00000000000..b1a258f4f2c --- /dev/null +++ b/src/test/ui/generator/layout-error.stderr @@ -0,0 +1,9 @@ +error[E0425]: cannot find value `Foo` in this scope + --> $DIR/layout-error.rs:21:17 + | +LL | let a = Foo; + | ^^^ not found in this scope + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/ui/generator/metadata-sufficient-for-layout.rs b/src/test/ui/generator/metadata-sufficient-for-layout.rs index 50093987e4b..d0e648ee775 100644 --- a/src/test/ui/generator/metadata-sufficient-for-layout.rs +++ b/src/test/ui/generator/metadata-sufficient-for-layout.rs @@ -5,9 +5,7 @@ // // aux-build:metadata-sufficient-for-layout.rs -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait, rustc_attrs)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait, rustc_attrs)] #![feature(generator_trait)] extern crate metadata_sufficient_for_layout; diff --git a/src/test/ui/generator/metadata-sufficient-for-layout.stderr b/src/test/ui/generator/metadata-sufficient-for-layout.stderr new file mode 100644 index 00000000000..3488b04f226 --- /dev/null +++ b/src/test/ui/generator/metadata-sufficient-for-layout.stderr @@ -0,0 +1,8 @@ +error: fatal error triggered by #[rustc_error] + --> $DIR/metadata-sufficient-for-layout.rs:25:1 + | +LL | fn main() {} + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/impl-trait/associated-impl-trait-type-generic-trait.rs b/src/test/ui/impl-trait/associated-impl-trait-type-generic-trait.rs index fb816fb39e6..6c7c46b0e3d 100644 --- a/src/test/ui/impl-trait/associated-impl-trait-type-generic-trait.rs +++ b/src/test/ui/impl-trait/associated-impl-trait-type-generic-trait.rs @@ -1,6 +1,4 @@ -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] // build-pass (FIXME(62277): could be check-pass?) trait Bar {} diff --git a/src/test/ui/impl-trait/associated-impl-trait-type-trivial.rs b/src/test/ui/impl-trait/associated-impl-trait-type-trivial.rs index 57747b286bf..cdda341cad8 100644 --- a/src/test/ui/impl-trait/associated-impl-trait-type-trivial.rs +++ b/src/test/ui/impl-trait/associated-impl-trait-type-trivial.rs @@ -1,6 +1,4 @@ -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] // build-pass (FIXME(62277): could be check-pass?) trait Bar {} diff --git a/src/test/ui/impl-trait/associated-impl-trait-type.rs b/src/test/ui/impl-trait/associated-impl-trait-type.rs index 39e98ebe665..d0661d66f4b 100644 --- a/src/test/ui/impl-trait/associated-impl-trait-type.rs +++ b/src/test/ui/impl-trait/associated-impl-trait-type.rs @@ -1,6 +1,4 @@ -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] // build-pass (FIXME(62277): could be check-pass?) trait Bar {} diff --git a/src/test/ui/impl-trait/auto-trait.rs b/src/test/ui/impl-trait/auto-trait.rs index 59bd09e348a..cf2773f4ef5 100644 --- a/src/test/ui/impl-trait/auto-trait.rs +++ b/src/test/ui/impl-trait/auto-trait.rs @@ -1,8 +1,6 @@ // Tests that type alias impls traits do not leak auto-traits for // the purposes of coherence checking -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] trait OpaqueTrait {} impl OpaqueTrait for T {} diff --git a/src/test/ui/impl-trait/auto-trait.stderr b/src/test/ui/impl-trait/auto-trait.stderr new file mode 100644 index 00000000000..26cd8fb6a9b --- /dev/null +++ b/src/test/ui/impl-trait/auto-trait.stderr @@ -0,0 +1,12 @@ +error[E0119]: conflicting implementations of trait `AnotherTrait` for type `D` + --> $DIR/auto-trait.rs:21:1 + | +LL | impl AnotherTrait for T {} + | -------------------------------- first implementation here +... +LL | impl AnotherTrait for D { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `D` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/ui/impl-trait/bound-normalization-pass.rs b/src/test/ui/impl-trait/bound-normalization-pass.rs index 4218bc52065..51718079d2c 100644 --- a/src/test/ui/impl-trait/bound-normalization-pass.rs +++ b/src/test/ui/impl-trait/bound-normalization-pass.rs @@ -4,7 +4,7 @@ //[sa] compile-flags: -Z save-analysis //-^ To make this the regression test for #75962. -#![feature(min_type_alias_impl_trait)] +#![feature(type_alias_impl_trait)] // See issue 60414 diff --git a/src/test/ui/impl-trait/issue-55872-1.rs b/src/test/ui/impl-trait/issue-55872-1.rs index c6a331e58fe..72a060abae3 100644 --- a/src/test/ui/impl-trait/issue-55872-1.rs +++ b/src/test/ui/impl-trait/issue-55872-1.rs @@ -1,6 +1,4 @@ -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] pub trait Bar { type E: Copy; diff --git a/src/test/ui/impl-trait/issue-55872-1.stderr b/src/test/ui/impl-trait/issue-55872-1.stderr new file mode 100644 index 00000000000..6411c1b5d1c --- /dev/null +++ b/src/test/ui/impl-trait/issue-55872-1.stderr @@ -0,0 +1,48 @@ +error[E0276]: impl has stricter requirements than trait + --> $DIR/issue-55872-1.rs:14:5 + | +LL | fn foo() -> Self::E; + | ----------------------- definition of `foo` from trait +... +LL | fn foo() -> Self::E { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `T: Default` + +error[E0277]: the trait bound `S: Copy` is not satisfied in `(S, T)` + --> $DIR/issue-55872-1.rs:10:14 + | +LL | type E = impl Copy; + | ^^^^^^^^^ within `(S, T)`, the trait `Copy` is not implemented for `S` + | + = note: required because it appears within the type `(S, T)` +help: consider further restricting this bound + | +LL | impl Bar for S { + | ^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `T: Copy` is not satisfied in `(S, T)` + --> $DIR/issue-55872-1.rs:10:14 + | +LL | type E = impl Copy; + | ^^^^^^^^^ within `(S, T)`, the trait `Copy` is not implemented for `T` + | + = note: required because it appears within the type `(S, T)` +help: consider further restricting this bound + | +LL | fn foo() -> Self::E { + | ^^^^^^^^^^^^^^^^^^^ + +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:14:37 + | +LL | fn foo() -> Self::E { + | _____________________________________^ +LL | | +LL | | +LL | | (S::default(), T::default()) +LL | | } + | |_____^ + +error: aborting due to 4 previous errors + +Some errors have detailed explanations: E0276, E0277. +For more information about an error, try `rustc --explain E0276`. diff --git a/src/test/ui/impl-trait/issue-55872-2.rs b/src/test/ui/impl-trait/issue-55872-2.rs index 44839e5e845..6eda1dc62ec 100644 --- a/src/test/ui/impl-trait/issue-55872-2.rs +++ b/src/test/ui/impl-trait/issue-55872-2.rs @@ -1,9 +1,7 @@ // edition:2018 // ignore-compare-mode-chalk -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] pub trait Bar { type E: Copy; diff --git a/src/test/ui/impl-trait/issue-55872-2.stderr b/src/test/ui/impl-trait/issue-55872-2.stderr new file mode 100644 index 00000000000..58c5ee45051 --- /dev/null +++ b/src/test/ui/impl-trait/issue-55872-2.stderr @@ -0,0 +1,19 @@ +error[E0277]: the trait bound `impl Future: Copy` is not satisfied + --> $DIR/issue-55872-2.rs:13:14 + | +LL | type E = impl std::marker::Copy; + | ^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `impl Future` + +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:15:28 + | +LL | fn foo() -> Self::E { + | ____________________________^ +LL | | +LL | | async {} +LL | | } + | |_____^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/impl-trait/issue-55872.rs b/src/test/ui/impl-trait/issue-55872.rs index 049d61a425e..bbd94025417 100644 --- a/src/test/ui/impl-trait/issue-55872.rs +++ b/src/test/ui/impl-trait/issue-55872.rs @@ -1,7 +1,5 @@ // ignore-compare-mode-chalk -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] pub trait Bar { type E: Copy; diff --git a/src/test/ui/impl-trait/issue-55872.stderr b/src/test/ui/impl-trait/issue-55872.stderr new file mode 100644 index 00000000000..60654ec3461 --- /dev/null +++ b/src/test/ui/impl-trait/issue-55872.stderr @@ -0,0 +1,12 @@ +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() -> Self::E { + | ____________________________^ +LL | | +LL | | || () +LL | | } + | |_____^ + +error: aborting due to previous error + diff --git a/src/test/ui/impl-trait/issue-86465.rs b/src/test/ui/impl-trait/issue-86465.rs index 23a3748c12c..a6976daff01 100644 --- a/src/test/ui/impl-trait/issue-86465.rs +++ b/src/test/ui/impl-trait/issue-86465.rs @@ -1,4 +1,4 @@ -#![feature(min_type_alias_impl_trait)] +#![feature(type_alias_impl_trait)] type X<'a, 'b> = impl std::fmt::Debug; diff --git a/src/test/ui/impl-trait/issues/issue-53457.rs b/src/test/ui/impl-trait/issues/issue-53457.rs index c6d7be47dfe..7b9c2c53aad 100644 --- a/src/test/ui/impl-trait/issues/issue-53457.rs +++ b/src/test/ui/impl-trait/issues/issue-53457.rs @@ -1,9 +1,6 @@ // check-pass -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] - +#![feature(type_alias_impl_trait)] type X = impl Clone; fn bar(f: F) -> F { diff --git a/src/test/ui/impl-trait/issues/issue-70877.rs b/src/test/ui/impl-trait/issues/issue-70877.rs index 29aa705ef9d..853c2a82bed 100644 --- a/src/test/ui/impl-trait/issues/issue-70877.rs +++ b/src/test/ui/impl-trait/issues/issue-70877.rs @@ -1,7 +1,4 @@ -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] -#![allow(incomplete_features)] +#![feature(type_alias_impl_trait)] type FooArg<'a> = &'a dyn ToString; type FooRet = impl std::fmt::Debug; diff --git a/src/test/ui/impl-trait/issues/issue-70877.stderr b/src/test/ui/impl-trait/issues/issue-70877.stderr new file mode 100644 index 00000000000..b6861039f6a --- /dev/null +++ b/src/test/ui/impl-trait/issues/issue-70877.stderr @@ -0,0 +1,15 @@ +error[E0271]: type mismatch resolving `::Item == Box<(dyn for<'r> Fn(&'r (dyn ToString + 'r)) -> Option + 'static)>` + --> $DIR/issue-70877.rs:7:12 + | +LL | type FooRet = impl std::fmt::Debug; + | -------------------- the found opaque type +... +LL | type Foo = impl Iterator; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `Option`, found opaque type + | + = note: expected struct `Box<(dyn for<'r> Fn(&'r (dyn ToString + 'r)) -> Option + 'static)>` + found struct `Box<(dyn for<'r> Fn(&'r (dyn ToString + 'r)) -> impl Debug + 'static)>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0271`. diff --git a/src/test/ui/impl-trait/issues/issue-78722.rs b/src/test/ui/impl-trait/issues/issue-78722.rs index 0b8569b6e5f..bdbd20f9d2b 100644 --- a/src/test/ui/impl-trait/issues/issue-78722.rs +++ b/src/test/ui/impl-trait/issues/issue-78722.rs @@ -1,8 +1,6 @@ // edition:2018 -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] type F = impl core::future::Future; diff --git a/src/test/ui/impl-trait/issues/issue-78722.stderr b/src/test/ui/impl-trait/issues/issue-78722.stderr new file mode 100644 index 00000000000..f42d66d1243 --- /dev/null +++ b/src/test/ui/impl-trait/issues/issue-78722.stderr @@ -0,0 +1,23 @@ +error[E0308]: mismatched types + --> $DIR/issue-78722.rs:12:20 + | +LL | type F = impl core::future::Future; + | -------------------------------------- the expected opaque type +... +LL | let f: F = async { 1 }; + | - ^^^^^^^^^^^ expected opaque type, found a different opaque type + | | + | expected due to this + | + ::: $SRC_DIR/core/src/future/mod.rs:LL:COL + | +LL | pub const fn from_generator(gen: T) -> impl Future + | ------------------------------- the found opaque type + | + = note: expected opaque type `impl Future` (opaque type at <$DIR/issue-78722.rs:5:10>) + found opaque type `impl Future` (opaque type at <$SRC_DIR/core/src/future/mod.rs:LL:COL>) + = note: distinct uses of `impl Trait` result in different opaque types + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/impl-trait/issues/issue-86201.rs b/src/test/ui/impl-trait/issues/issue-86201.rs index 8dc76f4f752..8cc4fef890a 100644 --- a/src/test/ui/impl-trait/issues/issue-86201.rs +++ b/src/test/ui/impl-trait/issues/issue-86201.rs @@ -1,5 +1,5 @@ #![feature(unboxed_closures)] -#![feature(min_type_alias_impl_trait)] +#![feature(type_alias_impl_trait)] type FunType = impl Fn<()>; //~^ could not find defining uses diff --git a/src/test/ui/impl-trait/multiple-lifetimes/error-handling-2.rs b/src/test/ui/impl-trait/multiple-lifetimes/error-handling-2.rs index cfc493928c0..96d891b2cf1 100644 --- a/src/test/ui/impl-trait/multiple-lifetimes/error-handling-2.rs +++ b/src/test/ui/impl-trait/multiple-lifetimes/error-handling-2.rs @@ -1,9 +1,7 @@ // compile-flags:-Zborrowck=mir #![feature(member_constraints)] -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] #[derive(Clone)] struct CopyIfEq(T, U); diff --git a/src/test/ui/impl-trait/multiple-lifetimes/error-handling-2.stderr b/src/test/ui/impl-trait/multiple-lifetimes/error-handling-2.stderr new file mode 100644 index 00000000000..59105f11805 --- /dev/null +++ b/src/test/ui/impl-trait/multiple-lifetimes/error-handling-2.stderr @@ -0,0 +1,15 @@ +error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds + --> $DIR/error-handling-2.rs:13:60 + | +LL | fn foo<'a: 'b, 'b, 'c>(x: &'static i32, mut y: &'a i32) -> E<'b, 'c> { + | ^^^^^^^^^ + | +note: hidden type `*mut &'a i32` captures the lifetime `'a` as defined on the function body at 13:8 + --> $DIR/error-handling-2.rs:13:8 + | +LL | fn foo<'a: 'b, 'b, 'c>(x: &'static i32, mut y: &'a i32) -> E<'b, 'c> { + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0700`. 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 23d5c9da311..6d88f16ea8a 100644 --- a/src/test/ui/impl-trait/multiple-lifetimes/error-handling.rs +++ b/src/test/ui/impl-trait/multiple-lifetimes/error-handling.rs @@ -1,8 +1,6 @@ // compile-flags:-Zborrowck=mir -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] #[derive(Clone)] struct CopyIfEq(T, U); diff --git a/src/test/ui/impl-trait/multiple-lifetimes/error-handling.stderr b/src/test/ui/impl-trait/multiple-lifetimes/error-handling.stderr new file mode 100644 index 00000000000..ccd0040030d --- /dev/null +++ b/src/test/ui/impl-trait/multiple-lifetimes/error-handling.stderr @@ -0,0 +1,15 @@ +error: lifetime may not live long enough + --> $DIR/error-handling.rs:22:16 + | +LL | fn foo<'a, 'b, 'c>(x: &'static i32, mut y: &'a i32) -> E<'b, 'c> { + | -- -- lifetime `'b` defined here + | | + | lifetime `'a` defined here +... +LL | let _: &'b i32 = *u.0; + | ^^^^^^^ type annotation requires that `'a` must outlive `'b` + | + = help: consider adding the following bound: `'a: 'b` + +error: aborting due to previous error + diff --git a/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original-type-alias-impl-trait.rs b/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original-type-alias-impl-trait.rs index b9857b7aa2f..529dcd8ece6 100644 --- a/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original-type-alias-impl-trait.rs +++ b/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original-type-alias-impl-trait.rs @@ -3,7 +3,7 @@ // revisions: migrate mir //[mir]compile-flags: -Z borrowck=mir -#![feature(min_type_alias_impl_trait)] +#![feature(type_alias_impl_trait)] trait Trait<'a, 'b> {} impl Trait<'_, '_> for T {} diff --git a/src/test/ui/impl-trait/negative-reasoning.rs b/src/test/ui/impl-trait/negative-reasoning.rs index 0838f32b932..d173fe83fb7 100644 --- a/src/test/ui/impl-trait/negative-reasoning.rs +++ b/src/test/ui/impl-trait/negative-reasoning.rs @@ -1,8 +1,6 @@ // Tests that we cannot assume that an opaque type does *not* implement some // other trait -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] trait OpaqueTrait {} impl OpaqueTrait for T {} diff --git a/src/test/ui/impl-trait/negative-reasoning.stderr b/src/test/ui/impl-trait/negative-reasoning.stderr new file mode 100644 index 00000000000..e39a8e53f79 --- /dev/null +++ b/src/test/ui/impl-trait/negative-reasoning.stderr @@ -0,0 +1,14 @@ +error[E0119]: conflicting implementations of trait `AnotherTrait` for type `D` + --> $DIR/negative-reasoning.rs:19:1 + | +LL | impl AnotherTrait for T {} + | ------------------------------------------- first implementation here +... +LL | impl AnotherTrait for D { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `D` + | + = note: upstream crates may add a new impl of trait `std::fmt::Debug` for type `impl OpaqueTrait` in future versions + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/ui/impl-trait/type-alias-generic-param.rs b/src/test/ui/impl-trait/type-alias-generic-param.rs index 9cb9a6de2d6..3499b285926 100644 --- a/src/test/ui/impl-trait/type-alias-generic-param.rs +++ b/src/test/ui/impl-trait/type-alias-generic-param.rs @@ -3,9 +3,7 @@ // types in 'item' position when generic parameters are involved // // run-pass -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] trait Meow { type MeowType; diff --git a/src/test/ui/impl-trait/type-alias-impl-trait-in-fn-body.rs b/src/test/ui/impl-trait/type-alias-impl-trait-in-fn-body.rs index 996840dc196..91be4efd56a 100644 --- a/src/test/ui/impl-trait/type-alias-impl-trait-in-fn-body.rs +++ b/src/test/ui/impl-trait/type-alias-impl-trait-in-fn-body.rs @@ -1,8 +1,6 @@ // build-pass (FIXME(62277): could be check-pass?) -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] use std::fmt::Debug; diff --git a/src/test/ui/impl-trait/where-allowed.stderr b/src/test/ui/impl-trait/where-allowed.stderr index 93a3de61ccf..7f11d30dbaa 100644 --- a/src/test/ui/impl-trait/where-allowed.stderr +++ b/src/test/ui/impl-trait/where-allowed.stderr @@ -23,7 +23,7 @@ LL | type Out = impl Debug; | ^^^^^^^^^^ | = note: see issue #63063 for more information - = help: add `#![feature(min_type_alias_impl_trait)]` to the crate attributes to enable + = 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:154:23 @@ -32,7 +32,7 @@ LL | type InTypeAlias = impl Debug; | ^^^^^^^^^^ | = note: see issue #63063 for more information - = help: add `#![feature(min_type_alias_impl_trait)]` to the crate attributes to enable + = 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:157:39 @@ -41,7 +41,7 @@ LL | type InReturnInTypeAlias = fn() -> impl Debug; | ^^^^^^^^^^ | = note: see issue #63063 for more information - = help: add `#![feature(min_type_alias_impl_trait)]` to the crate attributes to enable + = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable error[E0562]: `impl Trait` not allowed outside of function and method return types --> $DIR/where-allowed.rs:15:40 diff --git a/src/test/ui/issues/issue-60662.full_tait.stdout b/src/test/ui/issues/issue-60662.full_tait.stdout index 9ee4434d559..88bbbd143fb 100644 --- a/src/test/ui/issues/issue-60662.full_tait.stdout +++ b/src/test/ui/issues/issue-60662.full_tait.stdout @@ -2,7 +2,7 @@ // compile-flags: -Z unpretty=hir // revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] +#![feature(type_alias_impl_trait)] #![feature(type_alias_impl_trait)] #[prelude_import] use ::std::prelude::rust_2015::*; diff --git a/src/test/ui/issues/issue-60662.min_tait.stdout b/src/test/ui/issues/issue-60662.min_tait.stdout index d0db578f570..c2495556f60 100644 --- a/src/test/ui/issues/issue-60662.min_tait.stdout +++ b/src/test/ui/issues/issue-60662.min_tait.stdout @@ -2,7 +2,7 @@ // compile-flags: -Z unpretty=hir // revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] +#![feature(type_alias_impl_trait)] #[prelude_import] use ::std::prelude::rust_2015::*; #[macro_use] diff --git a/src/test/ui/issues/issue-60662.rs b/src/test/ui/issues/issue-60662.rs index 5079e33650f..b9faa668b80 100644 --- a/src/test/ui/issues/issue-60662.rs +++ b/src/test/ui/issues/issue-60662.rs @@ -1,9 +1,7 @@ // check-pass // compile-flags: -Z unpretty=hir -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] trait Animal {} diff --git a/src/test/ui/issues/issue-60662.stdout b/src/test/ui/issues/issue-60662.stdout new file mode 100644 index 00000000000..14a49f20e6b --- /dev/null +++ b/src/test/ui/issues/issue-60662.stdout @@ -0,0 +1,14 @@ +// check-pass +// compile-flags: -Z unpretty=hir + +#![feature(type_alias_impl_trait)] +#[prelude_import] +use ::std::prelude::rust_2015::*; +#[macro_use] +extern crate std; + +trait Animal { } + +fn main() { + pub type ServeFut = /*impl Trait*/; + } diff --git a/src/test/ui/layout/debug.rs b/src/test/ui/layout/debug.rs index 317955f0e39..299151df664 100644 --- a/src/test/ui/layout/debug.rs +++ b/src/test/ui/layout/debug.rs @@ -1,5 +1,5 @@ // normalize-stderr-test "pref: Align \{\n *pow2: [1-3],\n *\}" -> "pref: $$PREF_ALIGN" -#![feature(never_type, rustc_attrs, min_type_alias_impl_trait)] +#![feature(never_type, rustc_attrs, type_alias_impl_trait)] #![crate_type = "lib"] #[rustc_layout(debug)] diff --git a/src/test/ui/lint/inline-trait-and-foreign-items.rs b/src/test/ui/lint/inline-trait-and-foreign-items.rs index 9d9579ec26c..6321b3c76e4 100644 --- a/src/test/ui/lint/inline-trait-and-foreign-items.rs +++ b/src/test/ui/lint/inline-trait-and-foreign-items.rs @@ -1,7 +1,5 @@ #![feature(extern_types)] -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] #![warn(unused_attributes)] diff --git a/src/test/ui/lint/inline-trait-and-foreign-items.stderr b/src/test/ui/lint/inline-trait-and-foreign-items.stderr new file mode 100644 index 00000000000..6ac884c12ce --- /dev/null +++ b/src/test/ui/lint/inline-trait-and-foreign-items.stderr @@ -0,0 +1,72 @@ +warning: `#[inline]` is ignored on constants + --> $DIR/inline-trait-and-foreign-items.rs:7:5 + | +LL | #[inline] + | ^^^^^^^^^ + | +note: the lint level is defined here + --> $DIR/inline-trait-and-foreign-items.rs:4:9 + | +LL | #![warn(unused_attributes)] + | ^^^^^^^^^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: see issue #65833 for more information + +error[E0518]: attribute should be applied to function or closure + --> $DIR/inline-trait-and-foreign-items.rs:11:5 + | +LL | #[inline] + | ^^^^^^^^^ +LL | type T; + | ------- not a function or closure + +warning: `#[inline]` is ignored on constants + --> $DIR/inline-trait-and-foreign-items.rs:18:5 + | +LL | #[inline] + | ^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: see issue #65833 for more information + +error[E0518]: attribute should be applied to function or closure + --> $DIR/inline-trait-and-foreign-items.rs:22:5 + | +LL | #[inline] + | ^^^^^^^^^ +LL | type T = Self; + | -------------- not a function or closure + +error[E0518]: attribute should be applied to function or closure + --> $DIR/inline-trait-and-foreign-items.rs:25:5 + | +LL | #[inline] + | ^^^^^^^^^ +LL | type U = impl Trait; + | -------------------- not a function or closure + +error[E0518]: attribute should be applied to function or closure + --> $DIR/inline-trait-and-foreign-items.rs:30:5 + | +LL | #[inline] + | ^^^^^^^^^ +LL | static X: u32; + | -------------- not a function or closure + +error[E0518]: attribute should be applied to function or closure + --> $DIR/inline-trait-and-foreign-items.rs:33:5 + | +LL | #[inline] + | ^^^^^^^^^ +LL | type T; + | ------- not a function or closure + +error: could not find defining uses + --> $DIR/inline-trait-and-foreign-items.rs:26:14 + | +LL | type U = impl Trait; + | ^^^^^^^^^^ + +error: aborting due to 6 previous errors; 2 warnings emitted + +For more information about this error, try `rustc --explain E0518`. diff --git a/src/test/ui/lint/lint-ctypes-73249-2.rs b/src/test/ui/lint/lint-ctypes-73249-2.rs index 8535307756b..fe578f51b63 100644 --- a/src/test/ui/lint/lint-ctypes-73249-2.rs +++ b/src/test/ui/lint/lint-ctypes-73249-2.rs @@ -1,6 +1,4 @@ -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] #![deny(improper_ctypes)] pub trait Baz {} diff --git a/src/test/ui/lint/lint-ctypes-73249-2.stderr b/src/test/ui/lint/lint-ctypes-73249-2.stderr new file mode 100644 index 00000000000..36dbe3217d7 --- /dev/null +++ b/src/test/ui/lint/lint-ctypes-73249-2.stderr @@ -0,0 +1,15 @@ +error: `extern` block uses type `impl Baz`, which is not FFI-safe + --> $DIR/lint-ctypes-73249-2.rs:26:25 + | +LL | pub fn lint_me() -> A<()>; + | ^^^^^ not FFI-safe + | +note: the lint level is defined here + --> $DIR/lint-ctypes-73249-2.rs:2:9 + | +LL | #![deny(improper_ctypes)] + | ^^^^^^^^^^^^^^^ + = note: opaque types have no C equivalent + +error: aborting due to previous error + diff --git a/src/test/ui/lint/lint-ctypes-73249-3.rs b/src/test/ui/lint/lint-ctypes-73249-3.rs index 287287d449c..ec12de00739 100644 --- a/src/test/ui/lint/lint-ctypes-73249-3.rs +++ b/src/test/ui/lint/lint-ctypes-73249-3.rs @@ -1,6 +1,4 @@ -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] #![deny(improper_ctypes)] pub trait Baz {} diff --git a/src/test/ui/lint/lint-ctypes-73249-3.stderr b/src/test/ui/lint/lint-ctypes-73249-3.stderr new file mode 100644 index 00000000000..e987ec90228 --- /dev/null +++ b/src/test/ui/lint/lint-ctypes-73249-3.stderr @@ -0,0 +1,15 @@ +error: `extern` block uses type `impl Baz`, which is not FFI-safe + --> $DIR/lint-ctypes-73249-3.rs:20:25 + | +LL | pub fn lint_me() -> A; + | ^ not FFI-safe + | +note: the lint level is defined here + --> $DIR/lint-ctypes-73249-3.rs:2:9 + | +LL | #![deny(improper_ctypes)] + | ^^^^^^^^^^^^^^^ + = note: opaque types have no C equivalent + +error: aborting due to previous error + diff --git a/src/test/ui/lint/lint-ctypes-73249-5.rs b/src/test/ui/lint/lint-ctypes-73249-5.rs index b877364d9b6..58c2d7a501a 100644 --- a/src/test/ui/lint/lint-ctypes-73249-5.rs +++ b/src/test/ui/lint/lint-ctypes-73249-5.rs @@ -1,6 +1,4 @@ -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] #![deny(improper_ctypes)] pub trait Baz {} diff --git a/src/test/ui/lint/lint-ctypes-73249-5.stderr b/src/test/ui/lint/lint-ctypes-73249-5.stderr new file mode 100644 index 00000000000..749714c7df8 --- /dev/null +++ b/src/test/ui/lint/lint-ctypes-73249-5.stderr @@ -0,0 +1,15 @@ +error: `extern` block uses type `impl Baz`, which is not FFI-safe + --> $DIR/lint-ctypes-73249-5.rs:20:25 + | +LL | pub fn lint_me() -> A; + | ^ not FFI-safe + | +note: the lint level is defined here + --> $DIR/lint-ctypes-73249-5.rs:2:9 + | +LL | #![deny(improper_ctypes)] + | ^^^^^^^^^^^^^^^ + = note: opaque types have no C equivalent + +error: aborting due to previous error + diff --git a/src/test/ui/lint/lint-ctypes-73251-1.rs b/src/test/ui/lint/lint-ctypes-73251-1.rs index 042878c9778..dc4c7efd7ef 100644 --- a/src/test/ui/lint/lint-ctypes-73251-1.rs +++ b/src/test/ui/lint/lint-ctypes-73251-1.rs @@ -1,6 +1,4 @@ -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] #![deny(improper_ctypes)] pub trait Baz {} diff --git a/src/test/ui/lint/lint-ctypes-73251-1.stderr b/src/test/ui/lint/lint-ctypes-73251-1.stderr new file mode 100644 index 00000000000..505ccd5a930 --- /dev/null +++ b/src/test/ui/lint/lint-ctypes-73251-1.stderr @@ -0,0 +1,15 @@ +error: `extern` block uses type `impl Baz`, which is not FFI-safe + --> $DIR/lint-ctypes-73251-1.rs:23:25 + | +LL | pub fn lint_me() -> ::Assoc; + | ^^^^^^^^^^^^^^^^^^^ not FFI-safe + | +note: the lint level is defined here + --> $DIR/lint-ctypes-73251-1.rs:2:9 + | +LL | #![deny(improper_ctypes)] + | ^^^^^^^^^^^^^^^ + = note: opaque types have no C equivalent + +error: aborting due to previous error + diff --git a/src/test/ui/lint/lint-ctypes-73251-2.rs b/src/test/ui/lint/lint-ctypes-73251-2.rs index 5a124b2fea5..79effd054b0 100644 --- a/src/test/ui/lint/lint-ctypes-73251-2.rs +++ b/src/test/ui/lint/lint-ctypes-73251-2.rs @@ -1,6 +1,4 @@ -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] #![deny(improper_ctypes)] pub trait TraitA { diff --git a/src/test/ui/lint/lint-ctypes-73251-2.stderr b/src/test/ui/lint/lint-ctypes-73251-2.stderr new file mode 100644 index 00000000000..94ee95d422e --- /dev/null +++ b/src/test/ui/lint/lint-ctypes-73251-2.stderr @@ -0,0 +1,15 @@ +error: `extern` block uses type `impl TraitA`, which is not FFI-safe + --> $DIR/lint-ctypes-73251-2.rs:36:25 + | +LL | pub fn lint_me() -> ::Assoc; + | ^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe + | +note: the lint level is defined here + --> $DIR/lint-ctypes-73251-2.rs:2:9 + | +LL | #![deny(improper_ctypes)] + | ^^^^^^^^^^^^^^^ + = note: opaque types have no C equivalent + +error: aborting due to previous error + diff --git a/src/test/ui/lint/lint-ctypes-73251.rs b/src/test/ui/lint/lint-ctypes-73251.rs index 24742b64f8e..ebc2ca77b67 100644 --- a/src/test/ui/lint/lint-ctypes-73251.rs +++ b/src/test/ui/lint/lint-ctypes-73251.rs @@ -1,8 +1,6 @@ // check-pass -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] #![deny(improper_ctypes)] pub trait Foo { diff --git a/src/test/ui/lint/opaque-ty-ffi-unsafe.rs b/src/test/ui/lint/opaque-ty-ffi-unsafe.rs index 0c9fed8b98c..fadb7471952 100644 --- a/src/test/ui/lint/opaque-ty-ffi-unsafe.rs +++ b/src/test/ui/lint/opaque-ty-ffi-unsafe.rs @@ -1,6 +1,4 @@ -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] #![deny(improper_ctypes)] type A = impl Fn(); diff --git a/src/test/ui/lint/opaque-ty-ffi-unsafe.stderr b/src/test/ui/lint/opaque-ty-ffi-unsafe.stderr new file mode 100644 index 00000000000..9d46f6d936e --- /dev/null +++ b/src/test/ui/lint/opaque-ty-ffi-unsafe.stderr @@ -0,0 +1,15 @@ +error: `extern` block uses type `impl Fn<()>`, which is not FFI-safe + --> $DIR/opaque-ty-ffi-unsafe.rs:11:17 + | +LL | pub fn a(_: A); + | ^ not FFI-safe + | +note: the lint level is defined here + --> $DIR/opaque-ty-ffi-unsafe.rs:2:9 + | +LL | #![deny(improper_ctypes)] + | ^^^^^^^^^^^^^^^ + = note: opaque types have no C equivalent + +error: aborting due to previous error + diff --git a/src/test/ui/mir/issue-75053.rs b/src/test/ui/mir/issue-75053.rs index bcd689775a0..cb56eaa0b13 100644 --- a/src/test/ui/mir/issue-75053.rs +++ b/src/test/ui/mir/issue-75053.rs @@ -1,8 +1,6 @@ // compile-flags: -Z mir-opt-level=3 -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait, rustc_attrs)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait, rustc_attrs)] use std::marker::PhantomData; diff --git a/src/test/ui/mir/issue-75053.stderr b/src/test/ui/mir/issue-75053.stderr new file mode 100644 index 00000000000..64e59e6c448 --- /dev/null +++ b/src/test/ui/mir/issue-75053.stderr @@ -0,0 +1,8 @@ +error: fatal error triggered by #[rustc_error] + --> $DIR/issue-75053.rs:46:1 + | +LL | fn main() { + | ^^^^^^^^^ + +error: aborting due to previous error + 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 dd2dcc6a2ea..fba72c13170 100644 --- a/src/test/ui/privacy/private-in-public-assoc-ty.rs +++ b/src/test/ui/privacy/private-in-public-assoc-ty.rs @@ -2,9 +2,7 @@ // This test also ensures that the checks are performed even inside private modules. #![feature(associated_type_defaults)] -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] mod m { struct 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 new file mode 100644 index 00000000000..ba62a228b09 --- /dev/null +++ b/src/test/ui/privacy/private-in-public-assoc-ty.stderr @@ -0,0 +1,68 @@ +error[E0446]: private type `Priv` in public interface + --> $DIR/private-in-public-assoc-ty.rs:17:9 + | +LL | struct Priv; + | ------------ `Priv` declared as private +... +LL | type A = Priv; + | ^^^^^^^^^^^^^^ can't leak private type + +warning: private trait `PrivTr` in public interface (error E0445) + --> $DIR/private-in-public-assoc-ty.rs:24:9 + | +LL | type Alias1: PrivTr; + | ^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(private_in_public)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #34537 + +warning: private type `Priv` in public interface (error E0446) + --> $DIR/private-in-public-assoc-ty.rs:27:9 + | +LL | type Alias2: PubTrAux1 = u8; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #34537 + +warning: private type `Priv` in public interface (error E0446) + --> $DIR/private-in-public-assoc-ty.rs:30:9 + | +LL | type Alias3: PubTrAux2 = u8; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #34537 + +error[E0446]: private type `Priv` in public interface + --> $DIR/private-in-public-assoc-ty.rs:34:9 + | +LL | struct Priv; + | ------------ `Priv` declared as private +... +LL | type Alias4 = Priv; + | ^^^^^^^^^^^^^^^^^^^ can't leak private type + +error[E0446]: private type `Priv` in public interface + --> $DIR/private-in-public-assoc-ty.rs:41:9 + | +LL | struct Priv; + | ------------ `Priv` declared as private +... +LL | type Alias1 = Priv; + | ^^^^^^^^^^^^^^^^^^^ can't leak private type + +error[E0445]: private trait `PrivTr` in public interface + --> $DIR/private-in-public-assoc-ty.rs:44:9 + | +LL | trait PrivTr {} + | ------------ `PrivTr` declared as private +... +LL | type Exist = impl PrivTr; + | ^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait + +error: aborting due to 4 previous errors; 3 warnings emitted + +Some errors have detailed explanations: E0445, E0446. +For more information about an error, try `rustc --explain E0445`. diff --git a/src/test/ui/privacy/private-in-public-type-alias-impl-trait.rs b/src/test/ui/privacy/private-in-public-type-alias-impl-trait.rs index 91dade4a2c1..c7df31529bc 100644 --- a/src/test/ui/privacy/private-in-public-type-alias-impl-trait.rs +++ b/src/test/ui/privacy/private-in-public-type-alias-impl-trait.rs @@ -1,8 +1,6 @@ // build-pass (FIXME(62277): could be check-pass?) -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] #![deny(private_in_public)] pub type Pub = impl Default; diff --git a/src/test/ui/save-analysis/issue-68621.rs b/src/test/ui/save-analysis/issue-68621.rs index 33bb55e50e0..96af085c5b6 100644 --- a/src/test/ui/save-analysis/issue-68621.rs +++ b/src/test/ui/save-analysis/issue-68621.rs @@ -1,8 +1,6 @@ // compile-flags: -Zsave-analysis -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] trait Trait {} diff --git a/src/test/ui/save-analysis/issue-68621.stderr b/src/test/ui/save-analysis/issue-68621.stderr new file mode 100644 index 00000000000..3af6d0a3e07 --- /dev/null +++ b/src/test/ui/save-analysis/issue-68621.stderr @@ -0,0 +1,8 @@ +error: could not find defining uses + --> $DIR/issue-68621.rs:14:19 + | +LL | type Future = impl Trait; + | ^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/traits/alias/issue-83613.rs b/src/test/ui/traits/alias/issue-83613.rs index 146920ac685..0013d5d66f1 100644 --- a/src/test/ui/traits/alias/issue-83613.rs +++ b/src/test/ui/traits/alias/issue-83613.rs @@ -1,4 +1,4 @@ -#![feature(min_type_alias_impl_trait)] +#![feature(type_alias_impl_trait)] trait OpaqueTrait {} impl OpaqueTrait for T {} type OpaqueType = impl OpaqueTrait; diff --git a/src/test/ui/type-alias-impl-trait/assoc-type-const.rs b/src/test/ui/type-alias-impl-trait/assoc-type-const.rs index 4db32a3113c..d53f562e99f 100644 --- a/src/test/ui/type-alias-impl-trait/assoc-type-const.rs +++ b/src/test/ui/type-alias-impl-trait/assoc-type-const.rs @@ -2,9 +2,7 @@ // const generics in an associated opaque type // check-pass -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] #![feature(const_generics)] //~^ WARN the feature `const_generics` is incomplete diff --git a/src/test/ui/type-alias-impl-trait/assoc-type-const.stderr b/src/test/ui/type-alias-impl-trait/assoc-type-const.stderr new file mode 100644 index 00000000000..e0c1b023861 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/assoc-type-const.stderr @@ -0,0 +1,11 @@ +warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes + --> $DIR/assoc-type-const.rs:6:12 + | +LL | #![feature(const_generics)] + | ^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default + = note: see issue #44580 for more information + +warning: 1 warning emitted + diff --git a/src/test/ui/type-alias-impl-trait/assoc-type-lifetime-unconstrained.rs b/src/test/ui/type-alias-impl-trait/assoc-type-lifetime-unconstrained.rs index cb849e12942..3f34b00ec77 100644 --- a/src/test/ui/type-alias-impl-trait/assoc-type-lifetime-unconstrained.rs +++ b/src/test/ui/type-alias-impl-trait/assoc-type-lifetime-unconstrained.rs @@ -1,9 +1,7 @@ // Tests that we don't allow unconstrained lifetime parameters in impls when // the lifetime is used in an associated opaque type. -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] trait UnwrapItemsExt { type Iter; diff --git a/src/test/ui/type-alias-impl-trait/assoc-type-lifetime-unconstrained.stderr b/src/test/ui/type-alias-impl-trait/assoc-type-lifetime-unconstrained.stderr new file mode 100644 index 00000000000..e594dc577b1 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/assoc-type-lifetime-unconstrained.stderr @@ -0,0 +1,9 @@ +error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates + --> $DIR/assoc-type-lifetime-unconstrained.rs:17:6 + | +LL | impl<'a, I> UnwrapItemsExt for I { + | ^^ unconstrained lifetime parameter + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0207`. diff --git a/src/test/ui/type-alias-impl-trait/assoc-type-lifetime.rs b/src/test/ui/type-alias-impl-trait/assoc-type-lifetime.rs index 28535fe5567..39f785d8cc5 100644 --- a/src/test/ui/type-alias-impl-trait/assoc-type-lifetime.rs +++ b/src/test/ui/type-alias-impl-trait/assoc-type-lifetime.rs @@ -2,9 +2,7 @@ // lifetimes are used in an associated opaque type // check-pass -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] trait UnwrapItemsExt<'a> { type Iter; diff --git a/src/test/ui/type-alias-impl-trait/associated-type-alias-impl-trait.rs b/src/test/ui/type-alias-impl-trait/associated-type-alias-impl-trait.rs index b9324991a5f..42f07d49ffe 100644 --- a/src/test/ui/type-alias-impl-trait/associated-type-alias-impl-trait.rs +++ b/src/test/ui/type-alias-impl-trait/associated-type-alias-impl-trait.rs @@ -1,6 +1,4 @@ -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] // build-pass (FIXME(62277): could be check-pass?) trait Bar {} diff --git a/src/test/ui/type-alias-impl-trait/auxiliary/cross_crate_ice.rs b/src/test/ui/type-alias-impl-trait/auxiliary/cross_crate_ice.rs index 64bf96259f0..e7bca2231de 100644 --- a/src/test/ui/type-alias-impl-trait/auxiliary/cross_crate_ice.rs +++ b/src/test/ui/type-alias-impl-trait/auxiliary/cross_crate_ice.rs @@ -1,9 +1,7 @@ // Crate that exports an opaque `impl Trait` type. Used for testing cross-crate. #![crate_type = "rlib"] -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] pub type Foo = impl std::fmt::Debug; diff --git a/src/test/ui/type-alias-impl-trait/auxiliary/cross_crate_ice2.rs b/src/test/ui/type-alias-impl-trait/auxiliary/cross_crate_ice2.rs index 09aa2691804..119f7df1ffd 100644 --- a/src/test/ui/type-alias-impl-trait/auxiliary/cross_crate_ice2.rs +++ b/src/test/ui/type-alias-impl-trait/auxiliary/cross_crate_ice2.rs @@ -1,9 +1,7 @@ // Crate that exports an opaque `impl Trait` type. Used for testing cross-crate. #![crate_type = "rlib"] -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] pub trait View { type Tmp: Iterator; diff --git a/src/test/ui/type-alias-impl-trait/bound_reduction.rs b/src/test/ui/type-alias-impl-trait/bound_reduction.rs index b45105ea8f2..b9b50f0b77a 100644 --- a/src/test/ui/type-alias-impl-trait/bound_reduction.rs +++ b/src/test/ui/type-alias-impl-trait/bound_reduction.rs @@ -1,9 +1,7 @@ // build-pass (FIXME(62277): could be check-pass?) #![allow(warnings)] -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] fn main() { } diff --git a/src/test/ui/type-alias-impl-trait/bound_reduction2.rs b/src/test/ui/type-alias-impl-trait/bound_reduction2.rs index 3e56d115b47..a15074c3593 100644 --- a/src/test/ui/type-alias-impl-trait/bound_reduction2.rs +++ b/src/test/ui/type-alias-impl-trait/bound_reduction2.rs @@ -1,6 +1,4 @@ -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] fn main() {} diff --git a/src/test/ui/type-alias-impl-trait/bound_reduction2.stderr b/src/test/ui/type-alias-impl-trait/bound_reduction2.stderr new file mode 100644 index 00000000000..c9d6a43b909 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/bound_reduction2.stderr @@ -0,0 +1,14 @@ +error: non-defining opaque type use in defining scope + --> $DIR/bound_reduction2.rs:15:46 + | +LL | fn foo_desugared(_: T) -> Foo { + | ^^^^^^^^^^^^^ + | +note: used non-generic type `::Assoc` for generic parameter + --> $DIR/bound_reduction2.rs:9:10 + | +LL | type Foo = impl Trait; + | ^ + +error: aborting due to previous error + diff --git a/src/test/ui/type-alias-impl-trait/bounds-are-checked-2.rs b/src/test/ui/type-alias-impl-trait/bounds-are-checked-2.rs index 5ffcd7ae546..c0359159aeb 100644 --- a/src/test/ui/type-alias-impl-trait/bounds-are-checked-2.rs +++ b/src/test/ui/type-alias-impl-trait/bounds-are-checked-2.rs @@ -1,9 +1,7 @@ // Make sure that we check that impl trait types implement the traits that they // claim to. -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] type X = impl Clone; //~^ ERROR the trait bound `T: Clone` is not satisfied diff --git a/src/test/ui/type-alias-impl-trait/bounds-are-checked-2.stderr b/src/test/ui/type-alias-impl-trait/bounds-are-checked-2.stderr new file mode 100644 index 00000000000..c1f58aa6de6 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/bounds-are-checked-2.stderr @@ -0,0 +1,14 @@ +error[E0277]: the trait bound `T: Clone` is not satisfied + --> $DIR/bounds-are-checked-2.rs:6:13 + | +LL | type X = impl Clone; + | ^^^^^^^^^^ the trait `Clone` is not implemented for `T` + | +help: consider restricting type parameter `T` + | +LL | type X = impl Clone; + | ^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/type-alias-impl-trait/bounds-are-checked.rs b/src/test/ui/type-alias-impl-trait/bounds-are-checked.rs index 74c49a9c6c7..eecef2338c1 100644 --- a/src/test/ui/type-alias-impl-trait/bounds-are-checked.rs +++ b/src/test/ui/type-alias-impl-trait/bounds-are-checked.rs @@ -1,9 +1,7 @@ // Make sure that we check that impl trait types implement the traits that they // claim to. -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] type X<'a> = impl Into<&'static str> + From<&'a str>; //~^ ERROR mismatched types diff --git a/src/test/ui/type-alias-impl-trait/bounds-are-checked.stderr b/src/test/ui/type-alias-impl-trait/bounds-are-checked.stderr new file mode 100644 index 00000000000..d5fafe05887 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/bounds-are-checked.stderr @@ -0,0 +1,26 @@ +warning: unnecessary lifetime parameter `'a` + --> $DIR/bounds-are-checked.rs:9:6 + | +LL | fn f<'a: 'static>(t: &'a str) -> X<'a> { + | ^^^^^^^^^^^ + | + = help: you can use the `'static` lifetime directly, in place of `'a` + +error[E0308]: mismatched types + --> $DIR/bounds-are-checked.rs:6:14 + | +LL | type X<'a> = impl Into<&'static str> + From<&'a str>; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch + | + = note: expected trait `From<&'a str>` + found trait `From<&'static str>` +note: the lifetime `'a` as defined on the item at 6:8... + --> $DIR/bounds-are-checked.rs:6:8 + | +LL | type X<'a> = impl Into<&'static str> + From<&'a str>; + | ^^ + = note: ...does not necessarily outlive the static lifetime + +error: aborting due to previous error; 1 warning emitted + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/type-alias-impl-trait/coherence.rs b/src/test/ui/type-alias-impl-trait/coherence.rs index 998eadeb271..1c0f83d6c12 100644 --- a/src/test/ui/type-alias-impl-trait/coherence.rs +++ b/src/test/ui/type-alias-impl-trait/coherence.rs @@ -1,7 +1,5 @@ // aux-build:foreign-crate.rs -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] extern crate foreign_crate; diff --git a/src/test/ui/type-alias-impl-trait/coherence.stderr b/src/test/ui/type-alias-impl-trait/coherence.stderr new file mode 100644 index 00000000000..6ede0fa14ba --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/coherence.stderr @@ -0,0 +1,9 @@ +error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or predicates + --> $DIR/coherence.rs:14:6 + | +LL | impl foreign_crate::ForeignTrait for AliasOfForeignType {} + | ^ unconstrained type parameter + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0207`. diff --git a/src/test/ui/type-alias-impl-trait/declared_but_never_defined.rs b/src/test/ui/type-alias-impl-trait/declared_but_never_defined.rs index a62ae2aff70..c4bf56a9197 100644 --- a/src/test/ui/type-alias-impl-trait/declared_but_never_defined.rs +++ b/src/test/ui/type-alias-impl-trait/declared_but_never_defined.rs @@ -1,6 +1,4 @@ -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] fn main() {} diff --git a/src/test/ui/type-alias-impl-trait/declared_but_never_defined.stderr b/src/test/ui/type-alias-impl-trait/declared_but_never_defined.stderr new file mode 100644 index 00000000000..21c2e8a9db6 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/declared_but_never_defined.stderr @@ -0,0 +1,8 @@ +error: could not find defining uses + --> $DIR/declared_but_never_defined.rs:6:12 + | +LL | type Bar = impl std::fmt::Debug; + | ^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/type-alias-impl-trait/declared_but_not_defined_in_scope.rs b/src/test/ui/type-alias-impl-trait/declared_but_not_defined_in_scope.rs index 0ada4a38da3..7ea517eb734 100644 --- a/src/test/ui/type-alias-impl-trait/declared_but_not_defined_in_scope.rs +++ b/src/test/ui/type-alias-impl-trait/declared_but_not_defined_in_scope.rs @@ -1,6 +1,4 @@ -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] fn main() {} diff --git a/src/test/ui/type-alias-impl-trait/declared_but_not_defined_in_scope.stderr b/src/test/ui/type-alias-impl-trait/declared_but_not_defined_in_scope.stderr new file mode 100644 index 00000000000..0b4c262bbb4 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/declared_but_not_defined_in_scope.stderr @@ -0,0 +1,23 @@ +error: could not find defining uses + --> $DIR/declared_but_not_defined_in_scope.rs:7:20 + | +LL | pub type Boo = impl ::std::fmt::Debug; + | ^^^^^^^^^^^^^^^^^^^^^^ + +error[E0308]: mismatched types + --> $DIR/declared_but_not_defined_in_scope.rs:11:5 + | +LL | pub type Boo = impl ::std::fmt::Debug; + | ---------------------- the expected opaque type +... +LL | fn bomp() -> boo::Boo { + | -------- expected `impl Debug` because of return type +LL | "" + | ^^ expected opaque type, found `&str` + | + = note: expected opaque type `impl Debug` + found reference `&'static str` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/type-alias-impl-trait/different_defining_uses.rs b/src/test/ui/type-alias-impl-trait/different_defining_uses.rs index bb981959b22..272af7a5204 100644 --- a/src/test/ui/type-alias-impl-trait/different_defining_uses.rs +++ b/src/test/ui/type-alias-impl-trait/different_defining_uses.rs @@ -1,6 +1,4 @@ -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] fn main() {} diff --git a/src/test/ui/type-alias-impl-trait/different_defining_uses.stderr b/src/test/ui/type-alias-impl-trait/different_defining_uses.stderr new file mode 100644 index 00000000000..eaa716bc71c --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/different_defining_uses.stderr @@ -0,0 +1,14 @@ +error: concrete type differs from previous defining opaque type use + --> $DIR/different_defining_uses.rs:12:1 + | +LL | fn bar() -> Foo { + | ^^^^^^^^^^^^^^^ expected `&'static str`, got `i32` + | +note: previous use here + --> $DIR/different_defining_uses.rs:8:1 + | +LL | fn foo() -> Foo { + | ^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/type-alias-impl-trait/different_defining_uses_never_type.rs b/src/test/ui/type-alias-impl-trait/different_defining_uses_never_type.rs index 716c7383c61..95cbcfec2dc 100644 --- a/src/test/ui/type-alias-impl-trait/different_defining_uses_never_type.rs +++ b/src/test/ui/type-alias-impl-trait/different_defining_uses_never_type.rs @@ -1,6 +1,4 @@ -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] fn main() {} diff --git a/src/test/ui/type-alias-impl-trait/different_defining_uses_never_type.stderr b/src/test/ui/type-alias-impl-trait/different_defining_uses_never_type.stderr new file mode 100644 index 00000000000..6274029e4f5 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/different_defining_uses_never_type.stderr @@ -0,0 +1,26 @@ +error: concrete type differs from previous defining opaque type use + --> $DIR/different_defining_uses_never_type.rs:12:1 + | +LL | fn bar() -> Foo { + | ^^^^^^^^^^^^^^^ expected `&'static str`, got `()` + | +note: previous use here + --> $DIR/different_defining_uses_never_type.rs:8:1 + | +LL | fn foo() -> Foo { + | ^^^^^^^^^^^^^^^ + +error: concrete type differs from previous defining opaque type use + --> $DIR/different_defining_uses_never_type.rs:17:1 + | +LL | fn boo() -> Foo { + | ^^^^^^^^^^^^^^^ expected `&'static str`, got `()` + | +note: previous use here + --> $DIR/different_defining_uses_never_type.rs:8:1 + | +LL | fn foo() -> Foo { + | ^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + diff --git a/src/test/ui/type-alias-impl-trait/different_defining_uses_never_type2.rs b/src/test/ui/type-alias-impl-trait/different_defining_uses_never_type2.rs index 8383f38ddbe..8549687ea78 100644 --- a/src/test/ui/type-alias-impl-trait/different_defining_uses_never_type2.rs +++ b/src/test/ui/type-alias-impl-trait/different_defining_uses_never_type2.rs @@ -1,8 +1,6 @@ // build-pass (FIXME(62277): could be check-pass?) -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] fn main() {} diff --git a/src/test/ui/type-alias-impl-trait/fallback.rs b/src/test/ui/type-alias-impl-trait/fallback.rs index 204dc0496ed..fe1ca2230da 100644 --- a/src/test/ui/type-alias-impl-trait/fallback.rs +++ b/src/test/ui/type-alias-impl-trait/fallback.rs @@ -2,9 +2,7 @@ // inference variable being completely unconstrained. // // check-pass -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] type Foo = impl Copy; diff --git a/src/test/ui/type-alias-impl-trait/generic_different_defining_uses.rs b/src/test/ui/type-alias-impl-trait/generic_different_defining_uses.rs index adf4c1f8656..07535130758 100644 --- a/src/test/ui/type-alias-impl-trait/generic_different_defining_uses.rs +++ b/src/test/ui/type-alias-impl-trait/generic_different_defining_uses.rs @@ -1,6 +1,4 @@ -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] fn main() {} diff --git a/src/test/ui/type-alias-impl-trait/generic_different_defining_uses.stderr b/src/test/ui/type-alias-impl-trait/generic_different_defining_uses.stderr new file mode 100644 index 00000000000..f8a058170e3 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/generic_different_defining_uses.stderr @@ -0,0 +1,14 @@ +error: concrete type differs from previous defining opaque type use + --> $DIR/generic_different_defining_uses.rs:11:1 + | +LL | fn my_iter2(t: T) -> MyIter { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `std::iter::Once`, got `std::option::IntoIter` + | +note: previous use here + --> $DIR/generic_different_defining_uses.rs:7:1 + | +LL | fn my_iter(t: T) -> MyIter { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_lifetime_param.rs b/src/test/ui/type-alias-impl-trait/generic_duplicate_lifetime_param.rs index f0b80db2a83..31f992976b1 100644 --- a/src/test/ui/type-alias-impl-trait/generic_duplicate_lifetime_param.rs +++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_lifetime_param.rs @@ -1,6 +1,4 @@ -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] fn main() {} diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_lifetime_param.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_lifetime_param.stderr new file mode 100644 index 00000000000..08b26b8fc13 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_lifetime_param.stderr @@ -0,0 +1,14 @@ +error: non-defining opaque type use in defining scope + --> $DIR/generic_duplicate_lifetime_param.rs:7:26 + | +LL | fn one<'a>(t: &'a ()) -> Two<'a, 'a> { + | ^^^^^^^^^^^ + | +note: lifetime used multiple times + --> $DIR/generic_duplicate_lifetime_param.rs:5:10 + | +LL | type Two<'a, 'b> = impl std::fmt::Debug; + | ^^ ^^ + +error: aborting due to previous error + diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use.rs b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use.rs index 12ff5a2e713..e45950c4926 100644 --- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use.rs +++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use.rs @@ -1,7 +1,5 @@ #![feature(const_generics)] -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] #![allow(incomplete_features)] use std::fmt::Debug; @@ -14,16 +12,16 @@ type TwoLifetimes<'a, 'b> = impl Debug; type TwoConsts = impl Debug; fn one_ty(t: T) -> TwoTys { -//~^ ERROR non-defining opaque type use in defining scope + //~^ ERROR non-defining opaque type use in defining scope t } fn one_lifetime<'a>(t: &'a u32) -> TwoLifetimes<'a, 'a> { -//~^ ERROR non-defining opaque type use in defining scope + //~^ ERROR non-defining opaque type use in defining scope t } fn one_const(t: *mut [u8; N]) -> TwoConsts { -//~^ ERROR non-defining opaque type use in defining scope + //~^ ERROR non-defining opaque type use in defining scope t } diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use.stderr new file mode 100644 index 00000000000..7ea5efd4e6b --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use.stderr @@ -0,0 +1,38 @@ +error: non-defining opaque type use in defining scope + --> $DIR/generic_duplicate_param_use.rs:14:30 + | +LL | fn one_ty(t: T) -> TwoTys { + | ^^^^^^^^^^^^ + | +note: type used multiple times + --> $DIR/generic_duplicate_param_use.rs:10:13 + | +LL | type TwoTys = impl Debug; + | ^ ^ + +error: non-defining opaque type use in defining scope + --> $DIR/generic_duplicate_param_use.rs:19:36 + | +LL | fn one_lifetime<'a>(t: &'a u32) -> TwoLifetimes<'a, 'a> { + | ^^^^^^^^^^^^^^^^^^^^ + | +note: lifetime used multiple times + --> $DIR/generic_duplicate_param_use.rs:11:19 + | +LL | type TwoLifetimes<'a, 'b> = impl Debug; + | ^^ ^^ + +error: non-defining opaque type use in defining scope + --> $DIR/generic_duplicate_param_use.rs:24:50 + | +LL | fn one_const(t: *mut [u8; N]) -> TwoConsts { + | ^^^^^^^^^^^^^^^ + | +note: constant used multiple times + --> $DIR/generic_duplicate_param_use.rs:12:22 + | +LL | type TwoConsts = impl Debug; + | ^ ^ + +error: aborting due to 3 previous errors + diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use10.rs b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use10.rs index afd2be26745..c17d595dbb3 100644 --- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use10.rs +++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use10.rs @@ -1,7 +1,5 @@ // check-pass -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] use std::fmt::Debug; diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use2.rs b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use2.rs index 9627689b15c..a74731df695 100644 --- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use2.rs +++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use2.rs @@ -1,6 +1,4 @@ -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] use std::fmt::Debug; diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use2.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use2.stderr new file mode 100644 index 00000000000..d87e8c5783b --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use2.stderr @@ -0,0 +1,14 @@ +error: non-defining opaque type use in defining scope + --> $DIR/generic_duplicate_param_use2.rs:10:27 + | +LL | fn one(t: T) -> Two { + | ^^^^^^^^^ + | +note: type used multiple times + --> $DIR/generic_duplicate_param_use2.rs:8:10 + | +LL | type Two = impl Debug; + | ^ ^ + +error: aborting due to previous error + diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use3.rs b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use3.rs index 04d00600c93..0597b8385d2 100644 --- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use3.rs +++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use3.rs @@ -1,6 +1,4 @@ -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] use std::fmt::Debug; diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use3.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use3.stderr new file mode 100644 index 00000000000..711de855f0d --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use3.stderr @@ -0,0 +1,14 @@ +error: non-defining opaque type use in defining scope + --> $DIR/generic_duplicate_param_use3.rs:10:27 + | +LL | fn one(t: T) -> Two { + | ^^^^^^^^^ + | +note: type used multiple times + --> $DIR/generic_duplicate_param_use3.rs:8:10 + | +LL | type Two = impl Debug; + | ^ ^ + +error: aborting due to previous error + diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use4.rs b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use4.rs index 0d2979626ac..e77c94988f7 100644 --- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use4.rs +++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use4.rs @@ -1,6 +1,4 @@ -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] use std::fmt::Debug; diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use4.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use4.stderr new file mode 100644 index 00000000000..fcf01f5164a --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use4.stderr @@ -0,0 +1,14 @@ +error: non-defining opaque type use in defining scope + --> $DIR/generic_duplicate_param_use4.rs:10:27 + | +LL | fn one(t: T) -> Two { + | ^^^^^^^^^ + | +note: type used multiple times + --> $DIR/generic_duplicate_param_use4.rs:8:10 + | +LL | type Two = impl Debug; + | ^ ^ + +error: aborting due to previous error + diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use5.rs b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use5.rs index 30ed7557c97..dd2f202cf5d 100644 --- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use5.rs +++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use5.rs @@ -1,6 +1,4 @@ -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] use std::fmt::Debug; diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use5.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use5.stderr new file mode 100644 index 00000000000..cb43b897cf9 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use5.stderr @@ -0,0 +1,39 @@ +error: concrete type differs from previous defining opaque type use + --> $DIR/generic_duplicate_param_use5.rs:16:1 + | +LL | fn three(t: T, u: U) -> Two { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `(T, U)`, got `(U, T)` + | +note: previous use here + --> $DIR/generic_duplicate_param_use5.rs:12:1 + | +LL | fn two(t: T, u: U) -> Two { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: `T` doesn't implement `Debug` + --> $DIR/generic_duplicate_param_use5.rs:8:18 + | +LL | type Two = impl Debug; + | ^^^^^^^^^^ `T` cannot be formatted using `{:?}` because it doesn't implement `Debug` + | + = note: required because of the requirements on the impl of `Debug` for `(T, U)` +help: consider restricting type parameter `T` + | +LL | type Two = impl Debug; + | ^^^^^^^^^^^^^^^^^ + +error[E0277]: `U` doesn't implement `Debug` + --> $DIR/generic_duplicate_param_use5.rs:8:18 + | +LL | type Two = impl Debug; + | ^^^^^^^^^^ `U` cannot be formatted using `{:?}` because it doesn't implement `Debug` + | + = note: required because of the requirements on the impl of `Debug` for `(T, U)` +help: consider restricting type parameter `U` + | +LL | type Two = impl Debug; + | ^^^^^^^^^^^^^^^^^ + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use6.rs b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use6.rs index 04644f1e18b..d54d3cd62e0 100644 --- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use6.rs +++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use6.rs @@ -1,6 +1,4 @@ -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] use std::fmt::Debug; diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use6.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use6.stderr new file mode 100644 index 00000000000..509da2320e8 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use6.stderr @@ -0,0 +1,27 @@ +error: concrete type differs from previous defining opaque type use + --> $DIR/generic_duplicate_param_use6.rs:15:1 + | +LL | fn three(t: T, u: U) -> Two { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `(T, T)`, got `(U, T)` + | +note: previous use here + --> $DIR/generic_duplicate_param_use6.rs:11:1 + | +LL | fn two(t: T, u: U) -> Two { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: `T` doesn't implement `Debug` + --> $DIR/generic_duplicate_param_use6.rs:8:18 + | +LL | type Two = impl Debug; + | ^^^^^^^^^^ `T` cannot be formatted using `{:?}` because it doesn't implement `Debug` + | + = note: required because of the requirements on the impl of `Debug` for `(T, T)` +help: consider restricting type parameter `T` + | +LL | type Two = impl Debug; + | ^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use7.rs b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use7.rs index df12882abad..feebf81eef2 100644 --- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use7.rs +++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use7.rs @@ -1,7 +1,5 @@ // check-pass -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] use std::fmt::Debug; diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use8.rs b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use8.rs index 283e0c1d660..4a723b64cdc 100644 --- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use8.rs +++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use8.rs @@ -1,6 +1,4 @@ -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] use std::fmt::Debug; diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use8.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use8.stderr new file mode 100644 index 00000000000..a09f2506258 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use8.stderr @@ -0,0 +1,27 @@ +error: concrete type differs from previous defining opaque type use + --> $DIR/generic_duplicate_param_use8.rs:14:1 + | +LL | fn three(_: T, u: U) -> Two { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `(T, u32)`, got `(U, u32)` + | +note: previous use here + --> $DIR/generic_duplicate_param_use8.rs:10:1 + | +LL | fn two(t: T, _: U) -> Two { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: `T` doesn't implement `Debug` + --> $DIR/generic_duplicate_param_use8.rs:7:18 + | +LL | type Two = impl Debug; + | ^^^^^^^^^^ `T` cannot be formatted using `{:?}` because it doesn't implement `Debug` + | + = note: required because of the requirements on the impl of `Debug` for `(T, u32)` +help: consider restricting type parameter `T` + | +LL | type Two = impl Debug; + | ^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use9.rs b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use9.rs index 4c3b0877d23..74708193317 100644 --- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use9.rs +++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use9.rs @@ -1,6 +1,4 @@ -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] use std::fmt::Debug; diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use9.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use9.stderr new file mode 100644 index 00000000000..68a30820951 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use9.stderr @@ -0,0 +1,51 @@ +error: concrete type differs from previous defining opaque type use + --> $DIR/generic_duplicate_param_use9.rs:21:1 + | +LL | fn three(t: T, u: U) -> Two { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `(A, B, ::Bar)`, got `(A, B, i32)` + | +note: previous use here + --> $DIR/generic_duplicate_param_use9.rs:17:1 + | +LL | fn two(t: T, u: U) -> Two { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `A: Foo` is not satisfied in `(A, B, ::Bar)` + --> $DIR/generic_duplicate_param_use9.rs:7:18 + | +LL | type Two = impl Debug; + | ^^^^^^^^^^ within `(A, B, ::Bar)`, the trait `Foo` is not implemented for `A` + | + = note: required because it appears within the type `(A, B, ::Bar)` +help: consider restricting type parameter `A` + | +LL | type Two = impl Debug; + | ^^^^^ + +error[E0277]: `A` doesn't implement `Debug` + --> $DIR/generic_duplicate_param_use9.rs:7:18 + | +LL | type Two = impl Debug; + | ^^^^^^^^^^ `A` cannot be formatted using `{:?}` because it doesn't implement `Debug` + | + = note: required because of the requirements on the impl of `Debug` for `(A, B, ::Bar)` +help: consider restricting type parameter `A` + | +LL | type Two = impl Debug; + | ^^^^^^^^^^^^^^^^^ + +error[E0277]: `B` doesn't implement `Debug` + --> $DIR/generic_duplicate_param_use9.rs:7:18 + | +LL | type Two = impl Debug; + | ^^^^^^^^^^ `B` cannot be formatted using `{:?}` because it doesn't implement `Debug` + | + = note: required because of the requirements on the impl of `Debug` for `(A, B, ::Bar)` +help: consider restricting type parameter `B` + | +LL | type Two = impl Debug; + | ^^^^^^^^^^^^^^^^^ + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/type-alias-impl-trait/generic_lifetime_param.rs b/src/test/ui/type-alias-impl-trait/generic_lifetime_param.rs index 7274f4f76f8..e109c38c986 100644 --- a/src/test/ui/type-alias-impl-trait/generic_lifetime_param.rs +++ b/src/test/ui/type-alias-impl-trait/generic_lifetime_param.rs @@ -1,8 +1,6 @@ // build-pass (FIXME(62277): could be check-pass?) -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] fn main() {} diff --git a/src/test/ui/type-alias-impl-trait/generic_nondefining_use.rs b/src/test/ui/type-alias-impl-trait/generic_nondefining_use.rs index c69884d8d6e..9f1bffff77c 100644 --- a/src/test/ui/type-alias-impl-trait/generic_nondefining_use.rs +++ b/src/test/ui/type-alias-impl-trait/generic_nondefining_use.rs @@ -1,7 +1,5 @@ #![feature(const_generics)] -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] #![allow(incomplete_features)] use std::fmt::Debug; @@ -15,16 +13,16 @@ type OneConst = impl Debug; // Not defining uses, because they doesn't define *all* possible generics. fn concrete_ty() -> OneTy { -//~^ ERROR non-defining opaque type use in defining scope + //~^ ERROR non-defining opaque type use in defining scope 5u32 } fn concrete_lifetime() -> OneLifetime<'static> { -//~^ ERROR non-defining opaque type use in defining scope + //~^ ERROR non-defining opaque type use in defining scope 6u32 } -fn concrete_const() -> OneConst<{123}> { -//~^ ERROR non-defining opaque type use in defining scope +fn concrete_const() -> OneConst<{ 123 }> { + //~^ ERROR non-defining opaque type use in defining scope 7u32 } diff --git a/src/test/ui/type-alias-impl-trait/generic_nondefining_use.stderr b/src/test/ui/type-alias-impl-trait/generic_nondefining_use.stderr new file mode 100644 index 00000000000..eb0c296bb62 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/generic_nondefining_use.stderr @@ -0,0 +1,35 @@ +error: non-defining opaque type use in defining scope + --> $DIR/generic_nondefining_use.rs:15:21 + | +LL | fn concrete_ty() -> OneTy { + | ^^^^^^^^^^ + | +note: used non-generic type `u32` for generic parameter + --> $DIR/generic_nondefining_use.rs:9:12 + | +LL | type OneTy = impl Debug; + | ^ + +error: non-defining opaque type use in defining scope + --> $DIR/generic_nondefining_use.rs:20:27 + | +LL | type OneLifetime<'a> = impl Debug; + | -- cannot use static lifetime; use a bound lifetime instead or remove the lifetime parameter from the opaque type +... +LL | fn concrete_lifetime() -> OneLifetime<'static> { + | ^^^^^^^^^^^^^^^^^^^^ + +error: non-defining opaque type use in defining scope + --> $DIR/generic_nondefining_use.rs:25:24 + | +LL | fn concrete_const() -> OneConst<{ 123 }> { + | ^^^^^^^^^^^^^^^^^ + | +note: used non-generic constant `{ 123 }` for generic parameter + --> $DIR/generic_nondefining_use.rs:11:21 + | +LL | type OneConst = impl Debug; + | ^ + +error: aborting due to 3 previous errors + diff --git a/src/test/ui/type-alias-impl-trait/generic_not_used.rs b/src/test/ui/type-alias-impl-trait/generic_not_used.rs index 36fae028d4e..dd6300a64f4 100644 --- a/src/test/ui/type-alias-impl-trait/generic_not_used.rs +++ b/src/test/ui/type-alias-impl-trait/generic_not_used.rs @@ -1,6 +1,4 @@ -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] fn main() {} diff --git a/src/test/ui/type-alias-impl-trait/generic_not_used.stderr b/src/test/ui/type-alias-impl-trait/generic_not_used.stderr new file mode 100644 index 00000000000..8015ff7eded --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/generic_not_used.stderr @@ -0,0 +1,18 @@ +error: at least one trait must be specified + --> $DIR/generic_not_used.rs:5:33 + | +LL | type WrongGeneric = impl 'static; + | ^^^^^^^^^^^^ + +error: type parameter `V` is part of concrete type but not used in parameter list for the `impl Trait` type alias + --> $DIR/generic_not_used.rs:8:73 + | +LL | fn wrong_generic(_: U, v: V) -> WrongGeneric { + | _________________________________________________________________________^ +LL | | +LL | | v +LL | | } + | |_^ + +error: aborting due to 2 previous errors + diff --git a/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.rs b/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.rs index bd0fc8cbace..9c6b93b7ba0 100644 --- a/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.rs +++ b/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.rs @@ -1,6 +1,4 @@ -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] fn main() { let y = 42; diff --git a/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.stderr b/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.stderr new file mode 100644 index 00000000000..18d8daa05e6 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.stderr @@ -0,0 +1,33 @@ +error: at least one trait must be specified + --> $DIR/generic_type_does_not_live_long_enough.rs:9:24 + | +LL | type WrongGeneric = impl 'static; + | ^^^^^^^^^^^^ + +error[E0308]: mismatched types + --> $DIR/generic_type_does_not_live_long_enough.rs:6:18 + | +LL | let z: i32 = x; + | --- ^ expected `i32`, found opaque type + | | + | expected due to this +... +LL | type WrongGeneric = impl 'static; + | ------------ the found opaque type + | + = note: expected type `i32` + found opaque type `impl Sized` + +error[E0310]: the parameter type `T` may not live long enough + --> $DIR/generic_type_does_not_live_long_enough.rs:9:24 + | +LL | type WrongGeneric = impl 'static; + | ^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds +... +LL | fn wrong_generic(t: T) -> WrongGeneric { + | - help: consider adding an explicit lifetime bound...: `T: 'static` + +error: aborting due to 3 previous errors + +Some errors have detailed explanations: E0308, E0310. +For more information about an error, try `rustc --explain E0308`. diff --git a/src/test/ui/type-alias-impl-trait/generic_underconstrained.rs b/src/test/ui/type-alias-impl-trait/generic_underconstrained.rs index 5d723e5bc62..766ee36c02b 100644 --- a/src/test/ui/type-alias-impl-trait/generic_underconstrained.rs +++ b/src/test/ui/type-alias-impl-trait/generic_underconstrained.rs @@ -1,6 +1,4 @@ -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] fn main() {} diff --git a/src/test/ui/type-alias-impl-trait/generic_underconstrained.stderr b/src/test/ui/type-alias-impl-trait/generic_underconstrained.stderr new file mode 100644 index 00000000000..cefc5d99b37 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/generic_underconstrained.stderr @@ -0,0 +1,23 @@ +error: at least one trait must be specified + --> $DIR/generic_underconstrained.rs:6:35 + | +LL | type Underconstrained = impl 'static; + | ^^^^^^^^^^^^ + +error[E0277]: the trait bound `T: Trait` is not satisfied + --> $DIR/generic_underconstrained.rs:10:31 + | +LL | type Underconstrained = impl 'static; + | ----- required by this bound in `Underconstrained` +... +LL | fn underconstrain(_: T) -> Underconstrained { + | ^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `T` + | +help: consider restricting type parameter `T` + | +LL | fn underconstrain(_: T) -> Underconstrained { + | ^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/type-alias-impl-trait/generic_underconstrained2.rs b/src/test/ui/type-alias-impl-trait/generic_underconstrained2.rs index 01cd1b9b972..cd7c962e2d1 100644 --- a/src/test/ui/type-alias-impl-trait/generic_underconstrained2.rs +++ b/src/test/ui/type-alias-impl-trait/generic_underconstrained2.rs @@ -1,6 +1,4 @@ -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] fn main() {} diff --git a/src/test/ui/type-alias-impl-trait/generic_underconstrained2.stderr b/src/test/ui/type-alias-impl-trait/generic_underconstrained2.stderr new file mode 100644 index 00000000000..8bba62a913e --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/generic_underconstrained2.stderr @@ -0,0 +1,43 @@ +error: at least one trait must be specified + --> $DIR/generic_underconstrained2.rs:5:45 + | +LL | type Underconstrained = impl 'static; + | ^^^^^^^^^^^^ + +error: at least one trait must be specified + --> $DIR/generic_underconstrained2.rs:14:46 + | +LL | type Underconstrained2 = impl 'static; + | ^^^^^^^^^^^^ + +error[E0277]: `U` doesn't implement `Debug` + --> $DIR/generic_underconstrained2.rs:9:33 + | +LL | type Underconstrained = impl 'static; + | --------------- required by this bound in `Underconstrained` +... +LL | fn underconstrained(_: U) -> Underconstrained { + | ^^^^^^^^^^^^^^^^^^^ `U` cannot be formatted using `{:?}` because it doesn't implement `Debug` + | +help: consider restricting type parameter `U` + | +LL | fn underconstrained(_: U) -> Underconstrained { + | ^^^^^^^^^^^^^^^^^ + +error[E0277]: `V` doesn't implement `Debug` + --> $DIR/generic_underconstrained2.rs:18:43 + | +LL | type Underconstrained2 = impl 'static; + | --------------- required by this bound in `Underconstrained2` +... +LL | fn underconstrained2(_: U, _: V) -> Underconstrained2 { + | ^^^^^^^^^^^^^^^^^^^^ `V` cannot be formatted using `{:?}` because it doesn't implement `Debug` + | +help: consider restricting type parameter `V` + | +LL | fn underconstrained2(_: U, _: V) -> Underconstrained2 { + | ^^^^^^^^^^^^^^^^^ + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/type-alias-impl-trait/impl-with-unconstrained-param.rs b/src/test/ui/type-alias-impl-trait/impl-with-unconstrained-param.rs index 6759799b37d..851c2f66c47 100644 --- a/src/test/ui/type-alias-impl-trait/impl-with-unconstrained-param.rs +++ b/src/test/ui/type-alias-impl-trait/impl-with-unconstrained-param.rs @@ -1,9 +1,7 @@ // Ensure that we don't ICE if associated type impl trait is used in an impl // with an unconstrained type parameter. -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] trait X { type I; diff --git a/src/test/ui/type-alias-impl-trait/impl-with-unconstrained-param.stderr b/src/test/ui/type-alias-impl-trait/impl-with-unconstrained-param.stderr new file mode 100644 index 00000000000..8cf8fb1d16c --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/impl-with-unconstrained-param.stderr @@ -0,0 +1,9 @@ +error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or predicates + --> $DIR/impl-with-unconstrained-param.rs:11:6 + | +LL | impl X for () { + | ^ unconstrained type parameter + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0207`. diff --git a/src/test/ui/type-alias-impl-trait/incoherent-assoc-imp-trait.rs b/src/test/ui/type-alias-impl-trait/incoherent-assoc-imp-trait.rs index f73169d7d08..c46c4715924 100644 --- a/src/test/ui/type-alias-impl-trait/incoherent-assoc-imp-trait.rs +++ b/src/test/ui/type-alias-impl-trait/incoherent-assoc-imp-trait.rs @@ -1,9 +1,7 @@ // Regression test for issue 67856 #![feature(unboxed_closures)] -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] #![feature(fn_traits)] trait MyTrait {} diff --git a/src/test/ui/type-alias-impl-trait/incoherent-assoc-imp-trait.stderr b/src/test/ui/type-alias-impl-trait/incoherent-assoc-imp-trait.stderr new file mode 100644 index 00000000000..e1e259187f5 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/incoherent-assoc-imp-trait.stderr @@ -0,0 +1,23 @@ +error[E0119]: conflicting implementations of trait `std::ops::FnOnce<()>` for type `&_` + --> $DIR/incoherent-assoc-imp-trait.rs:10:1 + | +LL | impl FnOnce<()> for &F { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: conflicting implementation in crate `core`: + - impl FnOnce for &F + where F: Fn, F: ?Sized; + +error[E0210]: type parameter `F` must be used as the type parameter for some local type (e.g., `MyStruct`) + --> $DIR/incoherent-assoc-imp-trait.rs:10:6 + | +LL | impl FnOnce<()> for &F { + | ^ type parameter `F` must be used as the type parameter for some local type + | + = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local + = note: only traits defined in the current crate can be implemented for a type parameter + +error: aborting due to 2 previous errors + +Some errors have detailed explanations: E0119, E0210. +For more information about an error, try `rustc --explain E0119`. diff --git a/src/test/ui/type-alias-impl-trait/issue-52843-closure-constrain.min_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-52843-closure-constrain.min_tait.stderr deleted file mode 100644 index 68231d43f62..00000000000 --- a/src/test/ui/type-alias-impl-trait/issue-52843-closure-constrain.min_tait.stderr +++ /dev/null @@ -1,24 +0,0 @@ -error[E0658]: type alias impl trait is not permitted here - --> $DIR/issue-52843-closure-constrain.rs:12:22 - | -LL | let null = || -> Opaque { 0 }; - | ^^^^^^ - | - = note: see issue #63063 for more information - = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable - -error: concrete type differs from previous defining opaque type use - --> $DIR/issue-52843-closure-constrain.rs:12:16 - | -LL | let null = || -> Opaque { 0 }; - | ^^^^^^^^^^^^^^^^^^ expected `String`, got `[type error]` - | -note: previous use here - --> $DIR/issue-52843-closure-constrain.rs:11:5 - | -LL | fn _unused() -> Opaque { String::new() } - | ^^^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/type-alias-impl-trait/issue-52843-closure-constrain.rs b/src/test/ui/type-alias-impl-trait/issue-52843-closure-constrain.rs index c7deb2e4eac..50eeff0b18f 100644 --- a/src/test/ui/type-alias-impl-trait/issue-52843-closure-constrain.rs +++ b/src/test/ui/type-alias-impl-trait/issue-52843-closure-constrain.rs @@ -1,15 +1,13 @@ // Checks to ensure that we properly detect when a closure constrains an opaque type -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] use std::fmt::Debug; fn main() { type Opaque = impl Debug; fn _unused() -> Opaque { String::new() } - let null = || -> Opaque { 0 }; //[min_tait]~ ERROR: not permitted here + let null = || -> Opaque { 0 }; //~^ ERROR: concrete type differs from previous defining opaque type use println!("{:?}", null()); } diff --git a/src/test/ui/type-alias-impl-trait/issue-52843-closure-constrain.stderr b/src/test/ui/type-alias-impl-trait/issue-52843-closure-constrain.stderr new file mode 100644 index 00000000000..d82050e263e --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/issue-52843-closure-constrain.stderr @@ -0,0 +1,14 @@ +error: concrete type differs from previous defining opaque type use + --> $DIR/issue-52843-closure-constrain.rs:10:16 + | +LL | let null = || -> Opaque { 0 }; + | ^^^^^^^^^^^^^^^^^^ expected `String`, got `i32` + | +note: previous use here + --> $DIR/issue-52843-closure-constrain.rs:9:5 + | +LL | fn _unused() -> Opaque { String::new() } + | ^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/type-alias-impl-trait/issue-52843.rs b/src/test/ui/type-alias-impl-trait/issue-52843.rs index 844bfa3b846..b24959d7207 100644 --- a/src/test/ui/type-alias-impl-trait/issue-52843.rs +++ b/src/test/ui/type-alias-impl-trait/issue-52843.rs @@ -1,6 +1,4 @@ -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] type Foo = impl Default; //~^ ERROR: the trait bound `T: Default` is not satisfied diff --git a/src/test/ui/type-alias-impl-trait/issue-52843.stderr b/src/test/ui/type-alias-impl-trait/issue-52843.stderr new file mode 100644 index 00000000000..8718a57d9d4 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/issue-52843.stderr @@ -0,0 +1,14 @@ +error[E0277]: the trait bound `T: Default` is not satisfied + --> $DIR/issue-52843.rs:3:15 + | +LL | type Foo = impl Default; + | ^^^^^^^^^^^^ the trait `Default` is not implemented for `T` + | +help: consider restricting type parameter `T` + | +LL | type Foo = impl Default; + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/type-alias-impl-trait/issue-53096.full_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-53096.full_tait.stderr index fb70582c31a..554215fe894 100644 --- a/src/test/ui/type-alias-impl-trait/issue-53096.full_tait.stderr +++ b/src/test/ui/type-alias-impl-trait/issue-53096.full_tait.stderr @@ -1,8 +1,9 @@ -error: fatal error triggered by #[rustc_error] - --> $DIR/issue-53096.rs:13:1 +error[E0636]: the feature `type_alias_impl_trait` has already been declared + --> $DIR/issue-53096.rs:4:32 | -LL | fn main() {} - | ^^^^^^^^^ +LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))] + | ^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error +For more information about this error, try `rustc --explain E0636`. diff --git a/src/test/ui/type-alias-impl-trait/issue-53096.rs b/src/test/ui/type-alias-impl-trait/issue-53096.rs index 249055bf26c..792bd16527b 100644 --- a/src/test/ui/type-alias-impl-trait/issue-53096.rs +++ b/src/test/ui/type-alias-impl-trait/issue-53096.rs @@ -1,7 +1,5 @@ #![feature(const_impl_trait, const_fn_fn_ptr_basics, rustc_attrs)] -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] type Foo = impl Fn() -> usize; const fn bar() -> Foo { diff --git a/src/test/ui/type-alias-impl-trait/issue-53096.stderr b/src/test/ui/type-alias-impl-trait/issue-53096.stderr new file mode 100644 index 00000000000..0af3a75f853 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/issue-53096.stderr @@ -0,0 +1,8 @@ +error: fatal error triggered by #[rustc_error] + --> $DIR/issue-53096.rs:11:1 + | +LL | fn main() {} + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/type-alias-impl-trait/issue-53598.rs b/src/test/ui/type-alias-impl-trait/issue-53598.rs index 1680d6e5839..37b330ba4b8 100644 --- a/src/test/ui/type-alias-impl-trait/issue-53598.rs +++ b/src/test/ui/type-alias-impl-trait/issue-53598.rs @@ -1,7 +1,5 @@ // ignore-compare-mode-chalk -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] use std::fmt::Debug; diff --git a/src/test/ui/type-alias-impl-trait/issue-53598.stderr b/src/test/ui/type-alias-impl-trait/issue-53598.stderr new file mode 100644 index 00000000000..4c8144a2359 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/issue-53598.stderr @@ -0,0 +1,12 @@ +error: type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias + --> $DIR/issue-53598.rs:20:42 + | +LL | fn foo(_: T) -> Self::Item { + | __________________________________________^ +LL | | +LL | | S::(Default::default()) +LL | | } + | |_____^ + +error: aborting due to previous error + diff --git a/src/test/ui/type-alias-impl-trait/issue-53678-generator-and-const-fn.rs b/src/test/ui/type-alias-impl-trait/issue-53678-generator-and-const-fn.rs index 9c50a3da95c..176118200e5 100644 --- a/src/test/ui/type-alias-impl-trait/issue-53678-generator-and-const-fn.rs +++ b/src/test/ui/type-alias-impl-trait/issue-53678-generator-and-const-fn.rs @@ -1,7 +1,5 @@ #![feature(const_impl_trait, generators, generator_trait, rustc_attrs)] -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] use std::ops::Generator; diff --git a/src/test/ui/type-alias-impl-trait/issue-53678-generator-and-const-fn.stderr b/src/test/ui/type-alias-impl-trait/issue-53678-generator-and-const-fn.stderr new file mode 100644 index 00000000000..eb1c9603a60 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/issue-53678-generator-and-const-fn.stderr @@ -0,0 +1,8 @@ +error: fatal error triggered by #[rustc_error] + --> $DIR/issue-53678-generator-and-const-fn.rs:19:1 + | +LL | fn main() {} + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/type-alias-impl-trait/issue-55099-lifetime-inference.rs b/src/test/ui/type-alias-impl-trait/issue-55099-lifetime-inference.rs index fc32d455aaa..af0780ab0b9 100644 --- a/src/test/ui/type-alias-impl-trait/issue-55099-lifetime-inference.rs +++ b/src/test/ui/type-alias-impl-trait/issue-55099-lifetime-inference.rs @@ -3,9 +3,7 @@ // Tests that we don't incorrectly consider a lifetime to part // of the concrete type -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] trait Future {} diff --git a/src/test/ui/type-alias-impl-trait/issue-57188-associate-impl-capture.rs b/src/test/ui/type-alias-impl-trait/issue-57188-associate-impl-capture.rs index 7207dda90dc..3a7a5da075f 100644 --- a/src/test/ui/type-alias-impl-trait/issue-57188-associate-impl-capture.rs +++ b/src/test/ui/type-alias-impl-trait/issue-57188-associate-impl-capture.rs @@ -2,9 +2,7 @@ // check-pass -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] struct Baz<'a> { source: &'a str, diff --git a/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.rs b/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.rs index fcc3555b231..a55fbf9c48a 100644 --- a/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.rs +++ b/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.rs @@ -3,9 +3,7 @@ // FIXME: This should compile, but it currently doesn't #![feature(trait_alias)] -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] trait Foo { type Bar: Baz; diff --git a/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.stderr b/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.stderr new file mode 100644 index 00000000000..f87beb66d99 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.stderr @@ -0,0 +1,11 @@ +error: implementation of `FnOnce` is not general enough + --> $DIR/issue-57611-trait-alias.rs:17:16 + | +LL | type Bar = impl Baz; + | ^^^^^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough + | + = note: closure with signature `fn(&'2 X) -> &X` must implement `FnOnce<(&'1 X,)>`, for any lifetime `'1`... + = note: ...but it actually implements `FnOnce<(&'2 X,)>`, for some specific lifetime `'2` + +error: aborting due to previous error + diff --git a/src/test/ui/type-alias-impl-trait/issue-57700.rs b/src/test/ui/type-alias-impl-trait/issue-57700.rs index 19b3d1ce2c7..f1db4d3291b 100644 --- a/src/test/ui/type-alias-impl-trait/issue-57700.rs +++ b/src/test/ui/type-alias-impl-trait/issue-57700.rs @@ -1,8 +1,6 @@ // ignore-compare-mode-chalk #![feature(arbitrary_self_types)] -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] use std::ops::Deref; diff --git a/src/test/ui/type-alias-impl-trait/issue-57700.stderr b/src/test/ui/type-alias-impl-trait/issue-57700.stderr new file mode 100644 index 00000000000..c701e3e74ef --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/issue-57700.stderr @@ -0,0 +1,12 @@ +error: type parameter `impl Deref` is part of concrete type but not used in parameter list for the `impl Trait` type alias + --> $DIR/issue-57700.rs:16:58 + | +LL | fn foo(self: impl Deref) -> Self::Bar { + | __________________________________________________________^ +LL | | +LL | | self +LL | | } + | |_____^ + +error: aborting due to previous error + diff --git a/src/test/ui/type-alias-impl-trait/issue-57807-associated-type.rs b/src/test/ui/type-alias-impl-trait/issue-57807-associated-type.rs index 9118648fe42..fcab2c7db26 100644 --- a/src/test/ui/type-alias-impl-trait/issue-57807-associated-type.rs +++ b/src/test/ui/type-alias-impl-trait/issue-57807-associated-type.rs @@ -2,9 +2,7 @@ // that we properly unify associated types within // a type alias impl trait // check-pass -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] trait Bar { type A; diff --git a/src/test/ui/type-alias-impl-trait/issue-58887.rs b/src/test/ui/type-alias-impl-trait/issue-58887.rs index 0a09bd50a6e..96ac7860283 100644 --- a/src/test/ui/type-alias-impl-trait/issue-58887.rs +++ b/src/test/ui/type-alias-impl-trait/issue-58887.rs @@ -1,8 +1,6 @@ // run-pass -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] trait UnwrapItemsExt { type Iter; diff --git a/src/test/ui/type-alias-impl-trait/issue-58951.rs b/src/test/ui/type-alias-impl-trait/issue-58951.rs index 932684ec089..7303cbab4a8 100644 --- a/src/test/ui/type-alias-impl-trait/issue-58951.rs +++ b/src/test/ui/type-alias-impl-trait/issue-58951.rs @@ -1,8 +1,6 @@ // check-pass -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] type A = impl Iterator; diff --git a/src/test/ui/type-alias-impl-trait/issue-60371.stderr b/src/test/ui/type-alias-impl-trait/issue-60371.stderr index a9df74689df..9abdd70bbd9 100644 --- a/src/test/ui/type-alias-impl-trait/issue-60371.stderr +++ b/src/test/ui/type-alias-impl-trait/issue-60371.stderr @@ -5,7 +5,7 @@ LL | type Item = impl Bug; | ^^^^^^^^ | = note: see issue #63063 for more information - = help: add `#![feature(min_type_alias_impl_trait)]` to the crate attributes to enable + = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable error[E0658]: type alias impl trait is not permitted here --> $DIR/issue-60371.rs:13:40 diff --git a/src/test/ui/type-alias-impl-trait/issue-60407.full_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-60407.full_tait.stderr index adb07f5227b..9b2d21192cd 100644 --- a/src/test/ui/type-alias-impl-trait/issue-60407.full_tait.stderr +++ b/src/test/ui/type-alias-impl-trait/issue-60407.full_tait.stderr @@ -1,8 +1,9 @@ -error: fatal error triggered by #[rustc_error] - --> $DIR/issue-60407.rs:10:1 +error[E0636]: the feature `type_alias_impl_trait` has already been declared + --> $DIR/issue-60407.rs:3:32 | -LL | fn main() { - | ^^^^^^^^^ +LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))] + | ^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error +For more information about this error, try `rustc --explain E0636`. diff --git a/src/test/ui/type-alias-impl-trait/issue-60407.rs b/src/test/ui/type-alias-impl-trait/issue-60407.rs index 7319bcf4cd9..b833429c769 100644 --- a/src/test/ui/type-alias-impl-trait/issue-60407.rs +++ b/src/test/ui/type-alias-impl-trait/issue-60407.rs @@ -1,6 +1,4 @@ -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait, rustc_attrs)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait, rustc_attrs)] type Debuggable = impl core::fmt::Debug; diff --git a/src/test/ui/type-alias-impl-trait/issue-60407.stderr b/src/test/ui/type-alias-impl-trait/issue-60407.stderr new file mode 100644 index 00000000000..fecee27797a --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/issue-60407.stderr @@ -0,0 +1,8 @@ +error: fatal error triggered by #[rustc_error] + --> $DIR/issue-60407.rs:8:1 + | +LL | fn main() { + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/type-alias-impl-trait/issue-60564.rs b/src/test/ui/type-alias-impl-trait/issue-60564.rs index 7f780a253c9..78def0d1136 100644 --- a/src/test/ui/type-alias-impl-trait/issue-60564.rs +++ b/src/test/ui/type-alias-impl-trait/issue-60564.rs @@ -1,6 +1,4 @@ -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] trait IterBits { type BitsIter: Iterator; diff --git a/src/test/ui/type-alias-impl-trait/issue-60564.stderr b/src/test/ui/type-alias-impl-trait/issue-60564.stderr new file mode 100644 index 00000000000..66fa862ef9d --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/issue-60564.stderr @@ -0,0 +1,14 @@ +error: non-defining opaque type use in defining scope + --> $DIR/issue-60564.rs:19:34 + | +LL | fn iter_bits(self, n: u8) -> Self::BitsIter { + | ^^^^^^^^^^^^^^ + | +note: used non-generic type `u8` for generic parameter + --> $DIR/issue-60564.rs:8:25 + | +LL | type IterBitsIter = impl std::iter::Iterator; + | ^ + +error: aborting due to previous error + diff --git a/src/test/ui/type-alias-impl-trait/issue-62000-associate-impl-trait-lifetimes.rs b/src/test/ui/type-alias-impl-trait/issue-62000-associate-impl-trait-lifetimes.rs index 38370cd008f..36779a0ce89 100644 --- a/src/test/ui/type-alias-impl-trait/issue-62000-associate-impl-trait-lifetimes.rs +++ b/src/test/ui/type-alias-impl-trait/issue-62000-associate-impl-trait-lifetimes.rs @@ -2,9 +2,7 @@ // check-pass -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] trait MyTrait { type AssocType: Send; diff --git a/src/test/ui/type-alias-impl-trait/issue-63263-closure-return.rs b/src/test/ui/type-alias-impl-trait/issue-63263-closure-return.rs index 634ec0f515f..7414611a748 100644 --- a/src/test/ui/type-alias-impl-trait/issue-63263-closure-return.rs +++ b/src/test/ui/type-alias-impl-trait/issue-63263-closure-return.rs @@ -4,7 +4,7 @@ // check-pass -#![feature(min_type_alias_impl_trait, type_alias_impl_trait)] +#![feature(type_alias_impl_trait)] pub type Closure = impl FnOnce(); diff --git a/src/test/ui/type-alias-impl-trait/issue-63279.min_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-63279.min_tait.stderr deleted file mode 100644 index a93d2dfcee5..00000000000 --- a/src/test/ui/type-alias-impl-trait/issue-63279.min_tait.stderr +++ /dev/null @@ -1,22 +0,0 @@ -error[E0658]: type alias impl trait is not permitted here - --> $DIR/issue-63279.rs:10:11 - | -LL | || -> Closure { || () } - | ^^^^^^^ - | - = note: see issue #63063 for more information - = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable - -error[E0271]: type mismatch resolving `<[closure@$DIR/issue-63279.rs:10:5: 10:28] as FnOnce<()>>::Output == ()` - --> $DIR/issue-63279.rs:7:16 - | -LL | type Closure = impl FnOnce(); - | ^^^^^^^^^^^^^ expected `()`, found opaque type - | - = note: expected unit type `()` - found opaque type `impl FnOnce<()>` - -error: aborting due to 2 previous errors - -Some errors have detailed explanations: E0271, E0658. -For more information about an error, try `rustc --explain E0271`. diff --git a/src/test/ui/type-alias-impl-trait/issue-63279.rs b/src/test/ui/type-alias-impl-trait/issue-63279.rs index 4c9c26a343c..b97192a2aed 100644 --- a/src/test/ui/type-alias-impl-trait/issue-63279.rs +++ b/src/test/ui/type-alias-impl-trait/issue-63279.rs @@ -1,13 +1,11 @@ // compile-flags: -Zsave-analysis -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] type Closure = impl FnOnce(); //~ ERROR: type mismatch resolving fn c() -> Closure { - || -> Closure { || () } //[min_tait]~ ERROR: not permitted here + || -> Closure { || () } } fn main() {} diff --git a/src/test/ui/type-alias-impl-trait/issue-63279.stderr b/src/test/ui/type-alias-impl-trait/issue-63279.stderr new file mode 100644 index 00000000000..63a83a60ff8 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/issue-63279.stderr @@ -0,0 +1,12 @@ +error[E0271]: type mismatch resolving `<[closure@$DIR/issue-63279.rs:8:5: 8:28] as FnOnce<()>>::Output == ()` + --> $DIR/issue-63279.rs:5:16 + | +LL | type Closure = impl FnOnce(); + | ^^^^^^^^^^^^^ expected `()`, found opaque type + | + = note: expected unit type `()` + found opaque type `impl FnOnce<()>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0271`. diff --git a/src/test/ui/type-alias-impl-trait/issue-63355.rs b/src/test/ui/type-alias-impl-trait/issue-63355.rs index 8762d189c73..ff4fd5dcec7 100644 --- a/src/test/ui/type-alias-impl-trait/issue-63355.rs +++ b/src/test/ui/type-alias-impl-trait/issue-63355.rs @@ -1,4 +1,4 @@ -#![feature(min_type_alias_impl_trait)] +#![feature(type_alias_impl_trait)] #![feature(type_alias_impl_trait)] #![allow(incomplete_features)] @@ -28,7 +28,7 @@ impl Bar for () { } } -// FIXME(#86731): The below is illegal use of `min_type_alias_impl_trait` +// FIXME(#86731): The below is illegal use of `type_alias_impl_trait` // but the compiler doesn't report it, we should fix it. pub type FooImpl = impl Foo; pub type BarImpl = impl Bar; diff --git a/src/test/ui/type-alias-impl-trait/issue-63677-type-alias-coherence.rs b/src/test/ui/type-alias-impl-trait/issue-63677-type-alias-coherence.rs index b477fea41b7..28f4a85c9f2 100644 --- a/src/test/ui/type-alias-impl-trait/issue-63677-type-alias-coherence.rs +++ b/src/test/ui/type-alias-impl-trait/issue-63677-type-alias-coherence.rs @@ -2,9 +2,7 @@ // Regression test for issue #63677 - ensure that // coherence checking can properly handle 'impl trait' // in type aliases -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] pub trait Trait {} pub struct S1(T); diff --git a/src/test/ui/type-alias-impl-trait/issue-65384.rs b/src/test/ui/type-alias-impl-trait/issue-65384.rs index 63666c497c6..273928c4d66 100644 --- a/src/test/ui/type-alias-impl-trait/issue-65384.rs +++ b/src/test/ui/type-alias-impl-trait/issue-65384.rs @@ -1,4 +1,4 @@ -#![feature(min_type_alias_impl_trait)] +#![feature(type_alias_impl_trait)] #![feature(type_alias_impl_trait)] #![allow(incomplete_features)] diff --git a/src/test/ui/type-alias-impl-trait/issue-65679-inst-opaque-ty-from-val-twice.full_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-65679-inst-opaque-ty-from-val-twice.full_tait.stderr index 6b4ea787ea8..98d20d6ca0d 100644 --- a/src/test/ui/type-alias-impl-trait/issue-65679-inst-opaque-ty-from-val-twice.full_tait.stderr +++ b/src/test/ui/type-alias-impl-trait/issue-65679-inst-opaque-ty-from-val-twice.full_tait.stderr @@ -1,8 +1,9 @@ -error: fatal error triggered by #[rustc_error] - --> $DIR/issue-65679-inst-opaque-ty-from-val-twice.rs:17:1 +error[E0636]: the feature `type_alias_impl_trait` has already been declared + --> $DIR/issue-65679-inst-opaque-ty-from-val-twice.rs:5:32 | -LL | fn main() { - | ^^^^^^^^^ +LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))] + | ^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error +For more information about this error, try `rustc --explain E0636`. diff --git a/src/test/ui/type-alias-impl-trait/issue-65679-inst-opaque-ty-from-val-twice.min_tait.stderr b/src/test/ui/type-alias-impl-trait/issue-65679-inst-opaque-ty-from-val-twice.min_tait.stderr deleted file mode 100644 index 6798ecb9489..00000000000 --- a/src/test/ui/type-alias-impl-trait/issue-65679-inst-opaque-ty-from-val-twice.min_tait.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0658]: type alias impl trait is not permitted here - --> $DIR/issue-65679-inst-opaque-ty-from-val-twice.rs:19:13 - | -LL | take(|| {}); - | ^ - | - = note: see issue #63063 for more information - = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable - -error[E0658]: type alias impl trait is not permitted here - --> $DIR/issue-65679-inst-opaque-ty-from-val-twice.rs:21:13 - | -LL | take(|| {}); - | ^ - | - = note: see issue #63063 for more information - = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/type-alias-impl-trait/issue-65679-inst-opaque-ty-from-val-twice.rs b/src/test/ui/type-alias-impl-trait/issue-65679-inst-opaque-ty-from-val-twice.rs index f181b3d06a6..0f0cd4e9227 100644 --- a/src/test/ui/type-alias-impl-trait/issue-65679-inst-opaque-ty-from-val-twice.rs +++ b/src/test/ui/type-alias-impl-trait/issue-65679-inst-opaque-ty-from-val-twice.rs @@ -1,8 +1,6 @@ // compile-flags: -Zsave-analysis -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait, rustc_attrs)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait, rustc_attrs)] type T = impl Sized; // The concrete type referred by impl-trait-type-alias(`T`) is guaranteed @@ -15,9 +13,7 @@ fn take(_: fn() -> T) {} #[rustc_error] fn main() { - //[full_tait]~^ ERROR fatal error triggered by #[rustc_error] + //~^ ERROR fatal error triggered by #[rustc_error] take(|| {}); - //[min_tait]~^ ERROR not permitted here take(|| {}); - //[min_tait]~^ ERROR not permitted here } diff --git a/src/test/ui/type-alias-impl-trait/issue-65679-inst-opaque-ty-from-val-twice.stderr b/src/test/ui/type-alias-impl-trait/issue-65679-inst-opaque-ty-from-val-twice.stderr new file mode 100644 index 00000000000..f3683f2bf96 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/issue-65679-inst-opaque-ty-from-val-twice.stderr @@ -0,0 +1,8 @@ +error: fatal error triggered by #[rustc_error] + --> $DIR/issue-65679-inst-opaque-ty-from-val-twice.rs:15:1 + | +LL | fn main() { + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/type-alias-impl-trait/issue-65918.rs b/src/test/ui/type-alias-impl-trait/issue-65918.rs index b15bff57a0d..af6d5010920 100644 --- a/src/test/ui/type-alias-impl-trait/issue-65918.rs +++ b/src/test/ui/type-alias-impl-trait/issue-65918.rs @@ -2,9 +2,7 @@ // build-pass -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] use std::marker::PhantomData; diff --git a/src/test/ui/type-alias-impl-trait/issue-66580-closure-coherence.rs b/src/test/ui/type-alias-impl-trait/issue-66580-closure-coherence.rs index 7fdaa7fb99b..d97270c3124 100644 --- a/src/test/ui/type-alias-impl-trait/issue-66580-closure-coherence.rs +++ b/src/test/ui/type-alias-impl-trait/issue-66580-closure-coherence.rs @@ -2,9 +2,7 @@ // Ensures that we don't try to determine whether a closure // is foreign when it's the underlying type of an opaque type // check-pass -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] type Closure = impl FnOnce(); diff --git a/src/test/ui/type-alias-impl-trait/issue-67844-nested-opaque.rs b/src/test/ui/type-alias-impl-trait/issue-67844-nested-opaque.rs index f47f0cdba88..cd219328a99 100644 --- a/src/test/ui/type-alias-impl-trait/issue-67844-nested-opaque.rs +++ b/src/test/ui/type-alias-impl-trait/issue-67844-nested-opaque.rs @@ -3,9 +3,7 @@ // Ensures that we properly handle nested TAIT occurrences // with generic parameters -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] trait WithAssoc { type AssocType; diff --git a/src/test/ui/type-alias-impl-trait/issue-68368-non-defining-use.rs b/src/test/ui/type-alias-impl-trait/issue-68368-non-defining-use.rs index b31c79b8b2b..3b6decbe9c6 100644 --- a/src/test/ui/type-alias-impl-trait/issue-68368-non-defining-use.rs +++ b/src/test/ui/type-alias-impl-trait/issue-68368-non-defining-use.rs @@ -2,9 +2,7 @@ // Ensures that we don't ICE when emitting an error // for a non-defining use when lifetimes are involved -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] trait Trait {} type Alias<'a, U> = impl Trait; fn f<'a>() -> Alias<'a, ()> {} diff --git a/src/test/ui/type-alias-impl-trait/issue-68368-non-defining-use.stderr b/src/test/ui/type-alias-impl-trait/issue-68368-non-defining-use.stderr new file mode 100644 index 00000000000..c2fa54f50f8 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/issue-68368-non-defining-use.stderr @@ -0,0 +1,14 @@ +error: non-defining opaque type use in defining scope + --> $DIR/issue-68368-non-defining-use.rs:8:15 + | +LL | fn f<'a>() -> Alias<'a, ()> {} + | ^^^^^^^^^^^^^ + | +note: used non-generic type `()` for generic parameter + --> $DIR/issue-68368-non-defining-use.rs:7:16 + | +LL | type Alias<'a, U> = impl Trait; + | ^ + +error: aborting due to previous error + diff --git a/src/test/ui/type-alias-impl-trait/issue-69136-inner-lifetime-resolve-error.rs b/src/test/ui/type-alias-impl-trait/issue-69136-inner-lifetime-resolve-error.rs index ae89cdd1c08..6732902c09a 100644 --- a/src/test/ui/type-alias-impl-trait/issue-69136-inner-lifetime-resolve-error.rs +++ b/src/test/ui/type-alias-impl-trait/issue-69136-inner-lifetime-resolve-error.rs @@ -1,8 +1,6 @@ // Regression test for #69136 -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] trait SomeTrait {} diff --git a/src/test/ui/type-alias-impl-trait/issue-69136-inner-lifetime-resolve-error.stderr b/src/test/ui/type-alias-impl-trait/issue-69136-inner-lifetime-resolve-error.stderr new file mode 100644 index 00000000000..fe45e39d938 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/issue-69136-inner-lifetime-resolve-error.stderr @@ -0,0 +1,11 @@ +error[E0261]: use of undeclared lifetime name `'a` + --> $DIR/issue-69136-inner-lifetime-resolve-error.rs:17:65 + | +LL | type Return = impl WithAssoc; + | - ^^ undeclared lifetime + | | + | help: consider introducing lifetime `'a` here: `'a,` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0261`. diff --git a/src/test/ui/type-alias-impl-trait/issue-69136-inner-lifetime-resolve-ok.rs b/src/test/ui/type-alias-impl-trait/issue-69136-inner-lifetime-resolve-ok.rs index 05d50f0f1bf..a6916eda8b0 100644 --- a/src/test/ui/type-alias-impl-trait/issue-69136-inner-lifetime-resolve-ok.rs +++ b/src/test/ui/type-alias-impl-trait/issue-69136-inner-lifetime-resolve-ok.rs @@ -2,9 +2,7 @@ // check-pass -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] trait SomeTrait {} diff --git a/src/test/ui/type-alias-impl-trait/issue-69323.rs b/src/test/ui/type-alias-impl-trait/issue-69323.rs index 9c4b4433f9f..a9bd6daf2ac 100644 --- a/src/test/ui/type-alias-impl-trait/issue-69323.rs +++ b/src/test/ui/type-alias-impl-trait/issue-69323.rs @@ -1,8 +1,6 @@ // check-pass -// revisions: min full -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] use std::iter::{once, Chain}; diff --git a/src/test/ui/type-alias-impl-trait/issue-70121.rs b/src/test/ui/type-alias-impl-trait/issue-70121.rs index 1eb33c805bb..dff0d89d465 100644 --- a/src/test/ui/type-alias-impl-trait/issue-70121.rs +++ b/src/test/ui/type-alias-impl-trait/issue-70121.rs @@ -1,8 +1,6 @@ // check-pass -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] pub type Successors<'a> = impl Iterator; diff --git a/src/test/ui/type-alias-impl-trait/issue-74244.rs b/src/test/ui/type-alias-impl-trait/issue-74244.rs index d9845a9b62c..bb4104b3d25 100644 --- a/src/test/ui/type-alias-impl-trait/issue-74244.rs +++ b/src/test/ui/type-alias-impl-trait/issue-74244.rs @@ -1,6 +1,4 @@ -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] trait Allocator { type Buffer; diff --git a/src/test/ui/type-alias-impl-trait/issue-74244.stderr b/src/test/ui/type-alias-impl-trait/issue-74244.stderr new file mode 100644 index 00000000000..ff6bacd277e --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/issue-74244.stderr @@ -0,0 +1,9 @@ +error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or predicates + --> $DIR/issue-74244.rs:9:6 + | +LL | impl Allocator for DefaultAllocator { + | ^ unconstrained type parameter + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0207`. diff --git a/src/test/ui/type-alias-impl-trait/issue-74761-2.rs b/src/test/ui/type-alias-impl-trait/issue-74761-2.rs index 8e7ff45a72d..4345b5d886e 100644 --- a/src/test/ui/type-alias-impl-trait/issue-74761-2.rs +++ b/src/test/ui/type-alias-impl-trait/issue-74761-2.rs @@ -9,8 +9,6 @@ impl<'a, 'b> A for () { //~^ ERROR the lifetime parameter `'a` is not constrained //~| ERROR the lifetime parameter `'b` is not constrained type B = impl core::fmt::Debug; - //~^ ERROR is unstable - fn f(&self) -> Self::B {} } diff --git a/src/test/ui/type-alias-impl-trait/issue-74761-2.stderr b/src/test/ui/type-alias-impl-trait/issue-74761-2.stderr index 505e6436f5b..7a321458b0b 100644 --- a/src/test/ui/type-alias-impl-trait/issue-74761-2.stderr +++ b/src/test/ui/type-alias-impl-trait/issue-74761-2.stderr @@ -1,12 +1,3 @@ -error[E0658]: `impl Trait` in type aliases is unstable - --> $DIR/issue-74761-2.rs:11:14 - | -LL | type B = impl core::fmt::Debug; - | ^^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #63063 for more information - = help: add `#![feature(min_type_alias_impl_trait)]` to the crate attributes to enable - error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates --> $DIR/issue-74761-2.rs:8:6 | @@ -19,7 +10,6 @@ error[E0207]: the lifetime parameter `'b` is not constrained by the impl trait, LL | impl<'a, 'b> A for () { | ^^ unconstrained lifetime parameter -error: aborting due to 3 previous errors +error: aborting due to 2 previous errors -Some errors have detailed explanations: E0207, E0658. -For more information about an error, try `rustc --explain E0207`. +For more information about this error, try `rustc --explain E0207`. diff --git a/src/test/ui/type-alias-impl-trait/issue-74761.rs b/src/test/ui/type-alias-impl-trait/issue-74761.rs index 4f0db7aedc7..d26ca5c3ead 100644 --- a/src/test/ui/type-alias-impl-trait/issue-74761.rs +++ b/src/test/ui/type-alias-impl-trait/issue-74761.rs @@ -1,6 +1,4 @@ -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] pub trait A { type B; diff --git a/src/test/ui/type-alias-impl-trait/issue-74761.stderr b/src/test/ui/type-alias-impl-trait/issue-74761.stderr new file mode 100644 index 00000000000..1d016fe070f --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/issue-74761.stderr @@ -0,0 +1,15 @@ +error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates + --> $DIR/issue-74761.rs:7:6 + | +LL | impl<'a, 'b> A for () { + | ^^ unconstrained lifetime parameter + +error[E0207]: the lifetime parameter `'b` is not constrained by the impl trait, self type, or predicates + --> $DIR/issue-74761.rs:7:10 + | +LL | impl<'a, 'b> A for () { + | ^^ unconstrained lifetime parameter + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0207`. diff --git a/src/test/ui/type-alias-impl-trait/issue-76202-trait-impl-for-tait.rs b/src/test/ui/type-alias-impl-trait/issue-76202-trait-impl-for-tait.rs index 527fbd4bb2f..fb56cc54d63 100644 --- a/src/test/ui/type-alias-impl-trait/issue-76202-trait-impl-for-tait.rs +++ b/src/test/ui/type-alias-impl-trait/issue-76202-trait-impl-for-tait.rs @@ -1,9 +1,7 @@ // Regression test for issue #76202 // Tests that we don't ICE when we have a trait impl on a TAIT. -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] trait Dummy {} impl Dummy for () {} diff --git a/src/test/ui/type-alias-impl-trait/issue-76202-trait-impl-for-tait.stderr b/src/test/ui/type-alias-impl-trait/issue-76202-trait-impl-for-tait.stderr new file mode 100644 index 00000000000..8689ee53660 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/issue-76202-trait-impl-for-tait.stderr @@ -0,0 +1,14 @@ +error: cannot implement trait on type alias impl trait + --> $DIR/issue-76202-trait-impl-for-tait.rs:16:1 + | +LL | impl Test for F { + | ^^^^^^^^^^^^^^^ + | +note: type alias impl trait defined here + --> $DIR/issue-76202-trait-impl-for-tait.rs:9:10 + | +LL | type F = impl Dummy; + | ^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/type-alias-impl-trait/issue-78450.rs b/src/test/ui/type-alias-impl-trait/issue-78450.rs index bcc16a5b2ab..fccbfb74fa2 100644 --- a/src/test/ui/type-alias-impl-trait/issue-78450.rs +++ b/src/test/ui/type-alias-impl-trait/issue-78450.rs @@ -1,6 +1,5 @@ // check-pass -#![feature(min_type_alias_impl_trait)] #![feature(type_alias_impl_trait)] pub trait AssociatedImpl { diff --git a/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn-pass.rs b/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn-pass.rs index ecad910f7d5..f412b2d0e7d 100644 --- a/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn-pass.rs +++ b/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn-pass.rs @@ -1,5 +1,5 @@ // check-pass -#![feature(min_type_alias_impl_trait)] +#![feature(type_alias_impl_trait)] type X = impl ToString; diff --git a/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn.rs b/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn.rs index 67351e20159..371dff475d1 100644 --- a/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn.rs +++ b/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn.rs @@ -2,7 +2,7 @@ // This test used to cause unsoundness, since one of the two possible // resolutions was chosen at random instead of erroring due to conflicts. -#![feature(min_type_alias_impl_trait)] +#![feature(type_alias_impl_trait)] type X = impl Into<&'static A>; //~^ ERROR the trait bound `&'static B: From<&A>` is not satisfied diff --git a/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn2.rs b/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn2.rs index 11756017ad8..06e1990fd7f 100644 --- a/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn2.rs +++ b/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn2.rs @@ -2,7 +2,7 @@ // This test used to cause unsoundness, since one of the two possible // resolutions was chosen at random instead of erroring due to conflicts. -#![feature(min_type_alias_impl_trait)] +#![feature(type_alias_impl_trait)] type X = impl ToString; diff --git a/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn3.rs b/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn3.rs index 5f25365666c..bcd9aeff6b4 100644 --- a/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn3.rs +++ b/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn3.rs @@ -2,7 +2,7 @@ // This test used to cause unsoundness, since one of the two possible // resolutions was chosen at random instead of erroring due to conflicts. -#![feature(min_type_alias_impl_trait)] +#![feature(type_alias_impl_trait)] type X = impl ToString; diff --git a/src/test/ui/type-alias-impl-trait/nested_type_alias_impl_trait.rs b/src/test/ui/type-alias-impl-trait/nested_type_alias_impl_trait.rs index 3c059fcf7d4..6282264d8fe 100644 --- a/src/test/ui/type-alias-impl-trait/nested_type_alias_impl_trait.rs +++ b/src/test/ui/type-alias-impl-trait/nested_type_alias_impl_trait.rs @@ -1,6 +1,4 @@ -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] // build-pass (FIXME(62277): could be check-pass?) mod my_mod { use std::fmt::Debug; diff --git a/src/test/ui/type-alias-impl-trait/never_reveal_concrete_type.rs b/src/test/ui/type-alias-impl-trait/never_reveal_concrete_type.rs index 1672c49c604..8787c023eb0 100644 --- a/src/test/ui/type-alias-impl-trait/never_reveal_concrete_type.rs +++ b/src/test/ui/type-alias-impl-trait/never_reveal_concrete_type.rs @@ -1,6 +1,4 @@ -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] fn main() {} diff --git a/src/test/ui/type-alias-impl-trait/never_reveal_concrete_type.stderr b/src/test/ui/type-alias-impl-trait/never_reveal_concrete_type.stderr new file mode 100644 index 00000000000..b438f844516 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/never_reveal_concrete_type.stderr @@ -0,0 +1,24 @@ +error[E0308]: mismatched types + --> $DIR/never_reveal_concrete_type.rs:13:27 + | +LL | type NoReveal = impl std::fmt::Debug; + | -------------------- the found opaque type +... +LL | let _: &'static str = x; + | ------------ ^ expected `&str`, found opaque type + | | + | expected due to this + | + = note: expected reference `&'static str` + found opaque type `impl Debug` + +error[E0605]: non-primitive cast: `impl Debug` as `&'static str` + --> $DIR/never_reveal_concrete_type.rs:14:13 + | +LL | let _ = x as &'static str; + | ^^^^^^^^^^^^^^^^^ an `as` expression can only be used to convert between primitive types or to coerce to a specific trait object + +error: aborting due to 2 previous errors + +Some errors have detailed explanations: E0308, E0605. +For more information about an error, try `rustc --explain E0308`. diff --git a/src/test/ui/type-alias-impl-trait/no_inferrable_concrete_type.rs b/src/test/ui/type-alias-impl-trait/no_inferrable_concrete_type.rs index 520954b50ab..1197c7bc58e 100644 --- a/src/test/ui/type-alias-impl-trait/no_inferrable_concrete_type.rs +++ b/src/test/ui/type-alias-impl-trait/no_inferrable_concrete_type.rs @@ -1,9 +1,7 @@ // Issue 52985: user code provides no use case that allows a type alias `impl Trait` // We now emit a 'could not find defining uses' error -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] type Foo = impl Copy; //~ could not find defining uses diff --git a/src/test/ui/type-alias-impl-trait/no_inferrable_concrete_type.stderr b/src/test/ui/type-alias-impl-trait/no_inferrable_concrete_type.stderr new file mode 100644 index 00000000000..61025e84692 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/no_inferrable_concrete_type.stderr @@ -0,0 +1,8 @@ +error: could not find defining uses + --> $DIR/no_inferrable_concrete_type.rs:6:12 + | +LL | type Foo = impl Copy; + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/type-alias-impl-trait/no_revealing_outside_defining_module.rs b/src/test/ui/type-alias-impl-trait/no_revealing_outside_defining_module.rs index 5ab793c0119..61153b1e171 100644 --- a/src/test/ui/type-alias-impl-trait/no_revealing_outside_defining_module.rs +++ b/src/test/ui/type-alias-impl-trait/no_revealing_outside_defining_module.rs @@ -1,6 +1,4 @@ -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] fn main() {} diff --git a/src/test/ui/type-alias-impl-trait/no_revealing_outside_defining_module.stderr b/src/test/ui/type-alias-impl-trait/no_revealing_outside_defining_module.stderr new file mode 100644 index 00000000000..67752acb8c9 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/no_revealing_outside_defining_module.stderr @@ -0,0 +1,31 @@ +error[E0308]: mismatched types + --> $DIR/no_revealing_outside_defining_module.rs:15:19 + | +LL | pub type Boo = impl ::std::fmt::Debug; + | ---------------------- the found opaque type +... +LL | let _: &str = bomp(); + | ---- ^^^^^^ expected `&str`, found opaque type + | | + | expected due to this + | + = note: expected reference `&str` + found opaque type `impl Debug` + +error[E0308]: mismatched types + --> $DIR/no_revealing_outside_defining_module.rs:19:5 + | +LL | pub type Boo = impl ::std::fmt::Debug; + | ---------------------- the expected opaque type +... +LL | fn bomp() -> boo::Boo { + | -------- expected `impl Debug` because of return type +LL | "" + | ^^ expected opaque type, found `&str` + | + = note: expected opaque type `impl Debug` + found reference `&'static str` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/type-alias-impl-trait/not_a_defining_use.rs b/src/test/ui/type-alias-impl-trait/not_a_defining_use.rs index 57ccb58acc9..f29b980dfd0 100644 --- a/src/test/ui/type-alias-impl-trait/not_a_defining_use.rs +++ b/src/test/ui/type-alias-impl-trait/not_a_defining_use.rs @@ -1,6 +1,4 @@ -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] use std::fmt::Debug; diff --git a/src/test/ui/type-alias-impl-trait/not_a_defining_use.stderr b/src/test/ui/type-alias-impl-trait/not_a_defining_use.stderr new file mode 100644 index 00000000000..2fa236b373a --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/not_a_defining_use.stderr @@ -0,0 +1,14 @@ +error: non-defining opaque type use in defining scope + --> $DIR/not_a_defining_use.rs:9:27 + | +LL | fn two(t: T) -> Two { + | ^^^^^^^^^^^ + | +note: used non-generic type `u32` for generic parameter + --> $DIR/not_a_defining_use.rs:7:13 + | +LL | type Two = impl Debug; + | ^ + +error: aborting due to previous error + diff --git a/src/test/ui/type-alias-impl-trait/not_well_formed.rs b/src/test/ui/type-alias-impl-trait/not_well_formed.rs index c3e9895524e..fbb7a4d58e4 100644 --- a/src/test/ui/type-alias-impl-trait/not_well_formed.rs +++ b/src/test/ui/type-alias-impl-trait/not_well_formed.rs @@ -1,6 +1,4 @@ -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] fn main() {} diff --git a/src/test/ui/type-alias-impl-trait/not_well_formed.stderr b/src/test/ui/type-alias-impl-trait/not_well_formed.stderr new file mode 100644 index 00000000000..91c1d031e4e --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/not_well_formed.stderr @@ -0,0 +1,9 @@ +error[E0220]: associated type `Assoc` not found for `V` + --> $DIR/not_well_formed.rs:9:29 + | +LL | type Foo = impl Trait; + | ^^^^^ associated type `Assoc` not found + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0220`. diff --git a/src/test/ui/type-alias-impl-trait/structural-match-no-leak.rs b/src/test/ui/type-alias-impl-trait/structural-match-no-leak.rs index 7a067c6f2d7..51a7b6454c3 100644 --- a/src/test/ui/type-alias-impl-trait/structural-match-no-leak.rs +++ b/src/test/ui/type-alias-impl-trait/structural-match-no-leak.rs @@ -1,7 +1,5 @@ #![feature(const_impl_trait)] -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] type Bar = impl Send; diff --git a/src/test/ui/type-alias-impl-trait/structural-match-no-leak.stderr b/src/test/ui/type-alias-impl-trait/structural-match-no-leak.stderr new file mode 100644 index 00000000000..7e41b374452 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/structural-match-no-leak.stderr @@ -0,0 +1,8 @@ +error: `impl Send` cannot be used in patterns + --> $DIR/structural-match-no-leak.rs:15:9 + | +LL | LEAK_FREE => (), + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/type-alias-impl-trait/structural-match.rs b/src/test/ui/type-alias-impl-trait/structural-match.rs index c30cd5f5958..73558d39ad5 100644 --- a/src/test/ui/type-alias-impl-trait/structural-match.rs +++ b/src/test/ui/type-alias-impl-trait/structural-match.rs @@ -1,7 +1,5 @@ #![feature(const_impl_trait)] -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] type Foo = impl Send; diff --git a/src/test/ui/type-alias-impl-trait/structural-match.stderr b/src/test/ui/type-alias-impl-trait/structural-match.stderr new file mode 100644 index 00000000000..b43f2148dea --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/structural-match.stderr @@ -0,0 +1,8 @@ +error: `impl Send` cannot be used in patterns + --> $DIR/structural-match.rs:16:9 + | +LL | VALUE => (), + | ^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-const.rs b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-const.rs index 4432807916e..1a8113848f9 100644 --- a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-const.rs +++ b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-const.rs @@ -1,6 +1,4 @@ -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] // Ensures that `const` items can constrain an opaque `impl Trait`. diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-const.stderr b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-const.stderr new file mode 100644 index 00000000000..e2567e87ac6 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-const.stderr @@ -0,0 +1,21 @@ +error[E0308]: mismatched types + --> $DIR/type-alias-impl-trait-const.rs:10:19 + | +LL | pub type Foo = impl Debug; + | ---------- the expected opaque type +... +LL | const _FOO: Foo = 5; + | ^ expected opaque type, found integer + | + = note: expected opaque type `impl Debug` + found type `{integer}` + +error: could not find defining uses + --> $DIR/type-alias-impl-trait-const.rs:7:16 + | +LL | pub type Foo = impl Debug; + | ^^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-fns.rs b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-fns.rs index e3debedbde3..07c891f0638 100644 --- a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-fns.rs +++ b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-fns.rs @@ -1,8 +1,6 @@ // check-pass -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] // Regression test for issue #61863 diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-sized.rs b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-sized.rs index b0f6a5a2db3..c5e8068e5c8 100644 --- a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-sized.rs +++ b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-sized.rs @@ -1,8 +1,6 @@ // check-pass -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] type A = impl Sized; fn f1() -> A { diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-tuple.rs b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-tuple.rs index 5f228ec03f7..86c9d482143 100644 --- a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-tuple.rs +++ b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-tuple.rs @@ -1,8 +1,6 @@ // check-pass -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] #![allow(dead_code)] pub trait MyTrait {} diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-unconstrained-lifetime.rs b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-unconstrained-lifetime.rs index 63bbbaa707c..efbf4f1e351 100644 --- a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-unconstrained-lifetime.rs +++ b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-unconstrained-lifetime.rs @@ -1,8 +1,6 @@ // regression test for #74018 -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] trait Trait { type Associated; diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-unconstrained-lifetime.stderr b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-unconstrained-lifetime.stderr new file mode 100644 index 00000000000..8cdce2f8e81 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-unconstrained-lifetime.stderr @@ -0,0 +1,9 @@ +error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates + --> $DIR/type-alias-impl-trait-unconstrained-lifetime.rs:10:6 + | +LL | impl<'a, I: Iterator> Trait for (i32, I) { + | ^^ unconstrained lifetime parameter + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0207`. diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-cycle-error.rs b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-cycle-error.rs index 2b3694d5010..c009952eab7 100644 --- a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-cycle-error.rs +++ b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-cycle-error.rs @@ -1,6 +1,4 @@ -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] type Foo = impl Fn() -> Foo; //~^ ERROR: could not find defining uses diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-cycle-error.stderr b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-cycle-error.stderr new file mode 100644 index 00000000000..726f4ea6e00 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-cycle-error.stderr @@ -0,0 +1,8 @@ +error: could not find defining uses + --> $DIR/type-alias-impl-trait-with-cycle-error.rs:3:12 + | +LL | type Foo = impl Fn() -> Foo; + | ^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-cycle-error2.rs b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-cycle-error2.rs index 2d7e2139707..f3898bca64b 100644 --- a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-cycle-error2.rs +++ b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-cycle-error2.rs @@ -1,6 +1,4 @@ -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] pub trait Bar { type Item; diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-cycle-error2.stderr b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-cycle-error2.stderr new file mode 100644 index 00000000000..3947cc4d270 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-cycle-error2.stderr @@ -0,0 +1,8 @@ +error: could not find defining uses + --> $DIR/type-alias-impl-trait-with-cycle-error2.rs:7:12 + | +LL | type Foo = impl Bar; + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-no-traits.rs b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-no-traits.rs index 469f3875a8d..8ca279eec92 100644 --- a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-no-traits.rs +++ b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-no-traits.rs @@ -1,6 +1,4 @@ -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] type Foo = impl 'static; //~^ ERROR: at least one trait must be specified diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-no-traits.stderr b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-no-traits.stderr new file mode 100644 index 00000000000..3f7acd33830 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-with-no-traits.stderr @@ -0,0 +1,14 @@ +error: at least one trait must be specified + --> $DIR/type-alias-impl-trait-with-no-traits.rs:3:12 + | +LL | type Foo = impl 'static; + | ^^^^^^^^^^^^ + +error: at least one trait must be specified + --> $DIR/type-alias-impl-trait-with-no-traits.rs:10:13 + | +LL | fn bar() -> impl 'static { + | ^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait.rs b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait.rs index 934acb0d9af..80192d19af9 100644 --- a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait.rs +++ b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait.rs @@ -3,9 +3,7 @@ #![allow(dead_code)] #![allow(unused_assignments)] #![allow(unused_variables)] -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] fn main() { assert_eq!(foo().to_string(), "foo"); diff --git a/src/test/ui/type-alias-impl-trait/type-alias-nested-impl-trait.rs b/src/test/ui/type-alias-impl-trait/type-alias-nested-impl-trait.rs index 8bdac325cd7..fd954801dc0 100644 --- a/src/test/ui/type-alias-impl-trait/type-alias-nested-impl-trait.rs +++ b/src/test/ui/type-alias-impl-trait/type-alias-nested-impl-trait.rs @@ -1,8 +1,6 @@ // run-pass -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] use std::iter::{once, Chain}; diff --git a/src/test/ui/type-alias-impl-trait/unused_generic_param.rs b/src/test/ui/type-alias-impl-trait/unused_generic_param.rs index 8c946238362..04a5c58cd36 100644 --- a/src/test/ui/type-alias-impl-trait/unused_generic_param.rs +++ b/src/test/ui/type-alias-impl-trait/unused_generic_param.rs @@ -1,6 +1,4 @@ -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] fn main() {} diff --git a/src/test/ui/type-alias-impl-trait/unused_generic_param.stderr b/src/test/ui/type-alias-impl-trait/unused_generic_param.stderr new file mode 100644 index 00000000000..4e11854b071 --- /dev/null +++ b/src/test/ui/type-alias-impl-trait/unused_generic_param.stderr @@ -0,0 +1,14 @@ +error: at least one trait must be specified + --> $DIR/unused_generic_param.rs:5:28 + | +LL | type PartiallyDefined = impl 'static; + | ^^^^^^^^^^^^ + +error: at least one trait must be specified + --> $DIR/unused_generic_param.rs:12:29 + | +LL | type PartiallyDefined2 = impl 'static; + | ^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + diff --git a/src/test/ui/typeck/typeck_type_placeholder_item.rs b/src/test/ui/typeck/typeck_type_placeholder_item.rs index 3d30ab32bac..a3b75543510 100644 --- a/src/test/ui/typeck/typeck_type_placeholder_item.rs +++ b/src/test/ui/typeck/typeck_type_placeholder_item.rs @@ -1,8 +1,6 @@ // Needed for `type Y = impl Trait<_>` and `type B = _;` #![feature(associated_type_defaults)] -// revisions: min_tait full_tait -#![feature(min_type_alias_impl_trait)] -#![cfg_attr(full_tait, feature(type_alias_impl_trait))] +#![feature(type_alias_impl_trait)] // This test checks that it is not possible to enable global type // inference by using the `_` type placeholder. diff --git a/src/test/ui/typeck/typeck_type_placeholder_item.stderr b/src/test/ui/typeck/typeck_type_placeholder_item.stderr new file mode 100644 index 00000000000..4827439bfbf --- /dev/null +++ b/src/test/ui/typeck/typeck_type_placeholder_item.stderr @@ -0,0 +1,638 @@ +error: expected identifier, found reserved identifier `_` + --> $DIR/typeck_type_placeholder_item.rs:154:18 + | +LL | struct BadStruct<_>(_); + | ^ expected identifier, found reserved identifier + +error: expected identifier, found reserved identifier `_` + --> $DIR/typeck_type_placeholder_item.rs:157:16 + | +LL | trait BadTrait<_> {} + | ^ expected identifier, found reserved identifier + +error: expected identifier, found reserved identifier `_` + --> $DIR/typeck_type_placeholder_item.rs:167:19 + | +LL | struct BadStruct1<_, _>(_); + | ^ expected identifier, found reserved identifier + +error: expected identifier, found reserved identifier `_` + --> $DIR/typeck_type_placeholder_item.rs:167:22 + | +LL | struct BadStruct1<_, _>(_); + | ^ expected identifier, found reserved identifier + +error: expected identifier, found reserved identifier `_` + --> $DIR/typeck_type_placeholder_item.rs:172:19 + | +LL | struct BadStruct2<_, T>(_, T); + | ^ expected identifier, found reserved identifier + +error: associated constant in `impl` without body + --> $DIR/typeck_type_placeholder_item.rs:205:5 + | +LL | const C: _; + | ^^^^^^^^^^- + | | + | help: provide a definition for the constant: `= ;` + +error[E0403]: the name `_` is already used for a generic parameter in this item's generic parameters + --> $DIR/typeck_type_placeholder_item.rs:167:22 + | +LL | struct BadStruct1<_, _>(_); + | - ^ already used + | | + | first use of `_` + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types + --> $DIR/typeck_type_placeholder_item.rs:7:14 + | +LL | fn test() -> _ { 5 } + | ^ + | | + | not allowed in type signatures + | help: replace with the correct return type: `i32` + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types + --> $DIR/typeck_type_placeholder_item.rs:10:16 + | +LL | fn test2() -> (_, _) { (5, 5) } + | -^--^- + | || | + | || not allowed in type signatures + | |not allowed in type signatures + | help: replace with the correct return type: `(i32, i32)` + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static variables + --> $DIR/typeck_type_placeholder_item.rs:13:15 + | +LL | static TEST3: _ = "test"; + | ^ + | | + | not allowed in type signatures + | help: replace with the correct type: `&str` + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static variables + --> $DIR/typeck_type_placeholder_item.rs:16:15 + | +LL | static TEST4: _ = 145; + | ^ + | | + | not allowed in type signatures + | help: replace with the correct type: `i32` + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static variables + --> $DIR/typeck_type_placeholder_item.rs:19:15 + | +LL | static TEST5: (_, _) = (1, 2); + | ^^^^^^ not allowed in type signatures + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions + --> $DIR/typeck_type_placeholder_item.rs:22:13 + | +LL | fn test6(_: _) { } + | ^ not allowed in type signatures + | +help: use type parameters instead + | +LL | fn test6(_: T) { } + | ^^^ ^ + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions + --> $DIR/typeck_type_placeholder_item.rs:25:18 + | +LL | fn test6_b(_: _, _: T) { } + | ^ not allowed in type signatures + | +help: use type parameters instead + | +LL | fn test6_b(_: U, _: T) { } + | ^^^ ^ + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions + --> $DIR/typeck_type_placeholder_item.rs:28:30 + | +LL | fn test6_c(_: _, _: (T, K, L, A, B)) { } + | ^ not allowed in type signatures + | +help: use type parameters instead + | +LL | fn test6_c(_: U, _: (T, K, L, A, B)) { } + | ^^^ ^ + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions + --> $DIR/typeck_type_placeholder_item.rs:31:13 + | +LL | fn test7(x: _) { let _x: usize = x; } + | ^ not allowed in type signatures + | +help: use type parameters instead + | +LL | fn test7(x: T) { let _x: usize = x; } + | ^^^ ^ + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions + --> $DIR/typeck_type_placeholder_item.rs:34:22 + | +LL | fn test8(_f: fn() -> _) { } + | ^ + | | + | not allowed in type signatures + | help: use type parameters instead: `T` + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions + --> $DIR/typeck_type_placeholder_item.rs:34:22 + | +LL | fn test8(_f: fn() -> _) { } + | ^ not allowed in type signatures + | +help: use type parameters instead + | +LL | fn test8(_f: fn() -> T) { } + | ^^^ ^ + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types + --> $DIR/typeck_type_placeholder_item.rs:48:26 + | +LL | fn test11(x: &usize) -> &_ { + | -^ + | || + | |not allowed in type signatures + | help: replace with the correct return type: `&'static &'static usize` + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types + --> $DIR/typeck_type_placeholder_item.rs:53:52 + | +LL | unsafe fn test12(x: *const usize) -> *const *const _ { + | --------------^ + | | | + | | not allowed in type signatures + | help: replace with the correct return type: `*const *const usize` + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for structs + --> $DIR/typeck_type_placeholder_item.rs:67:8 + | +LL | a: _, + | ^ not allowed in type signatures +LL | +LL | b: (_, _), + | ^ ^ not allowed in type signatures + | | + | not allowed in type signatures + | +help: use type parameters instead + | +LL | struct Test10 { +LL | a: T, +LL | +LL | b: (T, T), + | + +error: missing type for `static` item + --> $DIR/typeck_type_placeholder_item.rs:73:12 + | +LL | static A = 42; + | ^ help: provide a type for the static variable: `A: i32` + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static variables + --> $DIR/typeck_type_placeholder_item.rs:75:15 + | +LL | static B: _ = 42; + | ^ + | | + | not allowed in type signatures + | help: replace with the correct type: `i32` + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static variables + --> $DIR/typeck_type_placeholder_item.rs:77:15 + | +LL | static C: Option<_> = Some(42); + | ^^^^^^^^^ not allowed in type signatures + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types + --> $DIR/typeck_type_placeholder_item.rs:79:21 + | +LL | fn fn_test() -> _ { 5 } + | ^ + | | + | not allowed in type signatures + | help: replace with the correct return type: `i32` + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types + --> $DIR/typeck_type_placeholder_item.rs:82:23 + | +LL | fn fn_test2() -> (_, _) { (5, 5) } + | -^--^- + | || | + | || not allowed in type signatures + | |not allowed in type signatures + | help: replace with the correct return type: `(i32, i32)` + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static variables + --> $DIR/typeck_type_placeholder_item.rs:85:22 + | +LL | static FN_TEST3: _ = "test"; + | ^ + | | + | not allowed in type signatures + | help: replace with the correct type: `&str` + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static variables + --> $DIR/typeck_type_placeholder_item.rs:88:22 + | +LL | static FN_TEST4: _ = 145; + | ^ + | | + | not allowed in type signatures + | help: replace with the correct type: `i32` + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static variables + --> $DIR/typeck_type_placeholder_item.rs:91:22 + | +LL | static FN_TEST5: (_, _) = (1, 2); + | ^^^^^^ not allowed in type signatures + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions + --> $DIR/typeck_type_placeholder_item.rs:94:20 + | +LL | fn fn_test6(_: _) { } + | ^ not allowed in type signatures + | +help: use type parameters instead + | +LL | fn fn_test6(_: T) { } + | ^^^ ^ + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions + --> $DIR/typeck_type_placeholder_item.rs:97:20 + | +LL | fn fn_test7(x: _) { let _x: usize = x; } + | ^ not allowed in type signatures + | +help: use type parameters instead + | +LL | fn fn_test7(x: T) { let _x: usize = x; } + | ^^^ ^ + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions + --> $DIR/typeck_type_placeholder_item.rs:100:29 + | +LL | fn fn_test8(_f: fn() -> _) { } + | ^ + | | + | not allowed in type signatures + | help: use type parameters instead: `T` + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions + --> $DIR/typeck_type_placeholder_item.rs:100:29 + | +LL | fn fn_test8(_f: fn() -> _) { } + | ^ not allowed in type signatures + | +help: use type parameters instead + | +LL | fn fn_test8(_f: fn() -> T) { } + | ^^^ ^ + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for structs + --> $DIR/typeck_type_placeholder_item.rs:123:12 + | +LL | a: _, + | ^ not allowed in type signatures +LL | +LL | b: (_, _), + | ^ ^ not allowed in type signatures + | | + | not allowed in type signatures + | +help: use type parameters instead + | +LL | struct FnTest10 { +LL | a: T, +LL | +LL | b: (T, T), + | + +error[E0282]: type annotations needed + --> $DIR/typeck_type_placeholder_item.rs:128:18 + | +LL | fn fn_test11(_: _) -> (_, _) { panic!() } + | ^ cannot infer type + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types + --> $DIR/typeck_type_placeholder_item.rs:128:28 + | +LL | fn fn_test11(_: _) -> (_, _) { panic!() } + | ^ ^ not allowed in type signatures + | | + | not allowed in type signatures + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types + --> $DIR/typeck_type_placeholder_item.rs:132:30 + | +LL | fn fn_test12(x: i32) -> (_, _) { (x, x) } + | -^--^- + | || | + | || not allowed in type signatures + | |not allowed in type signatures + | help: replace with the correct return type: `(i32, i32)` + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types + --> $DIR/typeck_type_placeholder_item.rs:135:33 + | +LL | fn fn_test13(x: _) -> (i32, _) { (x, x) } + | ------^- + | | | + | | not allowed in type signatures + | help: replace with the correct return type: `(i32, i32)` + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for structs + --> $DIR/typeck_type_placeholder_item.rs:154:21 + | +LL | struct BadStruct<_>(_); + | ^ not allowed in type signatures + | +help: use type parameters instead + | +LL | struct BadStruct(T); + | ^ ^ + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for implementations + --> $DIR/typeck_type_placeholder_item.rs:159:15 + | +LL | impl BadTrait<_> for BadStruct<_> {} + | ^ ^ not allowed in type signatures + | | + | not allowed in type signatures + | +help: use type parameters instead + | +LL | impl BadTrait for BadStruct {} + | ^^^ ^ ^ + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for opaque types + --> $DIR/typeck_type_placeholder_item.rs:162:34 + | +LL | fn impl_trait() -> impl BadTrait<_> { + | ^ not allowed in type signatures + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for structs + --> $DIR/typeck_type_placeholder_item.rs:167:25 + | +LL | struct BadStruct1<_, _>(_); + | ^ not allowed in type signatures + | +help: use type parameters instead + | +LL | struct BadStruct1(T); + | ^ ^ + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for structs + --> $DIR/typeck_type_placeholder_item.rs:172:25 + | +LL | struct BadStruct2<_, T>(_, T); + | ^ not allowed in type signatures + | +help: use type parameters instead + | +LL | struct BadStruct2(U, T); + | ^ ^ + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for type aliases + --> $DIR/typeck_type_placeholder_item.rs:176:14 + | +LL | type X = Box<_>; + | ^ not allowed in type signatures + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for opaque types + --> $DIR/typeck_type_placeholder_item.rs:182:21 + | +LL | type Y = impl Trait<_>; + | ^ not allowed in type signatures + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types + --> $DIR/typeck_type_placeholder_item.rs:216:31 + | +LL | fn value() -> Option<&'static _> { + | ----------------^- + | | | + | | not allowed in type signatures + | help: replace with the correct return type: `Option<&'static u8>` + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for constants + --> $DIR/typeck_type_placeholder_item.rs:221:10 + | +LL | const _: Option<_> = map(value); + | ^^^^^^^^^ + | | + | not allowed in type signatures + | help: replace with the correct type: `Option` + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions + --> $DIR/typeck_type_placeholder_item.rs:140:31 + | +LL | fn method_test1(&self, x: _); + | ^ not allowed in type signatures + | +help: use type parameters instead + | +LL | fn method_test1(&self, x: T); + | ^^^ ^ + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions + --> $DIR/typeck_type_placeholder_item.rs:142:31 + | +LL | fn method_test2(&self, x: _) -> _; + | ^ ^ not allowed in type signatures + | | + | not allowed in type signatures + | +help: use type parameters instead + | +LL | fn method_test2(&self, x: T) -> T; + | ^^^ ^ ^ + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions + --> $DIR/typeck_type_placeholder_item.rs:144:31 + | +LL | fn method_test3(&self) -> _; + | ^ not allowed in type signatures + | +help: use type parameters instead + | +LL | fn method_test3(&self) -> T; + | ^^^ ^ + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions + --> $DIR/typeck_type_placeholder_item.rs:146:26 + | +LL | fn assoc_fn_test1(x: _); + | ^ not allowed in type signatures + | +help: use type parameters instead + | +LL | fn assoc_fn_test1(x: T); + | ^^^ ^ + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions + --> $DIR/typeck_type_placeholder_item.rs:148:26 + | +LL | fn assoc_fn_test2(x: _) -> _; + | ^ ^ not allowed in type signatures + | | + | not allowed in type signatures + | +help: use type parameters instead + | +LL | fn assoc_fn_test2(x: T) -> T; + | ^^^ ^ ^ + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions + --> $DIR/typeck_type_placeholder_item.rs:150:28 + | +LL | fn assoc_fn_test3() -> _; + | ^ not allowed in type signatures + | +help: use type parameters instead + | +LL | fn assoc_fn_test3() -> T; + | ^^^ ^ + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for associated types + --> $DIR/typeck_type_placeholder_item.rs:190:14 + | +LL | type B = _; + | ^ not allowed in type signatures + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for constants + --> $DIR/typeck_type_placeholder_item.rs:192:14 + | +LL | const C: _; + | ^ not allowed in type signatures + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for constants + --> $DIR/typeck_type_placeholder_item.rs:194:14 + | +LL | const D: _ = 42; + | ^ + | | + | not allowed in type signatures + | help: replace with the correct type: `i32` + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for associated types + --> $DIR/typeck_type_placeholder_item.rs:197:26 + | +LL | type F: std::ops::Fn(_); + | ^ not allowed in type signatures + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types + --> $DIR/typeck_type_placeholder_item.rs:41:24 + | +LL | fn test9(&self) -> _ { () } + | ^ + | | + | not allowed in type signatures + | help: replace with the correct return type: `()` + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions + --> $DIR/typeck_type_placeholder_item.rs:44:27 + | +LL | fn test10(&self, _x : _) { } + | ^ not allowed in type signatures + | +help: use type parameters instead + | +LL | fn test10(&self, _x : T) { } + | ^^^ ^ + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types + --> $DIR/typeck_type_placeholder_item.rs:59:24 + | +LL | fn clone(&self) -> _ { Test9 } + | ^ + | | + | not allowed in type signatures + | help: replace with the correct return type: `Test9` + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions + --> $DIR/typeck_type_placeholder_item.rs:62:37 + | +LL | fn clone_from(&mut self, other: _) { *self = Test9; } + | ^ not allowed in type signatures + | +help: use type parameters instead + | +LL | fn clone_from(&mut self, other: T) { *self = Test9; } + | ^^^ ^ + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types + --> $DIR/typeck_type_placeholder_item.rs:107:31 + | +LL | fn fn_test9(&self) -> _ { () } + | ^ + | | + | not allowed in type signatures + | help: replace with the correct return type: `()` + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions + --> $DIR/typeck_type_placeholder_item.rs:110:34 + | +LL | fn fn_test10(&self, _x : _) { } + | ^ not allowed in type signatures + | +help: use type parameters instead + | +LL | fn fn_test10(&self, _x : T) { } + | ^^^ ^ + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types + --> $DIR/typeck_type_placeholder_item.rs:115:28 + | +LL | fn clone(&self) -> _ { FnTest9 } + | ^ + | | + | not allowed in type signatures + | help: replace with the correct return type: `FnTest9` + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions + --> $DIR/typeck_type_placeholder_item.rs:118:41 + | +LL | fn clone_from(&mut self, other: _) { *self = FnTest9; } + | ^ not allowed in type signatures + | +help: use type parameters instead + | +LL | fn clone_from(&mut self, other: T) { *self = FnTest9; } + | ^^^ ^ + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for associated types + --> $DIR/typeck_type_placeholder_item.rs:201:14 + | +LL | type A = _; + | ^ not allowed in type signatures + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for associated types + --> $DIR/typeck_type_placeholder_item.rs:203:14 + | +LL | type B = _; + | ^ not allowed in type signatures + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for constants + --> $DIR/typeck_type_placeholder_item.rs:205:14 + | +LL | const C: _; + | ^ not allowed in type signatures + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures for constants + --> $DIR/typeck_type_placeholder_item.rs:208:14 + | +LL | const D: _ = 42; + | ^ + | | + | not allowed in type signatures + | help: replace with the correct type: `i32` + +error: aborting due to 69 previous errors + +Some errors have detailed explanations: E0121, E0282, E0403. +For more information about an error, try `rustc --explain E0121`.