summaryrefslogtreecommitdiffstats
path: root/tests/ui/impl-trait/in-trait
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:59:35 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:59:35 +0000
commitd1b2d29528b7794b41e66fc2136e395a02f8529b (patch)
treea4a17504b260206dec3cf55b2dca82929a348ac2 /tests/ui/impl-trait/in-trait
parentReleasing progress-linux version 1.72.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-d1b2d29528b7794b41e66fc2136e395a02f8529b.tar.xz
rustc-d1b2d29528b7794b41e66fc2136e395a02f8529b.zip
Merging upstream version 1.73.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/impl-trait/in-trait')
-rw-r--r--tests/ui/impl-trait/in-trait/assumed-wf-bounds-in-impl.rs29
-rw-r--r--tests/ui/impl-trait/in-trait/auxiliary/rpitit.rs6
-rw-r--r--tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit-2.rs11
-rw-r--r--tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit-2.stderr33
-rw-r--r--tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit.rs24
-rw-r--r--tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit.stderr17
-rw-r--r--tests/ui/impl-trait/in-trait/box-coerce-span-in-default.rs2
-rw-r--r--tests/ui/impl-trait/in-trait/check-wf-on-non-defaulted-rpitit.rs10
-rw-r--r--tests/ui/impl-trait/in-trait/check-wf-on-non-defaulted-rpitit.stderr16
-rw-r--r--tests/ui/impl-trait/in-trait/deep-match-works.rs2
-rw-r--r--tests/ui/impl-trait/in-trait/deep-match.next.stderr15
-rw-r--r--tests/ui/impl-trait/in-trait/deep-match.rs3
-rw-r--r--tests/ui/impl-trait/in-trait/deep-match.stderr (renamed from tests/ui/impl-trait/in-trait/deep-match.current.stderr)2
-rw-r--r--tests/ui/impl-trait/in-trait/default-body-type-err-2.next.stderr11
-rw-r--r--tests/ui/impl-trait/in-trait/default-body-type-err-2.rs2
-rw-r--r--tests/ui/impl-trait/in-trait/default-body-type-err-2.stderr (renamed from tests/ui/impl-trait/in-trait/default-body-type-err-2.current.stderr)2
-rw-r--r--tests/ui/impl-trait/in-trait/default-body-type-err.next.stderr12
-rw-r--r--tests/ui/impl-trait/in-trait/default-body-type-err.rs3
-rw-r--r--tests/ui/impl-trait/in-trait/default-body-type-err.stderr (renamed from tests/ui/impl-trait/in-trait/default-body-type-err.current.stderr)2
-rw-r--r--tests/ui/impl-trait/in-trait/default-body-with-rpit.current.stderr24
-rw-r--r--tests/ui/impl-trait/in-trait/default-body-with-rpit.next.stderr24
-rw-r--r--tests/ui/impl-trait/in-trait/default-body-with-rpit.rs4
-rw-r--r--tests/ui/impl-trait/in-trait/default-body.rs2
-rw-r--r--tests/ui/impl-trait/in-trait/default-method-binder-shifting.rs2
-rw-r--r--tests/ui/impl-trait/in-trait/default-method-constraint.rs2
-rw-r--r--tests/ui/impl-trait/in-trait/doesnt-satisfy.current.stderr17
-rw-r--r--tests/ui/impl-trait/in-trait/doesnt-satisfy.rs3
-rw-r--r--tests/ui/impl-trait/in-trait/doesnt-satisfy.stderr (renamed from tests/ui/impl-trait/in-trait/doesnt-satisfy.next.stderr)4
-rw-r--r--tests/ui/impl-trait/in-trait/dont-project-to-rpitit-with-no-value.next.stderr12
-rw-r--r--tests/ui/impl-trait/in-trait/dont-project-to-rpitit-with-no-value.rs3
-rw-r--r--tests/ui/impl-trait/in-trait/dont-project-to-rpitit-with-no-value.stderr (renamed from tests/ui/impl-trait/in-trait/dont-project-to-rpitit-with-no-value.current.stderr)2
-rw-r--r--tests/ui/impl-trait/in-trait/early.rs2
-rw-r--r--tests/ui/impl-trait/in-trait/encode.rs2
-rw-r--r--tests/ui/impl-trait/in-trait/foreign-dyn-error.stderr2
-rw-r--r--tests/ui/impl-trait/in-trait/foreign.rs6
-rw-r--r--tests/ui/impl-trait/in-trait/generics-mismatch.next.stderr12
-rw-r--r--tests/ui/impl-trait/in-trait/generics-mismatch.rs3
-rw-r--r--tests/ui/impl-trait/in-trait/generics-mismatch.stderr (renamed from tests/ui/impl-trait/in-trait/generics-mismatch.current.stderr)2
-rw-r--r--tests/ui/impl-trait/in-trait/issue-102140.current.stderr33
-rw-r--r--tests/ui/impl-trait/in-trait/issue-102140.rs3
-rw-r--r--tests/ui/impl-trait/in-trait/issue-102140.stderr (renamed from tests/ui/impl-trait/in-trait/issue-102140.next.stderr)6
-rw-r--r--tests/ui/impl-trait/in-trait/issue-102301.rs2
-rw-r--r--tests/ui/impl-trait/in-trait/issue-102571.next.stderr14
-rw-r--r--tests/ui/impl-trait/in-trait/issue-102571.rs3
-rw-r--r--tests/ui/impl-trait/in-trait/issue-102571.stderr (renamed from tests/ui/impl-trait/in-trait/issue-102571.current.stderr)2
-rw-r--r--tests/ui/impl-trait/in-trait/missing-lt-outlives-in-rpitit-114274.rs12
-rw-r--r--tests/ui/impl-trait/in-trait/missing-lt-outlives-in-rpitit-114274.stderr23
-rw-r--r--tests/ui/impl-trait/in-trait/nested-rpitit.rs2
-rw-r--r--tests/ui/impl-trait/in-trait/object-safety.next.stderr49
-rw-r--r--tests/ui/impl-trait/in-trait/object-safety.rs3
-rw-r--r--tests/ui/impl-trait/in-trait/object-safety.stderr (renamed from tests/ui/impl-trait/in-trait/object-safety.current.stderr)12
-rw-r--r--tests/ui/impl-trait/in-trait/opaque-in-impl-is-opaque.next.stderr17
-rw-r--r--tests/ui/impl-trait/in-trait/opaque-in-impl-is-opaque.rs3
-rw-r--r--tests/ui/impl-trait/in-trait/opaque-in-impl-is-opaque.stderr (renamed from tests/ui/impl-trait/in-trait/opaque-in-impl-is-opaque.current.stderr)2
-rw-r--r--tests/ui/impl-trait/in-trait/opaque-in-impl.rs2
-rw-r--r--tests/ui/impl-trait/in-trait/outlives-in-nested-rpit.rs11
-rw-r--r--tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.current.stderr16
-rw-r--r--tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.rs3
-rw-r--r--tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.stderr (renamed from tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.next.stderr)4
-rw-r--r--tests/ui/impl-trait/in-trait/reveal.rs2
-rw-r--r--tests/ui/impl-trait/in-trait/rpitit-shadowed-by-missing-adt.rs18
-rw-r--r--tests/ui/impl-trait/in-trait/rpitit-shadowed-by-missing-adt.stderr9
-rw-r--r--tests/ui/impl-trait/in-trait/signature-mismatch.next.stderr61
-rw-r--r--tests/ui/impl-trait/in-trait/signature-mismatch.rs2
-rw-r--r--tests/ui/impl-trait/in-trait/signature-mismatch.stderr (renamed from tests/ui/impl-trait/in-trait/signature-mismatch.current.stderr)16
-rw-r--r--tests/ui/impl-trait/in-trait/specialization-broken.next.stderr31
-rw-r--r--tests/ui/impl-trait/in-trait/specialization-broken.rs3
-rw-r--r--tests/ui/impl-trait/in-trait/specialization-broken.stderr (renamed from tests/ui/impl-trait/in-trait/specialization-broken.current.stderr)6
-rw-r--r--tests/ui/impl-trait/in-trait/specialization-substs-remap.rs2
-rw-r--r--tests/ui/impl-trait/in-trait/success.rs2
-rw-r--r--tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.next.stderr12
-rw-r--r--tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.rs3
-rw-r--r--tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.stderr (renamed from tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.current.stderr)2
-rw-r--r--tests/ui/impl-trait/in-trait/unconstrained-lt.next.stderr9
-rw-r--r--tests/ui/impl-trait/in-trait/unconstrained-lt.rs7
-rw-r--r--tests/ui/impl-trait/in-trait/unconstrained-lt.stderr (renamed from tests/ui/impl-trait/in-trait/unconstrained-lt.current.stderr)2
-rw-r--r--tests/ui/impl-trait/in-trait/variances-of-gat.rs2
-rw-r--r--tests/ui/impl-trait/in-trait/wf-bounds.next.stderr57
-rw-r--r--tests/ui/impl-trait/in-trait/wf-bounds.rs2
-rw-r--r--tests/ui/impl-trait/in-trait/wf-bounds.stderr (renamed from tests/ui/impl-trait/in-trait/wf-bounds.current.stderr)16
-rw-r--r--tests/ui/impl-trait/in-trait/where-clause.rs2
81 files changed, 263 insertions, 555 deletions
diff --git a/tests/ui/impl-trait/in-trait/assumed-wf-bounds-in-impl.rs b/tests/ui/impl-trait/in-trait/assumed-wf-bounds-in-impl.rs
new file mode 100644
index 000000000..2a61c5cc8
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/assumed-wf-bounds-in-impl.rs
@@ -0,0 +1,29 @@
+// check-pass
+// edition: 2021
+// issue: 113796
+
+#![feature(async_fn_in_trait)]
+
+trait AsyncLendingIterator {
+ type Item<'a>
+ where
+ Self: 'a;
+
+ async fn next(&mut self) -> Option<Self::Item<'_>>;
+}
+
+struct Lend<I>(I);
+impl<I> AsyncLendingIterator for Lend<I> {
+ type Item<'a> = &'a I
+ where
+ Self: 'a;
+
+ // Checking that the synthetic `<Self as AsyncLendingIterator>::next()` GAT
+ // is well-formed requires being able to assume the WF types of `next`.
+
+ async fn next(&mut self) -> Option<Self::Item<'_>> {
+ todo!()
+ }
+}
+
+fn main() {}
diff --git a/tests/ui/impl-trait/in-trait/auxiliary/rpitit.rs b/tests/ui/impl-trait/in-trait/auxiliary/rpitit.rs
index 776006124..cfc2193f6 100644
--- a/tests/ui/impl-trait/in-trait/auxiliary/rpitit.rs
+++ b/tests/ui/impl-trait/in-trait/auxiliary/rpitit.rs
@@ -1,5 +1,3 @@
-// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
-
#![feature(return_position_impl_trait_in_trait)]
use std::ops::Deref;
@@ -10,5 +8,7 @@ pub trait Foo {
pub struct Foreign;
impl Foo for Foreign {
- fn bar(self) -> &'static () { &() }
+ fn bar(self) -> &'static () {
+ &()
+ }
}
diff --git a/tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit-2.rs b/tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit-2.rs
new file mode 100644
index 000000000..3a93dfee5
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit-2.rs
@@ -0,0 +1,11 @@
+// issue: 114146
+
+#![feature(return_position_impl_trait_in_trait)]
+
+trait Foo {
+ fn bar<'other: 'a>() -> impl Sized + 'a {}
+ //~^ ERROR use of undeclared lifetime name `'a`
+ //~| ERROR use of undeclared lifetime name `'a`
+}
+
+fn main() {}
diff --git a/tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit-2.stderr b/tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit-2.stderr
new file mode 100644
index 000000000..3a1f8f908
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit-2.stderr
@@ -0,0 +1,33 @@
+error[E0261]: use of undeclared lifetime name `'a`
+ --> $DIR/bad-item-bound-within-rpitit-2.rs:6:20
+ |
+LL | fn bar<'other: 'a>() -> impl Sized + 'a {}
+ | ^^ undeclared lifetime
+ |
+help: consider introducing lifetime `'a` here
+ |
+LL | fn bar<'a, 'other: 'a>() -> impl Sized + 'a {}
+ | +++
+help: consider introducing lifetime `'a` here
+ |
+LL | trait Foo<'a> {
+ | ++++
+
+error[E0261]: use of undeclared lifetime name `'a`
+ --> $DIR/bad-item-bound-within-rpitit-2.rs:6:42
+ |
+LL | fn bar<'other: 'a>() -> impl Sized + 'a {}
+ | ^^ undeclared lifetime
+ |
+help: consider introducing lifetime `'a` here
+ |
+LL | fn bar<'a, 'other: 'a>() -> impl Sized + 'a {}
+ | +++
+help: consider introducing lifetime `'a` here
+ |
+LL | trait Foo<'a> {
+ | ++++
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0261`.
diff --git a/tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit.rs b/tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit.rs
new file mode 100644
index 000000000..ff7ad4bf3
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit.rs
@@ -0,0 +1,24 @@
+// issue: 114145
+
+#![feature(return_position_impl_trait_in_trait)]
+
+trait Iterable {
+ type Item<'a>
+ where
+ Self: 'a;
+
+ fn iter(&self) -> impl '_ + Iterator<Item = Self::Item<'_>>;
+}
+
+impl<'a, I: 'a + Iterable> Iterable for &'a I {
+ type Item<'b> = I::Item<'a>
+ where
+ 'b: 'a;
+ //~^ ERROR impl has stricter requirements than trait
+
+ fn iter(&self) -> impl 'a + Iterator<Item = I::Item<'a>> {
+ (*self).iter()
+ }
+}
+
+fn main() {}
diff --git a/tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit.stderr b/tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit.stderr
new file mode 100644
index 000000000..106b8a7c8
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/bad-item-bound-within-rpitit.stderr
@@ -0,0 +1,17 @@
+error[E0276]: impl has stricter requirements than trait
+ --> $DIR/bad-item-bound-within-rpitit.rs:16:13
+ |
+LL | type Item<'a>
+ | ------------- definition of `Item` from trait
+...
+LL | 'b: 'a;
+ | ^^ impl has extra requirement `'b: 'a`
+ |
+help: copy the `where` clause predicates from the trait
+ |
+LL | where Self: 'b;
+ | ~~~~~~~~~~~~~~
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0276`.
diff --git a/tests/ui/impl-trait/in-trait/box-coerce-span-in-default.rs b/tests/ui/impl-trait/in-trait/box-coerce-span-in-default.rs
index f5290a5f4..f5ee4690f 100644
--- a/tests/ui/impl-trait/in-trait/box-coerce-span-in-default.rs
+++ b/tests/ui/impl-trait/in-trait/box-coerce-span-in-default.rs
@@ -1,6 +1,4 @@
// check-pass
-// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
-// revisions: current next
#![feature(return_position_impl_trait_in_trait)]
diff --git a/tests/ui/impl-trait/in-trait/check-wf-on-non-defaulted-rpitit.rs b/tests/ui/impl-trait/in-trait/check-wf-on-non-defaulted-rpitit.rs
new file mode 100644
index 000000000..742537ffc
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/check-wf-on-non-defaulted-rpitit.rs
@@ -0,0 +1,10 @@
+#![feature(return_position_impl_trait_in_trait)]
+
+struct Wrapper<G: Send>(G);
+
+trait Foo {
+ fn bar() -> Wrapper<impl Sized>;
+ //~^ ERROR `impl Sized` cannot be sent between threads safely
+}
+
+fn main() {}
diff --git a/tests/ui/impl-trait/in-trait/check-wf-on-non-defaulted-rpitit.stderr b/tests/ui/impl-trait/in-trait/check-wf-on-non-defaulted-rpitit.stderr
new file mode 100644
index 000000000..dee87d082
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/check-wf-on-non-defaulted-rpitit.stderr
@@ -0,0 +1,16 @@
+error[E0277]: `impl Sized` cannot be sent between threads safely
+ --> $DIR/check-wf-on-non-defaulted-rpitit.rs:6:17
+ |
+LL | fn bar() -> Wrapper<impl Sized>;
+ | ^^^^^^^^^^^^^^^^^^^ `impl Sized` cannot be sent between threads safely
+ |
+ = help: the trait `Send` is not implemented for `impl Sized`
+note: required by a bound in `Wrapper`
+ --> $DIR/check-wf-on-non-defaulted-rpitit.rs:3:19
+ |
+LL | struct Wrapper<G: Send>(G);
+ | ^^^^ required by this bound in `Wrapper`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/impl-trait/in-trait/deep-match-works.rs b/tests/ui/impl-trait/in-trait/deep-match-works.rs
index 5c9d2e356..78cff97c6 100644
--- a/tests/ui/impl-trait/in-trait/deep-match-works.rs
+++ b/tests/ui/impl-trait/in-trait/deep-match-works.rs
@@ -1,6 +1,4 @@
// check-pass
-// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
-// revisions: current next
#![feature(return_position_impl_trait_in_trait)]
#![allow(incomplete_features)]
diff --git a/tests/ui/impl-trait/in-trait/deep-match.next.stderr b/tests/ui/impl-trait/in-trait/deep-match.next.stderr
deleted file mode 100644
index 400db20c7..000000000
--- a/tests/ui/impl-trait/in-trait/deep-match.next.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error[E0053]: method `bar` has an incompatible return type for trait
- --> $DIR/deep-match.rs:14:17
- |
-LL | fn bar() -> i32 {
- | ^^^
- | |
- | expected `Wrapper<_>`, found `i32`
- | return type in trait
- |
- = note: expected struct `Wrapper<_>`
- found type `i32`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0053`.
diff --git a/tests/ui/impl-trait/in-trait/deep-match.rs b/tests/ui/impl-trait/in-trait/deep-match.rs
index 413d054e1..0cae88f34 100644
--- a/tests/ui/impl-trait/in-trait/deep-match.rs
+++ b/tests/ui/impl-trait/in-trait/deep-match.rs
@@ -1,6 +1,3 @@
-// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
-// revisions: current next
-
#![feature(return_position_impl_trait_in_trait)]
#![allow(incomplete_features)]
diff --git a/tests/ui/impl-trait/in-trait/deep-match.current.stderr b/tests/ui/impl-trait/in-trait/deep-match.stderr
index 400db20c7..f0ad3c16e 100644
--- a/tests/ui/impl-trait/in-trait/deep-match.current.stderr
+++ b/tests/ui/impl-trait/in-trait/deep-match.stderr
@@ -1,5 +1,5 @@
error[E0053]: method `bar` has an incompatible return type for trait
- --> $DIR/deep-match.rs:14:17
+ --> $DIR/deep-match.rs:11:17
|
LL | fn bar() -> i32 {
| ^^^
diff --git a/tests/ui/impl-trait/in-trait/default-body-type-err-2.next.stderr b/tests/ui/impl-trait/in-trait/default-body-type-err-2.next.stderr
deleted file mode 100644
index 85450e3b0..000000000
--- a/tests/ui/impl-trait/in-trait/default-body-type-err-2.next.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0308]: mismatched types
- --> $DIR/default-body-type-err-2.rs:10:9
- |
-LL | 42
- | ^^- help: try using a conversion method: `.to_string()`
- | |
- | expected `String`, found integer
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/impl-trait/in-trait/default-body-type-err-2.rs b/tests/ui/impl-trait/in-trait/default-body-type-err-2.rs
index 623237763..45ae2b8ad 100644
--- a/tests/ui/impl-trait/in-trait/default-body-type-err-2.rs
+++ b/tests/ui/impl-trait/in-trait/default-body-type-err-2.rs
@@ -1,6 +1,4 @@
// edition:2021
-// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
-// revisions: current next
#![allow(incomplete_features)]
#![feature(async_fn_in_trait)]
diff --git a/tests/ui/impl-trait/in-trait/default-body-type-err-2.current.stderr b/tests/ui/impl-trait/in-trait/default-body-type-err-2.stderr
index 85450e3b0..cc3bdf0e5 100644
--- a/tests/ui/impl-trait/in-trait/default-body-type-err-2.current.stderr
+++ b/tests/ui/impl-trait/in-trait/default-body-type-err-2.stderr
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
- --> $DIR/default-body-type-err-2.rs:10:9
+ --> $DIR/default-body-type-err-2.rs:8:9
|
LL | 42
| ^^- help: try using a conversion method: `.to_string()`
diff --git a/tests/ui/impl-trait/in-trait/default-body-type-err.next.stderr b/tests/ui/impl-trait/in-trait/default-body-type-err.next.stderr
deleted file mode 100644
index c949168a3..000000000
--- a/tests/ui/impl-trait/in-trait/default-body-type-err.next.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0271]: type mismatch resolving `<&i32 as Deref>::Target == String`
- --> $DIR/default-body-type-err.rs:10:22
- |
-LL | fn lol(&self) -> impl Deref<Target = String> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `String`
-LL |
-LL | &1i32
- | ----- return type was inferred to be `&i32` here
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0271`.
diff --git a/tests/ui/impl-trait/in-trait/default-body-type-err.rs b/tests/ui/impl-trait/in-trait/default-body-type-err.rs
index 9bd5b7779..ac9baf91c 100644
--- a/tests/ui/impl-trait/in-trait/default-body-type-err.rs
+++ b/tests/ui/impl-trait/in-trait/default-body-type-err.rs
@@ -1,6 +1,3 @@
-// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
-// revisions: current next
-
#![allow(incomplete_features)]
#![feature(return_position_impl_trait_in_trait)]
diff --git a/tests/ui/impl-trait/in-trait/default-body-type-err.current.stderr b/tests/ui/impl-trait/in-trait/default-body-type-err.stderr
index c949168a3..4742eb37d 100644
--- a/tests/ui/impl-trait/in-trait/default-body-type-err.current.stderr
+++ b/tests/ui/impl-trait/in-trait/default-body-type-err.stderr
@@ -1,5 +1,5 @@
error[E0271]: type mismatch resolving `<&i32 as Deref>::Target == String`
- --> $DIR/default-body-type-err.rs:10:22
+ --> $DIR/default-body-type-err.rs:7:22
|
LL | fn lol(&self) -> impl Deref<Target = String> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `String`
diff --git a/tests/ui/impl-trait/in-trait/default-body-with-rpit.current.stderr b/tests/ui/impl-trait/in-trait/default-body-with-rpit.current.stderr
deleted file mode 100644
index 3c24eff9a..000000000
--- a/tests/ui/impl-trait/in-trait/default-body-with-rpit.current.stderr
+++ /dev/null
@@ -1,24 +0,0 @@
-error: concrete type differs from previous defining opaque type use
- --> $DIR/default-body-with-rpit.rs:13:9
- |
-LL | ""
- | ^^ expected `impl Debug`, got `&'static str`
- |
-note: previous use here
- --> $DIR/default-body-with-rpit.rs:12:39
- |
-LL | async fn baz(&self) -> impl Debug {
- | _______________________________________^
-LL | | ""
-LL | | }
- | |_____^
-
-error[E0720]: cannot resolve opaque type
- --> $DIR/default-body-with-rpit.rs:12:28
- |
-LL | async fn baz(&self) -> impl Debug {
- | ^^^^^^^^^^ cannot resolve opaque type
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0720`.
diff --git a/tests/ui/impl-trait/in-trait/default-body-with-rpit.next.stderr b/tests/ui/impl-trait/in-trait/default-body-with-rpit.next.stderr
deleted file mode 100644
index 3c24eff9a..000000000
--- a/tests/ui/impl-trait/in-trait/default-body-with-rpit.next.stderr
+++ /dev/null
@@ -1,24 +0,0 @@
-error: concrete type differs from previous defining opaque type use
- --> $DIR/default-body-with-rpit.rs:13:9
- |
-LL | ""
- | ^^ expected `impl Debug`, got `&'static str`
- |
-note: previous use here
- --> $DIR/default-body-with-rpit.rs:12:39
- |
-LL | async fn baz(&self) -> impl Debug {
- | _______________________________________^
-LL | | ""
-LL | | }
- | |_____^
-
-error[E0720]: cannot resolve opaque type
- --> $DIR/default-body-with-rpit.rs:12:28
- |
-LL | async fn baz(&self) -> impl Debug {
- | ^^^^^^^^^^ cannot resolve opaque type
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0720`.
diff --git a/tests/ui/impl-trait/in-trait/default-body-with-rpit.rs b/tests/ui/impl-trait/in-trait/default-body-with-rpit.rs
index 6bcc7b9ef..25133214d 100644
--- a/tests/ui/impl-trait/in-trait/default-body-with-rpit.rs
+++ b/tests/ui/impl-trait/in-trait/default-body-with-rpit.rs
@@ -1,7 +1,5 @@
// edition:2021
-// known-bug: #108304
-// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
-// revisions: current next
+// check-pass
#![feature(async_fn_in_trait, return_position_impl_trait_in_trait)]
#![allow(incomplete_features)]
diff --git a/tests/ui/impl-trait/in-trait/default-body.rs b/tests/ui/impl-trait/in-trait/default-body.rs
index ab6a51c6b..b0baf5bb1 100644
--- a/tests/ui/impl-trait/in-trait/default-body.rs
+++ b/tests/ui/impl-trait/in-trait/default-body.rs
@@ -1,7 +1,5 @@
// check-pass
// edition:2021
-// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
-// revisions: current next
#![feature(async_fn_in_trait, return_position_impl_trait_in_trait)]
#![allow(incomplete_features)]
diff --git a/tests/ui/impl-trait/in-trait/default-method-binder-shifting.rs b/tests/ui/impl-trait/in-trait/default-method-binder-shifting.rs
index 187039f44..817a4d7db 100644
--- a/tests/ui/impl-trait/in-trait/default-method-binder-shifting.rs
+++ b/tests/ui/impl-trait/in-trait/default-method-binder-shifting.rs
@@ -1,6 +1,4 @@
// check-pass
-// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
-// revisions: current next
#![feature(return_position_impl_trait_in_trait)]
diff --git a/tests/ui/impl-trait/in-trait/default-method-constraint.rs b/tests/ui/impl-trait/in-trait/default-method-constraint.rs
index 4f0bf2e7d..28d76241f 100644
--- a/tests/ui/impl-trait/in-trait/default-method-constraint.rs
+++ b/tests/ui/impl-trait/in-trait/default-method-constraint.rs
@@ -1,6 +1,4 @@
// check-pass
-// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
-// revisions: current next
// This didn't work in the previous default RPITIT method hack attempt
diff --git a/tests/ui/impl-trait/in-trait/doesnt-satisfy.current.stderr b/tests/ui/impl-trait/in-trait/doesnt-satisfy.current.stderr
deleted file mode 100644
index 653016cf0..000000000
--- a/tests/ui/impl-trait/in-trait/doesnt-satisfy.current.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-error[E0277]: `()` doesn't implement `std::fmt::Display`
- --> $DIR/doesnt-satisfy.rs:12:17
- |
-LL | fn bar() -> () {}
- | ^^ `()` cannot be formatted with the default formatter
- |
- = help: the trait `std::fmt::Display` is not implemented for `()`
- = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
-note: required by a bound in `Foo::bar::{opaque#0}`
- --> $DIR/doesnt-satisfy.rs:8:22
- |
-LL | fn bar() -> impl std::fmt::Display;
- | ^^^^^^^^^^^^^^^^^ required by this bound in `Foo::bar::{opaque#0}`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/impl-trait/in-trait/doesnt-satisfy.rs b/tests/ui/impl-trait/in-trait/doesnt-satisfy.rs
index fcd0b51ee..bb4e0d44f 100644
--- a/tests/ui/impl-trait/in-trait/doesnt-satisfy.rs
+++ b/tests/ui/impl-trait/in-trait/doesnt-satisfy.rs
@@ -1,6 +1,3 @@
-// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
-// revisions: current next
-
#![feature(return_position_impl_trait_in_trait)]
#![allow(incomplete_features)]
diff --git a/tests/ui/impl-trait/in-trait/doesnt-satisfy.next.stderr b/tests/ui/impl-trait/in-trait/doesnt-satisfy.stderr
index f0cd43bcf..7c56ffa10 100644
--- a/tests/ui/impl-trait/in-trait/doesnt-satisfy.next.stderr
+++ b/tests/ui/impl-trait/in-trait/doesnt-satisfy.stderr
@@ -1,5 +1,5 @@
error[E0277]: `()` doesn't implement `std::fmt::Display`
- --> $DIR/doesnt-satisfy.rs:12:17
+ --> $DIR/doesnt-satisfy.rs:9:17
|
LL | fn bar() -> () {}
| ^^ `()` cannot be formatted with the default formatter
@@ -7,7 +7,7 @@ LL | fn bar() -> () {}
= help: the trait `std::fmt::Display` is not implemented for `()`
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
note: required by a bound in `Foo::{opaque#0}`
- --> $DIR/doesnt-satisfy.rs:8:22
+ --> $DIR/doesnt-satisfy.rs:5:22
|
LL | fn bar() -> impl std::fmt::Display;
| ^^^^^^^^^^^^^^^^^ required by this bound in `Foo::{opaque#0}`
diff --git a/tests/ui/impl-trait/in-trait/dont-project-to-rpitit-with-no-value.next.stderr b/tests/ui/impl-trait/in-trait/dont-project-to-rpitit-with-no-value.next.stderr
deleted file mode 100644
index d4d0124a6..000000000
--- a/tests/ui/impl-trait/in-trait/dont-project-to-rpitit-with-no-value.next.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0046]: not all trait items implemented, missing: `foo`
- --> $DIR/dont-project-to-rpitit-with-no-value.rs:11:1
- |
-LL | fn foo(&self) -> impl Sized;
- | ---------------------------- `foo` from trait
-...
-LL | impl MyTrait for i32 {
- | ^^^^^^^^^^^^^^^^^^^^ missing `foo` in implementation
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0046`.
diff --git a/tests/ui/impl-trait/in-trait/dont-project-to-rpitit-with-no-value.rs b/tests/ui/impl-trait/in-trait/dont-project-to-rpitit-with-no-value.rs
index 4d50b8c92..4719d5d3c 100644
--- a/tests/ui/impl-trait/in-trait/dont-project-to-rpitit-with-no-value.rs
+++ b/tests/ui/impl-trait/in-trait/dont-project-to-rpitit-with-no-value.rs
@@ -1,6 +1,3 @@
-// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
-// revisions: current next
-
#![feature(return_position_impl_trait_in_trait)]
trait MyTrait {
diff --git a/tests/ui/impl-trait/in-trait/dont-project-to-rpitit-with-no-value.current.stderr b/tests/ui/impl-trait/in-trait/dont-project-to-rpitit-with-no-value.stderr
index d4d0124a6..66ee142cc 100644
--- a/tests/ui/impl-trait/in-trait/dont-project-to-rpitit-with-no-value.current.stderr
+++ b/tests/ui/impl-trait/in-trait/dont-project-to-rpitit-with-no-value.stderr
@@ -1,5 +1,5 @@
error[E0046]: not all trait items implemented, missing: `foo`
- --> $DIR/dont-project-to-rpitit-with-no-value.rs:11:1
+ --> $DIR/dont-project-to-rpitit-with-no-value.rs:8:1
|
LL | fn foo(&self) -> impl Sized;
| ---------------------------- `foo` from trait
diff --git a/tests/ui/impl-trait/in-trait/early.rs b/tests/ui/impl-trait/in-trait/early.rs
index 831033a58..9c1c2b503 100644
--- a/tests/ui/impl-trait/in-trait/early.rs
+++ b/tests/ui/impl-trait/in-trait/early.rs
@@ -1,7 +1,5 @@
// check-pass
// edition:2021
-// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
-// revisions: current next
#![feature(async_fn_in_trait, return_position_impl_trait_in_trait)]
#![allow(incomplete_features)]
diff --git a/tests/ui/impl-trait/in-trait/encode.rs b/tests/ui/impl-trait/in-trait/encode.rs
index 98aaf4a65..efb9f6498 100644
--- a/tests/ui/impl-trait/in-trait/encode.rs
+++ b/tests/ui/impl-trait/in-trait/encode.rs
@@ -1,7 +1,5 @@
// build-pass
// compile-flags: --crate-type=lib
-// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
-// revisions: current next
#![feature(return_position_impl_trait_in_trait)]
#![allow(incomplete_features)]
diff --git a/tests/ui/impl-trait/in-trait/foreign-dyn-error.stderr b/tests/ui/impl-trait/in-trait/foreign-dyn-error.stderr
index 6eef392c0..bfb2be8cb 100644
--- a/tests/ui/impl-trait/in-trait/foreign-dyn-error.stderr
+++ b/tests/ui/impl-trait/in-trait/foreign-dyn-error.stderr
@@ -5,7 +5,7 @@ LL | let _: &dyn rpitit::Foo = todo!();
| ^^^^^^^^^^^^^^^^ `Foo` cannot be made into an object
|
note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
- --> $DIR/auxiliary/rpitit.rs:8:21
+ --> $DIR/auxiliary/rpitit.rs:6:21
|
LL | fn bar(self) -> impl Deref<Target = impl Sized>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait cannot be made into an object because method `bar` references an `impl Trait` type in its return type
diff --git a/tests/ui/impl-trait/in-trait/foreign.rs b/tests/ui/impl-trait/in-trait/foreign.rs
index b0fbe3a3d..b0c93a029 100644
--- a/tests/ui/impl-trait/in-trait/foreign.rs
+++ b/tests/ui/impl-trait/in-trait/foreign.rs
@@ -1,7 +1,5 @@
// check-pass
// aux-build: rpitit.rs
-// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
-// revisions: current next
extern crate rpitit;
@@ -11,7 +9,9 @@ use std::sync::Arc;
// Implement an RPITIT from another crate.
struct Local;
impl Foo for Local {
- fn bar(self) -> Arc<String> { Arc::new(String::new()) }
+ fn bar(self) -> Arc<String> {
+ Arc::new(String::new())
+ }
}
fn generic(f: impl Foo) {
diff --git a/tests/ui/impl-trait/in-trait/generics-mismatch.next.stderr b/tests/ui/impl-trait/in-trait/generics-mismatch.next.stderr
deleted file mode 100644
index 310edbcb6..000000000
--- a/tests/ui/impl-trait/in-trait/generics-mismatch.next.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0049]: method `bar` has 1 type parameter but its trait declaration has 0 type parameters
- --> $DIR/generics-mismatch.rs:14:12
- |
-LL | fn bar(&self) -> impl Sized;
- | - expected 0 type parameters
-...
-LL | fn bar<T>(&self) {}
- | ^ found 1 type parameter
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0049`.
diff --git a/tests/ui/impl-trait/in-trait/generics-mismatch.rs b/tests/ui/impl-trait/in-trait/generics-mismatch.rs
index 9259ca193..cc0fc720e 100644
--- a/tests/ui/impl-trait/in-trait/generics-mismatch.rs
+++ b/tests/ui/impl-trait/in-trait/generics-mismatch.rs
@@ -1,6 +1,3 @@
-// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
-// revisions: current next
-
#![feature(return_position_impl_trait_in_trait)]
#![allow(incomplete_features)]
diff --git a/tests/ui/impl-trait/in-trait/generics-mismatch.current.stderr b/tests/ui/impl-trait/in-trait/generics-mismatch.stderr
index 310edbcb6..cd42683e0 100644
--- a/tests/ui/impl-trait/in-trait/generics-mismatch.current.stderr
+++ b/tests/ui/impl-trait/in-trait/generics-mismatch.stderr
@@ -1,5 +1,5 @@
error[E0049]: method `bar` has 1 type parameter but its trait declaration has 0 type parameters
- --> $DIR/generics-mismatch.rs:14:12
+ --> $DIR/generics-mismatch.rs:11:12
|
LL | fn bar(&self) -> impl Sized;
| - expected 0 type parameters
diff --git a/tests/ui/impl-trait/in-trait/issue-102140.current.stderr b/tests/ui/impl-trait/in-trait/issue-102140.current.stderr
deleted file mode 100644
index 7aa7880e2..000000000
--- a/tests/ui/impl-trait/in-trait/issue-102140.current.stderr
+++ /dev/null
@@ -1,33 +0,0 @@
-error[E0277]: the trait bound `&dyn MyTrait: MyTrait` is not satisfied
- --> $DIR/issue-102140.rs:26:22
- |
-LL | MyTrait::foo(&self)
- | ------------ ^^^^^ the trait `MyTrait` is not implemented for `&dyn MyTrait`
- | |
- | required by a bound introduced by this call
- |
-help: consider removing the leading `&`-reference
- |
-LL - MyTrait::foo(&self)
-LL + MyTrait::foo(self)
- |
-
-error[E0277]: the trait bound `&dyn MyTrait: MyTrait` is not satisfied
- --> $DIR/issue-102140.rs:26:9
- |
-LL | MyTrait::foo(&self)
- | ^^^^^^^^^^^^^^^^^^^ the trait `MyTrait` is not implemented for `&dyn MyTrait`
- |
- = help: the trait `MyTrait` is implemented for `Outer`
-
-error[E0277]: the trait bound `&dyn MyTrait: MyTrait` is not satisfied
- --> $DIR/issue-102140.rs:26:9
- |
-LL | MyTrait::foo(&self)
- | ^^^^^^^^^^^^ the trait `MyTrait` is not implemented for `&dyn MyTrait`
- |
- = help: the trait `MyTrait` is implemented for `Outer`
-
-error: aborting due to 3 previous errors
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/impl-trait/in-trait/issue-102140.rs b/tests/ui/impl-trait/in-trait/issue-102140.rs
index 4dcac4f5b..be1e012ac 100644
--- a/tests/ui/impl-trait/in-trait/issue-102140.rs
+++ b/tests/ui/impl-trait/in-trait/issue-102140.rs
@@ -1,6 +1,3 @@
-// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
-// revisions: current next
-
#![feature(return_position_impl_trait_in_trait)]
#![allow(incomplete_features)]
diff --git a/tests/ui/impl-trait/in-trait/issue-102140.next.stderr b/tests/ui/impl-trait/in-trait/issue-102140.stderr
index 94893c9e7..5d55b9fa4 100644
--- a/tests/ui/impl-trait/in-trait/issue-102140.next.stderr
+++ b/tests/ui/impl-trait/in-trait/issue-102140.stderr
@@ -1,5 +1,5 @@
error[E0277]: the trait bound `&dyn MyTrait: MyTrait` is not satisfied
- --> $DIR/issue-102140.rs:26:22
+ --> $DIR/issue-102140.rs:23:22
|
LL | MyTrait::foo(&self)
| ------------ ^^^^^ the trait `MyTrait` is not implemented for `&dyn MyTrait`
@@ -9,7 +9,7 @@ LL | MyTrait::foo(&self)
= help: the trait `MyTrait` is implemented for `Outer`
error[E0277]: the trait bound `&dyn MyTrait: MyTrait` is not satisfied
- --> $DIR/issue-102140.rs:26:9
+ --> $DIR/issue-102140.rs:23:9
|
LL | MyTrait::foo(&self)
| ^^^^^^^^^^^^^^^^^^^ the trait `MyTrait` is not implemented for `&dyn MyTrait`
@@ -17,7 +17,7 @@ LL | MyTrait::foo(&self)
= help: the trait `MyTrait` is implemented for `Outer`
error[E0277]: the trait bound `&dyn MyTrait: MyTrait` is not satisfied
- --> $DIR/issue-102140.rs:26:9
+ --> $DIR/issue-102140.rs:23:9
|
LL | MyTrait::foo(&self)
| ^^^^^^^^^^^^ the trait `MyTrait` is not implemented for `&dyn MyTrait`
diff --git a/tests/ui/impl-trait/in-trait/issue-102301.rs b/tests/ui/impl-trait/in-trait/issue-102301.rs
index 1329ca29d..a93714a65 100644
--- a/tests/ui/impl-trait/in-trait/issue-102301.rs
+++ b/tests/ui/impl-trait/in-trait/issue-102301.rs
@@ -1,6 +1,4 @@
// check-pass
-// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
-// revisions: current next
#![feature(return_position_impl_trait_in_trait)]
#![allow(incomplete_features)]
diff --git a/tests/ui/impl-trait/in-trait/issue-102571.next.stderr b/tests/ui/impl-trait/in-trait/issue-102571.next.stderr
deleted file mode 100644
index cac9a29f6..000000000
--- a/tests/ui/impl-trait/in-trait/issue-102571.next.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error[E0308]: mismatched types
- --> $DIR/issue-102571.rs:23:9
- |
-LL | let () = t.bar();
- | ^^ ------- this expression has type `impl Deref<Target = impl std::fmt::Display + ?Sized>`
- | |
- | expected associated type, found `()`
- |
- = note: expected associated type `impl Deref<Target = impl std::fmt::Display + ?Sized>`
- found unit type `()`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/impl-trait/in-trait/issue-102571.rs b/tests/ui/impl-trait/in-trait/issue-102571.rs
index f0ddab5e7..61c91e644 100644
--- a/tests/ui/impl-trait/in-trait/issue-102571.rs
+++ b/tests/ui/impl-trait/in-trait/issue-102571.rs
@@ -1,6 +1,3 @@
-// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
-// revisions: current next
-
#![feature(return_position_impl_trait_in_trait)]
#![allow(incomplete_features)]
diff --git a/tests/ui/impl-trait/in-trait/issue-102571.current.stderr b/tests/ui/impl-trait/in-trait/issue-102571.stderr
index cac9a29f6..87219941d 100644
--- a/tests/ui/impl-trait/in-trait/issue-102571.current.stderr
+++ b/tests/ui/impl-trait/in-trait/issue-102571.stderr
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
- --> $DIR/issue-102571.rs:23:9
+ --> $DIR/issue-102571.rs:20:9
|
LL | let () = t.bar();
| ^^ ------- this expression has type `impl Deref<Target = impl std::fmt::Display + ?Sized>`
diff --git a/tests/ui/impl-trait/in-trait/missing-lt-outlives-in-rpitit-114274.rs b/tests/ui/impl-trait/in-trait/missing-lt-outlives-in-rpitit-114274.rs
new file mode 100644
index 000000000..abc845d3a
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/missing-lt-outlives-in-rpitit-114274.rs
@@ -0,0 +1,12 @@
+#![feature(return_position_impl_trait_in_trait)]
+
+trait Iterable {
+ type Item<'a>
+ where
+ Self: 'a;
+
+ fn iter(&self) -> impl Iterator<Item = Self::Item<'missing>>;
+ //~^ ERROR use of undeclared lifetime name `'missing`
+}
+
+fn main() {}
diff --git a/tests/ui/impl-trait/in-trait/missing-lt-outlives-in-rpitit-114274.stderr b/tests/ui/impl-trait/in-trait/missing-lt-outlives-in-rpitit-114274.stderr
new file mode 100644
index 000000000..0d74c0b69
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/missing-lt-outlives-in-rpitit-114274.stderr
@@ -0,0 +1,23 @@
+error[E0261]: use of undeclared lifetime name `'missing`
+ --> $DIR/missing-lt-outlives-in-rpitit-114274.rs:8:55
+ |
+LL | fn iter(&self) -> impl Iterator<Item = Self::Item<'missing>>;
+ | ^^^^^^^^ undeclared lifetime
+ |
+ = note: for more information on higher-ranked polymorphism, visit https://doc.rust-lang.org/nomicon/hrtb.html
+help: consider making the bound lifetime-generic with a new `'missing` lifetime
+ |
+LL | fn iter(&self) -> impl for<'missing> Iterator<Item = Self::Item<'missing>>;
+ | +++++++++++++
+help: consider introducing lifetime `'missing` here
+ |
+LL | fn iter<'missing>(&self) -> impl Iterator<Item = Self::Item<'missing>>;
+ | ++++++++++
+help: consider introducing lifetime `'missing` here
+ |
+LL | trait Iterable<'missing> {
+ | ++++++++++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0261`.
diff --git a/tests/ui/impl-trait/in-trait/nested-rpitit.rs b/tests/ui/impl-trait/in-trait/nested-rpitit.rs
index 360207537..65285e3a3 100644
--- a/tests/ui/impl-trait/in-trait/nested-rpitit.rs
+++ b/tests/ui/impl-trait/in-trait/nested-rpitit.rs
@@ -1,6 +1,4 @@
// check-pass
-// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
-// revisions: current next
#![feature(return_position_impl_trait_in_trait)]
#![allow(incomplete_features)]
diff --git a/tests/ui/impl-trait/in-trait/object-safety.next.stderr b/tests/ui/impl-trait/in-trait/object-safety.next.stderr
deleted file mode 100644
index 2c340a023..000000000
--- a/tests/ui/impl-trait/in-trait/object-safety.next.stderr
+++ /dev/null
@@ -1,49 +0,0 @@
-error[E0038]: the trait `Foo` cannot be made into an object
- --> $DIR/object-safety.rs:20:33
- |
-LL | let i = Box::new(42_u32) as Box<dyn Foo>;
- | ^^^^^^^^^^^^ `Foo` cannot be made into an object
- |
-note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
- --> $DIR/object-safety.rs:10:22
- |
-LL | trait Foo {
- | --- this trait cannot be made into an object...
-LL | fn baz(&self) -> impl Debug;
- | ^^^^^^^^^^ ...because method `baz` references an `impl Trait` type in its return type
- = help: consider moving `baz` to another trait
-
-error[E0038]: the trait `Foo` cannot be made into an object
- --> $DIR/object-safety.rs:23:13
- |
-LL | let s = i.baz();
- | ^^^^^^^ `Foo` cannot be made into an object
- |
-note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
- --> $DIR/object-safety.rs:10:22
- |
-LL | trait Foo {
- | --- this trait cannot be made into an object...
-LL | fn baz(&self) -> impl Debug;
- | ^^^^^^^^^^ ...because method `baz` references an `impl Trait` type in its return type
- = help: consider moving `baz` to another trait
-
-error[E0038]: the trait `Foo` cannot be made into an object
- --> $DIR/object-safety.rs:20:13
- |
-LL | let i = Box::new(42_u32) as Box<dyn Foo>;
- | ^^^^^^^^^^^^^^^^ `Foo` cannot be made into an object
- |
-note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
- --> $DIR/object-safety.rs:10:22
- |
-LL | trait Foo {
- | --- this trait cannot be made into an object...
-LL | fn baz(&self) -> impl Debug;
- | ^^^^^^^^^^ ...because method `baz` references an `impl Trait` type in its return type
- = help: consider moving `baz` to another trait
- = note: required for the cast from `Box<u32>` to `Box<dyn Foo>`
-
-error: aborting due to 3 previous errors
-
-For more information about this error, try `rustc --explain E0038`.
diff --git a/tests/ui/impl-trait/in-trait/object-safety.rs b/tests/ui/impl-trait/in-trait/object-safety.rs
index 016a0aaae..dd35b9a2d 100644
--- a/tests/ui/impl-trait/in-trait/object-safety.rs
+++ b/tests/ui/impl-trait/in-trait/object-safety.rs
@@ -1,6 +1,3 @@
-// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
-// revisions: current next
-
#![feature(return_position_impl_trait_in_trait)]
#![allow(incomplete_features)]
diff --git a/tests/ui/impl-trait/in-trait/object-safety.current.stderr b/tests/ui/impl-trait/in-trait/object-safety.stderr
index 2c340a023..4a3b3b114 100644
--- a/tests/ui/impl-trait/in-trait/object-safety.current.stderr
+++ b/tests/ui/impl-trait/in-trait/object-safety.stderr
@@ -1,11 +1,11 @@
error[E0038]: the trait `Foo` cannot be made into an object
- --> $DIR/object-safety.rs:20:33
+ --> $DIR/object-safety.rs:17:33
|
LL | let i = Box::new(42_u32) as Box<dyn Foo>;
| ^^^^^^^^^^^^ `Foo` cannot be made into an object
|
note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
- --> $DIR/object-safety.rs:10:22
+ --> $DIR/object-safety.rs:7:22
|
LL | trait Foo {
| --- this trait cannot be made into an object...
@@ -14,13 +14,13 @@ LL | fn baz(&self) -> impl Debug;
= help: consider moving `baz` to another trait
error[E0038]: the trait `Foo` cannot be made into an object
- --> $DIR/object-safety.rs:23:13
+ --> $DIR/object-safety.rs:20:13
|
LL | let s = i.baz();
| ^^^^^^^ `Foo` cannot be made into an object
|
note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
- --> $DIR/object-safety.rs:10:22
+ --> $DIR/object-safety.rs:7:22
|
LL | trait Foo {
| --- this trait cannot be made into an object...
@@ -29,13 +29,13 @@ LL | fn baz(&self) -> impl Debug;
= help: consider moving `baz` to another trait
error[E0038]: the trait `Foo` cannot be made into an object
- --> $DIR/object-safety.rs:20:13
+ --> $DIR/object-safety.rs:17:13
|
LL | let i = Box::new(42_u32) as Box<dyn Foo>;
| ^^^^^^^^^^^^^^^^ `Foo` cannot be made into an object
|
note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
- --> $DIR/object-safety.rs:10:22
+ --> $DIR/object-safety.rs:7:22
|
LL | trait Foo {
| --- this trait cannot be made into an object...
diff --git a/tests/ui/impl-trait/in-trait/opaque-in-impl-is-opaque.next.stderr b/tests/ui/impl-trait/in-trait/opaque-in-impl-is-opaque.next.stderr
deleted file mode 100644
index a57653b2c..000000000
--- a/tests/ui/impl-trait/in-trait/opaque-in-impl-is-opaque.next.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-error[E0308]: mismatched types
- --> $DIR/opaque-in-impl-is-opaque.rs:20:19
- |
-LL | fn bar(&self) -> impl Display {
- | ------------ the found opaque type
-...
-LL | let x: &str = ().bar();
- | ---- ^^^^^^^^ expected `&str`, found opaque type
- | |
- | expected due to this
- |
- = note: expected reference `&str`
- found opaque type `impl std::fmt::Display`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/impl-trait/in-trait/opaque-in-impl-is-opaque.rs b/tests/ui/impl-trait/in-trait/opaque-in-impl-is-opaque.rs
index c07ece15a..3ac264e8e 100644
--- a/tests/ui/impl-trait/in-trait/opaque-in-impl-is-opaque.rs
+++ b/tests/ui/impl-trait/in-trait/opaque-in-impl-is-opaque.rs
@@ -1,6 +1,3 @@
-// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
-// revisions: current next
-
#![feature(return_position_impl_trait_in_trait)]
#![allow(incomplete_features)]
diff --git a/tests/ui/impl-trait/in-trait/opaque-in-impl-is-opaque.current.stderr b/tests/ui/impl-trait/in-trait/opaque-in-impl-is-opaque.stderr
index a57653b2c..15edda483 100644
--- a/tests/ui/impl-trait/in-trait/opaque-in-impl-is-opaque.current.stderr
+++ b/tests/ui/impl-trait/in-trait/opaque-in-impl-is-opaque.stderr
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
- --> $DIR/opaque-in-impl-is-opaque.rs:20:19
+ --> $DIR/opaque-in-impl-is-opaque.rs:17:19
|
LL | fn bar(&self) -> impl Display {
| ------------ the found opaque type
diff --git a/tests/ui/impl-trait/in-trait/opaque-in-impl.rs b/tests/ui/impl-trait/in-trait/opaque-in-impl.rs
index f48d9fa26..2e0662969 100644
--- a/tests/ui/impl-trait/in-trait/opaque-in-impl.rs
+++ b/tests/ui/impl-trait/in-trait/opaque-in-impl.rs
@@ -1,6 +1,4 @@
// check-pass
-// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
-// revisions: current next
#![feature(return_position_impl_trait_in_trait)]
#![allow(incomplete_features)]
diff --git a/tests/ui/impl-trait/in-trait/outlives-in-nested-rpit.rs b/tests/ui/impl-trait/in-trait/outlives-in-nested-rpit.rs
new file mode 100644
index 000000000..6330242ce
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/outlives-in-nested-rpit.rs
@@ -0,0 +1,11 @@
+// check-pass
+
+#![feature(return_position_impl_trait_in_trait)]
+
+trait Foo {
+ fn early<'a, T: 'a>(x: &'a T) -> impl Iterator<Item = impl Into<&'a T>>;
+
+ fn late<'a, T>(x: &'a T) -> impl Iterator<Item = impl Into<&'a T>>;
+}
+
+fn main() {}
diff --git a/tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.current.stderr b/tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.current.stderr
deleted file mode 100644
index ff30103b7..000000000
--- a/tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.current.stderr
+++ /dev/null
@@ -1,16 +0,0 @@
-error[E0277]: the trait bound `impl Foo<u8>: Foo<char>` is not satisfied
- --> $DIR/return-dont-satisfy-bounds.rs:13:34
- |
-LL | fn foo<F2: Foo<u8>>(self) -> impl Foo<u8> {
- | ^^^^^^^^^^^^ the trait `Foo<char>` is not implemented for `impl Foo<u8>`
- |
- = help: the trait `Foo<char>` is implemented for `Bar`
-note: required by a bound in `Foo::foo::{opaque#0}`
- --> $DIR/return-dont-satisfy-bounds.rs:7:30
- |
-LL | fn foo<F2>(self) -> impl Foo<T>;
- | ^^^^^^ required by this bound in `Foo::foo::{opaque#0}`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.rs b/tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.rs
index 65528f212..5d9a224cc 100644
--- a/tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.rs
+++ b/tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.rs
@@ -1,6 +1,3 @@
-// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
-// revisions: current next
-
#![feature(return_position_impl_trait_in_trait)]
trait Foo<T> {
diff --git a/tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.next.stderr b/tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.stderr
index 7c7f7feaa..668fc6cbe 100644
--- a/tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.next.stderr
+++ b/tests/ui/impl-trait/in-trait/return-dont-satisfy-bounds.stderr
@@ -1,12 +1,12 @@
error[E0277]: the trait bound `impl Foo<u8>: Foo<char>` is not satisfied
- --> $DIR/return-dont-satisfy-bounds.rs:13:34
+ --> $DIR/return-dont-satisfy-bounds.rs:10:34
|
LL | fn foo<F2: Foo<u8>>(self) -> impl Foo<u8> {
| ^^^^^^^^^^^^ the trait `Foo<char>` is not implemented for `impl Foo<u8>`
|
= help: the trait `Foo<char>` is implemented for `Bar`
note: required by a bound in `Foo::{opaque#0}`
- --> $DIR/return-dont-satisfy-bounds.rs:7:30
+ --> $DIR/return-dont-satisfy-bounds.rs:4:30
|
LL | fn foo<F2>(self) -> impl Foo<T>;
| ^^^^^^ required by this bound in `Foo::{opaque#0}`
diff --git a/tests/ui/impl-trait/in-trait/reveal.rs b/tests/ui/impl-trait/in-trait/reveal.rs
index 1f42ec744..d6ede1cc4 100644
--- a/tests/ui/impl-trait/in-trait/reveal.rs
+++ b/tests/ui/impl-trait/in-trait/reveal.rs
@@ -1,6 +1,4 @@
// check-pass
-// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
-// revisions: current next
#![feature(return_position_impl_trait_in_trait)]
#![allow(incomplete_features)]
diff --git a/tests/ui/impl-trait/in-trait/rpitit-shadowed-by-missing-adt.rs b/tests/ui/impl-trait/in-trait/rpitit-shadowed-by-missing-adt.rs
new file mode 100644
index 000000000..7682884f8
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/rpitit-shadowed-by-missing-adt.rs
@@ -0,0 +1,18 @@
+// issue: 113903
+
+#![feature(return_position_impl_trait_in_trait)]
+
+use std::ops::Deref;
+
+pub trait Tr {
+ fn w() -> impl Deref<Target = Missing<impl Sized>>;
+ //~^ ERROR cannot find type `Missing` in this scope
+}
+
+impl Tr for () {
+ fn w() -> &'static () {
+ &()
+ }
+}
+
+fn main() {}
diff --git a/tests/ui/impl-trait/in-trait/rpitit-shadowed-by-missing-adt.stderr b/tests/ui/impl-trait/in-trait/rpitit-shadowed-by-missing-adt.stderr
new file mode 100644
index 000000000..6e4a5bb5d
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/rpitit-shadowed-by-missing-adt.stderr
@@ -0,0 +1,9 @@
+error[E0412]: cannot find type `Missing` in this scope
+ --> $DIR/rpitit-shadowed-by-missing-adt.rs:8:35
+ |
+LL | fn w() -> impl Deref<Target = Missing<impl Sized>>;
+ | ^^^^^^^ not found in this scope
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0412`.
diff --git a/tests/ui/impl-trait/in-trait/signature-mismatch.next.stderr b/tests/ui/impl-trait/in-trait/signature-mismatch.next.stderr
deleted file mode 100644
index 8c9dd4031..000000000
--- a/tests/ui/impl-trait/in-trait/signature-mismatch.next.stderr
+++ /dev/null
@@ -1,61 +0,0 @@
-error: return type captures more lifetimes than trait definition
- --> $DIR/signature-mismatch.rs:36:47
- |
-LL | fn async_fn<'a>(&self, buff: &'a [u8]) -> impl Future<Output = Vec<u8>> + 'a {
- | -- this lifetime was captured ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
-note: hidden type must only reference lifetimes captured by this impl trait
- --> $DIR/signature-mismatch.rs:17:40
- |
-LL | fn async_fn(&self, buff: &[u8]) -> impl Future<Output = Vec<u8>>;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = note: hidden type inferred to be `impl Future<Output = Vec<u8>> + 'a`
-
-error: return type captures more lifetimes than trait definition
- --> $DIR/signature-mismatch.rs:41:57
- |
-LL | fn async_fn_early<'a: 'a>(&self, buff: &'a [u8]) -> impl Future<Output = Vec<u8>> + 'a {
- | -- this lifetime was captured ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
-note: hidden type must only reference lifetimes captured by this impl trait
- --> $DIR/signature-mismatch.rs:18:57
- |
-LL | fn async_fn_early<'a: 'a>(&self, buff: &'a [u8]) -> impl Future<Output = Vec<u8>>;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = note: hidden type inferred to be `impl Future<Output = Vec<u8>> + 'a`
-
-error: return type captures more lifetimes than trait definition
- --> $DIR/signature-mismatch.rs:49:10
- |
-LL | fn async_fn_multiple<'a, 'b>(
- | -- this lifetime was captured
-...
-LL | ) -> impl Future<Output = Vec<u8>> + Captures2<'a, 'b> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
-note: hidden type must only reference lifetimes captured by this impl trait
- --> $DIR/signature-mismatch.rs:20:12
- |
-LL | -> impl Future<Output = Vec<u8>> + Captures<'a>;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = note: hidden type inferred to be `impl Future<Output = Vec<u8>> + Captures2<'a, 'b>`
-
-error[E0309]: the parameter type `T` may not live long enough
- --> $DIR/signature-mismatch.rs:58:10
- |
-LL | ) -> impl Future<Output = Vec<u8>> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `impl Future<Output = Vec<u8>>` will meet its required lifetime bounds...
- |
-note: ...that is required by this bound
- --> $DIR/signature-mismatch.rs:25:42
- |
-LL | ) -> impl Future<Output = Vec<u8>> + 'a;
- | ^^
-help: consider adding an explicit lifetime bound...
- |
-LL | fn async_fn_reduce_outlive<'a, 'b, T: 'a>(
- | ++++
-
-error: aborting due to 4 previous errors
-
-For more information about this error, try `rustc --explain E0309`.
diff --git a/tests/ui/impl-trait/in-trait/signature-mismatch.rs b/tests/ui/impl-trait/in-trait/signature-mismatch.rs
index 23dd71ace..1d63a6f3c 100644
--- a/tests/ui/impl-trait/in-trait/signature-mismatch.rs
+++ b/tests/ui/impl-trait/in-trait/signature-mismatch.rs
@@ -1,6 +1,4 @@
// edition:2021
-// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
-// revisions: current next
#![feature(return_position_impl_trait_in_trait)]
#![allow(incomplete_features)]
diff --git a/tests/ui/impl-trait/in-trait/signature-mismatch.current.stderr b/tests/ui/impl-trait/in-trait/signature-mismatch.stderr
index 8c9dd4031..616f1ac35 100644
--- a/tests/ui/impl-trait/in-trait/signature-mismatch.current.stderr
+++ b/tests/ui/impl-trait/in-trait/signature-mismatch.stderr
@@ -1,31 +1,31 @@
error: return type captures more lifetimes than trait definition
- --> $DIR/signature-mismatch.rs:36:47
+ --> $DIR/signature-mismatch.rs:34:47
|
LL | fn async_fn<'a>(&self, buff: &'a [u8]) -> impl Future<Output = Vec<u8>> + 'a {
| -- this lifetime was captured ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: hidden type must only reference lifetimes captured by this impl trait
- --> $DIR/signature-mismatch.rs:17:40
+ --> $DIR/signature-mismatch.rs:15:40
|
LL | fn async_fn(&self, buff: &[u8]) -> impl Future<Output = Vec<u8>>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: hidden type inferred to be `impl Future<Output = Vec<u8>> + 'a`
error: return type captures more lifetimes than trait definition
- --> $DIR/signature-mismatch.rs:41:57
+ --> $DIR/signature-mismatch.rs:39:57
|
LL | fn async_fn_early<'a: 'a>(&self, buff: &'a [u8]) -> impl Future<Output = Vec<u8>> + 'a {
| -- this lifetime was captured ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: hidden type must only reference lifetimes captured by this impl trait
- --> $DIR/signature-mismatch.rs:18:57
+ --> $DIR/signature-mismatch.rs:16:57
|
LL | fn async_fn_early<'a: 'a>(&self, buff: &'a [u8]) -> impl Future<Output = Vec<u8>>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: hidden type inferred to be `impl Future<Output = Vec<u8>> + 'a`
error: return type captures more lifetimes than trait definition
- --> $DIR/signature-mismatch.rs:49:10
+ --> $DIR/signature-mismatch.rs:47:10
|
LL | fn async_fn_multiple<'a, 'b>(
| -- this lifetime was captured
@@ -34,20 +34,20 @@ LL | ) -> impl Future<Output = Vec<u8>> + Captures2<'a, 'b> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: hidden type must only reference lifetimes captured by this impl trait
- --> $DIR/signature-mismatch.rs:20:12
+ --> $DIR/signature-mismatch.rs:18:12
|
LL | -> impl Future<Output = Vec<u8>> + Captures<'a>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: hidden type inferred to be `impl Future<Output = Vec<u8>> + Captures2<'a, 'b>`
error[E0309]: the parameter type `T` may not live long enough
- --> $DIR/signature-mismatch.rs:58:10
+ --> $DIR/signature-mismatch.rs:56:10
|
LL | ) -> impl Future<Output = Vec<u8>> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `impl Future<Output = Vec<u8>>` will meet its required lifetime bounds...
|
note: ...that is required by this bound
- --> $DIR/signature-mismatch.rs:25:42
+ --> $DIR/signature-mismatch.rs:23:42
|
LL | ) -> impl Future<Output = Vec<u8>> + 'a;
| ^^
diff --git a/tests/ui/impl-trait/in-trait/specialization-broken.next.stderr b/tests/ui/impl-trait/in-trait/specialization-broken.next.stderr
deleted file mode 100644
index f48e7a1ed..000000000
--- a/tests/ui/impl-trait/in-trait/specialization-broken.next.stderr
+++ /dev/null
@@ -1,31 +0,0 @@
-error[E0053]: method `bar` has an incompatible type for trait
- --> $DIR/specialization-broken.rs:19:22
- |
-LL | default impl<U> Foo for U
- | - this type parameter
-...
-LL | fn bar(&self) -> U {
- | ^
- | |
- | expected associated type, found type parameter `U`
- | help: change the output type to match the trait: `impl Sized`
- |
-note: type in trait
- --> $DIR/specialization-broken.rs:12:22
- |
-LL | fn bar(&self) -> impl Sized;
- | ^^^^^^^^^^
- = note: expected signature `fn(&U) -> impl Sized`
- found signature `fn(&U) -> U`
-
-error: method with return-position `impl Trait` in trait cannot be specialized
- --> $DIR/specialization-broken.rs:19:5
- |
-LL | fn bar(&self) -> U {
- | ^^^^^^^^^^^^^^^^^^
- |
- = note: specialization behaves in inconsistent and surprising ways with `#![feature(return_position_impl_trait_in_trait)]`, and for now is disallowed
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0053`.
diff --git a/tests/ui/impl-trait/in-trait/specialization-broken.rs b/tests/ui/impl-trait/in-trait/specialization-broken.rs
index 658d07097..2fcffdf3f 100644
--- a/tests/ui/impl-trait/in-trait/specialization-broken.rs
+++ b/tests/ui/impl-trait/in-trait/specialization-broken.rs
@@ -1,6 +1,3 @@
-// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
-// revisions: current next
-
// FIXME(compiler-errors): I'm not exactly sure if this is expected to pass or not.
// But we fixed an ICE anyways.
diff --git a/tests/ui/impl-trait/in-trait/specialization-broken.current.stderr b/tests/ui/impl-trait/in-trait/specialization-broken.stderr
index f48e7a1ed..dc621d6b8 100644
--- a/tests/ui/impl-trait/in-trait/specialization-broken.current.stderr
+++ b/tests/ui/impl-trait/in-trait/specialization-broken.stderr
@@ -1,5 +1,5 @@
error[E0053]: method `bar` has an incompatible type for trait
- --> $DIR/specialization-broken.rs:19:22
+ --> $DIR/specialization-broken.rs:16:22
|
LL | default impl<U> Foo for U
| - this type parameter
@@ -11,7 +11,7 @@ LL | fn bar(&self) -> U {
| help: change the output type to match the trait: `impl Sized`
|
note: type in trait
- --> $DIR/specialization-broken.rs:12:22
+ --> $DIR/specialization-broken.rs:9:22
|
LL | fn bar(&self) -> impl Sized;
| ^^^^^^^^^^
@@ -19,7 +19,7 @@ LL | fn bar(&self) -> impl Sized;
found signature `fn(&U) -> U`
error: method with return-position `impl Trait` in trait cannot be specialized
- --> $DIR/specialization-broken.rs:19:5
+ --> $DIR/specialization-broken.rs:16:5
|
LL | fn bar(&self) -> U {
| ^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/impl-trait/in-trait/specialization-substs-remap.rs b/tests/ui/impl-trait/in-trait/specialization-substs-remap.rs
index dbc5d38f1..c9ee877db 100644
--- a/tests/ui/impl-trait/in-trait/specialization-substs-remap.rs
+++ b/tests/ui/impl-trait/in-trait/specialization-substs-remap.rs
@@ -1,6 +1,4 @@
// check-pass
-// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
-// revisions: current next
#![feature(specialization)]
#![feature(return_position_impl_trait_in_trait)]
diff --git a/tests/ui/impl-trait/in-trait/success.rs b/tests/ui/impl-trait/in-trait/success.rs
index 0e69e0490..4cbe682b4 100644
--- a/tests/ui/impl-trait/in-trait/success.rs
+++ b/tests/ui/impl-trait/in-trait/success.rs
@@ -1,6 +1,4 @@
// check-pass
-// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
-// revisions: current next
#![feature(return_position_impl_trait_in_trait)]
#![allow(incomplete_features)]
diff --git a/tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.next.stderr b/tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.next.stderr
deleted file mode 100644
index 64c942705..000000000
--- a/tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.next.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0049]: method `bar` has 0 type parameters but its trait declaration has 1 type parameter
- --> $DIR/trait-more-generics-than-impl.rs:14:11
- |
-LL | fn bar<T>() -> impl Sized;
- | - expected 1 type parameter
-...
-LL | fn bar() -> impl Sized {}
- | ^ found 0 type parameters
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0049`.
diff --git a/tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.rs b/tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.rs
index c2e394a1f..0bbe50ea6 100644
--- a/tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.rs
+++ b/tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.rs
@@ -1,6 +1,3 @@
-// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
-// revisions: current next
-
#![feature(return_position_impl_trait_in_trait)]
#![allow(incomplete_features)]
diff --git a/tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.current.stderr b/tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.stderr
index 64c942705..8ff54cad9 100644
--- a/tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.current.stderr
+++ b/tests/ui/impl-trait/in-trait/trait-more-generics-than-impl.stderr
@@ -1,5 +1,5 @@
error[E0049]: method `bar` has 0 type parameters but its trait declaration has 1 type parameter
- --> $DIR/trait-more-generics-than-impl.rs:14:11
+ --> $DIR/trait-more-generics-than-impl.rs:11:11
|
LL | fn bar<T>() -> impl Sized;
| - expected 1 type parameter
diff --git a/tests/ui/impl-trait/in-trait/unconstrained-lt.next.stderr b/tests/ui/impl-trait/in-trait/unconstrained-lt.next.stderr
deleted file mode 100644
index bf088ae8b..000000000
--- a/tests/ui/impl-trait/in-trait/unconstrained-lt.next.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates
- --> $DIR/unconstrained-lt.rs:10:6
- |
-LL | impl<'a, T> Foo for T {
- | ^^ unconstrained lifetime parameter
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0207`.
diff --git a/tests/ui/impl-trait/in-trait/unconstrained-lt.rs b/tests/ui/impl-trait/in-trait/unconstrained-lt.rs
index f966be43a..07c8606f9 100644
--- a/tests/ui/impl-trait/in-trait/unconstrained-lt.rs
+++ b/tests/ui/impl-trait/in-trait/unconstrained-lt.rs
@@ -1,6 +1,3 @@
-// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
-// revisions: current next
-
#![feature(return_position_impl_trait_in_trait)]
trait Foo {
@@ -10,7 +7,9 @@ trait Foo {
impl<'a, T> Foo for T {
//~^ ERROR the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates
- fn test() -> &'a () { &() }
+ fn test() -> &'a () {
+ &()
+ }
}
fn main() {}
diff --git a/tests/ui/impl-trait/in-trait/unconstrained-lt.current.stderr b/tests/ui/impl-trait/in-trait/unconstrained-lt.stderr
index bf088ae8b..cfce35567 100644
--- a/tests/ui/impl-trait/in-trait/unconstrained-lt.current.stderr
+++ b/tests/ui/impl-trait/in-trait/unconstrained-lt.stderr
@@ -1,5 +1,5 @@
error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates
- --> $DIR/unconstrained-lt.rs:10:6
+ --> $DIR/unconstrained-lt.rs:7:6
|
LL | impl<'a, T> Foo for T {
| ^^ unconstrained lifetime parameter
diff --git a/tests/ui/impl-trait/in-trait/variances-of-gat.rs b/tests/ui/impl-trait/in-trait/variances-of-gat.rs
index 4008ece94..0d19e1ff4 100644
--- a/tests/ui/impl-trait/in-trait/variances-of-gat.rs
+++ b/tests/ui/impl-trait/in-trait/variances-of-gat.rs
@@ -1,6 +1,4 @@
// check-pass
-// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
-// revisions: current next
#![feature(return_position_impl_trait_in_trait)]
diff --git a/tests/ui/impl-trait/in-trait/wf-bounds.next.stderr b/tests/ui/impl-trait/in-trait/wf-bounds.next.stderr
deleted file mode 100644
index 74c84c012..000000000
--- a/tests/ui/impl-trait/in-trait/wf-bounds.next.stderr
+++ /dev/null
@@ -1,57 +0,0 @@
-error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
- --> $DIR/wf-bounds.rs:17:22
- |
-LL | fn nya() -> impl Wf<Vec<[u8]>>;
- | ^^^^^^^^^^^^^ doesn't have a size known at compile-time
- |
- = help: the trait `Sized` is not implemented for `[u8]`
-note: required by a bound in `Vec`
- --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
-
-error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
- --> $DIR/wf-bounds.rs:20:23
- |
-LL | fn nya2() -> impl Wf<[u8]>;
- | ^^^^^^^^ doesn't have a size known at compile-time
- |
- = help: the trait `Sized` is not implemented for `[u8]`
-note: required by a bound in `Wf`
- --> $DIR/wf-bounds.rs:10:10
- |
-LL | trait Wf<T> {
- | ^ required by this bound in `Wf`
-help: consider relaxing the implicit `Sized` restriction
- |
-LL | trait Wf<T: ?Sized> {
- | ++++++++
-
-error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
- --> $DIR/wf-bounds.rs:23:44
- |
-LL | fn nya3() -> impl Wf<(), Output = impl Wf<Vec<[u8]>>>;
- | ^^^^^^^^^^^^^ doesn't have a size known at compile-time
- |
- = help: the trait `Sized` is not implemented for `[u8]`
-note: required by a bound in `Vec`
- --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
-
-error[E0277]: `T` doesn't implement `std::fmt::Display`
- --> $DIR/wf-bounds.rs:26:26
- |
-LL | fn nya4<T>() -> impl Wf<NeedsDisplay<T>>;
- | ^^^^^^^^^^^^^^^^^^^ `T` cannot be formatted with the default formatter
- |
- = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
-note: required by a bound in `NeedsDisplay`
- --> $DIR/wf-bounds.rs:14:24
- |
-LL | struct NeedsDisplay<T: Display>(T);
- | ^^^^^^^ required by this bound in `NeedsDisplay`
-help: consider restricting type parameter `T`
- |
-LL | fn nya4<T: std::fmt::Display>() -> impl Wf<NeedsDisplay<T>>;
- | +++++++++++++++++++
-
-error: aborting due to 4 previous errors
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/impl-trait/in-trait/wf-bounds.rs b/tests/ui/impl-trait/in-trait/wf-bounds.rs
index f8c1e561d..ee873f94b 100644
--- a/tests/ui/impl-trait/in-trait/wf-bounds.rs
+++ b/tests/ui/impl-trait/in-trait/wf-bounds.rs
@@ -1,6 +1,4 @@
// issue #101663
-// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
-// revisions: current next
#![feature(return_position_impl_trait_in_trait)]
#![allow(incomplete_features)]
diff --git a/tests/ui/impl-trait/in-trait/wf-bounds.current.stderr b/tests/ui/impl-trait/in-trait/wf-bounds.stderr
index 74c84c012..4d60b1330 100644
--- a/tests/ui/impl-trait/in-trait/wf-bounds.current.stderr
+++ b/tests/ui/impl-trait/in-trait/wf-bounds.stderr
@@ -1,5 +1,5 @@
error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
- --> $DIR/wf-bounds.rs:17:22
+ --> $DIR/wf-bounds.rs:15:22
|
LL | fn nya() -> impl Wf<Vec<[u8]>>;
| ^^^^^^^^^^^^^ doesn't have a size known at compile-time
@@ -9,14 +9,14 @@ note: required by a bound in `Vec`
--> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
- --> $DIR/wf-bounds.rs:20:23
+ --> $DIR/wf-bounds.rs:18:23
|
LL | fn nya2() -> impl Wf<[u8]>;
| ^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `[u8]`
note: required by a bound in `Wf`
- --> $DIR/wf-bounds.rs:10:10
+ --> $DIR/wf-bounds.rs:8:10
|
LL | trait Wf<T> {
| ^ required by this bound in `Wf`
@@ -26,7 +26,7 @@ LL | trait Wf<T: ?Sized> {
| ++++++++
error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
- --> $DIR/wf-bounds.rs:23:44
+ --> $DIR/wf-bounds.rs:21:44
|
LL | fn nya3() -> impl Wf<(), Output = impl Wf<Vec<[u8]>>>;
| ^^^^^^^^^^^^^ doesn't have a size known at compile-time
@@ -36,21 +36,17 @@ note: required by a bound in `Vec`
--> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
error[E0277]: `T` doesn't implement `std::fmt::Display`
- --> $DIR/wf-bounds.rs:26:26
+ --> $DIR/wf-bounds.rs:24:26
|
LL | fn nya4<T>() -> impl Wf<NeedsDisplay<T>>;
| ^^^^^^^^^^^^^^^^^^^ `T` cannot be formatted with the default formatter
|
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
note: required by a bound in `NeedsDisplay`
- --> $DIR/wf-bounds.rs:14:24
+ --> $DIR/wf-bounds.rs:12:24
|
LL | struct NeedsDisplay<T: Display>(T);
| ^^^^^^^ required by this bound in `NeedsDisplay`
-help: consider restricting type parameter `T`
- |
-LL | fn nya4<T: std::fmt::Display>() -> impl Wf<NeedsDisplay<T>>;
- | +++++++++++++++++++
error: aborting due to 4 previous errors
diff --git a/tests/ui/impl-trait/in-trait/where-clause.rs b/tests/ui/impl-trait/in-trait/where-clause.rs
index 88d86e2b5..87bac519c 100644
--- a/tests/ui/impl-trait/in-trait/where-clause.rs
+++ b/tests/ui/impl-trait/in-trait/where-clause.rs
@@ -1,7 +1,5 @@
// check-pass
// edition: 2021
-// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty
-// revisions: current next
#![feature(return_position_impl_trait_in_trait)]
#![allow(incomplete_features)]