summaryrefslogtreecommitdiffstats
path: root/tests/ui/generic-associated-types
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/generic-associated-types')
-rw-r--r--tests/ui/generic-associated-types/bugs/issue-100013.stderr8
-rw-r--r--tests/ui/generic-associated-types/gat-bounds-normalize-pred.rs17
-rw-r--r--tests/ui/generic-associated-types/issue-86218-2.rs6
-rw-r--r--tests/ui/generic-associated-types/issue-86218.rs6
-rw-r--r--tests/ui/generic-associated-types/issue-87258_a.rs2
-rw-r--r--tests/ui/generic-associated-types/issue-87429-associated-type-default.stderr3
-rw-r--r--tests/ui/generic-associated-types/issue-87429-specialization.stderr3
-rw-r--r--tests/ui/generic-associated-types/issue-88595.rs3
-rw-r--r--tests/ui/generic-associated-types/issue-88595.stderr4
-rw-r--r--tests/ui/generic-associated-types/issue-89008.rs2
-rw-r--r--tests/ui/generic-associated-types/issue-90014.rs6
-rw-r--r--tests/ui/generic-associated-types/issue-90014.stderr6
12 files changed, 46 insertions, 20 deletions
diff --git a/tests/ui/generic-associated-types/bugs/issue-100013.stderr b/tests/ui/generic-associated-types/bugs/issue-100013.stderr
index 9db124a81..86dbad84d 100644
--- a/tests/ui/generic-associated-types/bugs/issue-100013.stderr
+++ b/tests/ui/generic-associated-types/bugs/issue-100013.stderr
@@ -28,12 +28,12 @@ LL | | async {}.await; // a yield point
LL | | }
| |_____^
|
-note: the lifetime defined here...
+note: the lifetime `'b` defined here...
--> $DIR/issue-100013.rs:21:14
|
LL | fn call2<'a, 'b, I: FutureIterator>() -> impl Send {
| ^^
-note: ...must outlive the lifetime defined here
+note: ...must outlive the lifetime `'a` defined here
--> $DIR/issue-100013.rs:21:10
|
LL | fn call2<'a, 'b, I: FutureIterator>() -> impl Send {
@@ -62,12 +62,12 @@ LL | | async {}.await; // a yield point
LL | | }
| |_____^
|
-note: the lifetime defined here...
+note: the lifetime `'b` defined here...
--> $DIR/issue-100013.rs:28:18
|
LL | fn call3<'a: 'b, 'b, I: FutureIterator>() -> impl Send {
| ^^
-note: ...must outlive the lifetime defined here
+note: ...must outlive the lifetime `'a` defined here
--> $DIR/issue-100013.rs:28:10
|
LL | fn call3<'a: 'b, 'b, I: FutureIterator>() -> impl Send {
diff --git a/tests/ui/generic-associated-types/gat-bounds-normalize-pred.rs b/tests/ui/generic-associated-types/gat-bounds-normalize-pred.rs
new file mode 100644
index 000000000..b43f98228
--- /dev/null
+++ b/tests/ui/generic-associated-types/gat-bounds-normalize-pred.rs
@@ -0,0 +1,17 @@
+// check-pass
+
+trait Foo {
+ type Assoc<T>: PartialEq<Self::Assoc<i32>>;
+}
+
+impl Foo for () {
+ type Assoc<T> = Wrapper<T>;
+}
+
+struct Wrapper<T>(T);
+
+impl<T> PartialEq<Wrapper<i32>> for Wrapper<T> {
+ fn eq(&self, _other: &Wrapper<i32>) -> bool { true }
+}
+
+fn main() {}
diff --git a/tests/ui/generic-associated-types/issue-86218-2.rs b/tests/ui/generic-associated-types/issue-86218-2.rs
index 63c839ea8..8a5e4a0f3 100644
--- a/tests/ui/generic-associated-types/issue-86218-2.rs
+++ b/tests/ui/generic-associated-types/issue-86218-2.rs
@@ -1,6 +1,6 @@
// check-pass
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
pub trait Stream {
type Item;
@@ -17,7 +17,9 @@ trait Yay<AdditionalValue> {
impl<T> Yay<T> for () {
type InnerStream<'s> = impl Stream<Item = i32> + 's;
- fn foo<'s>() -> Self::InnerStream<'s> { () }
+ fn foo<'s>() -> Self::InnerStream<'s> {
+ ()
+ }
}
fn main() {}
diff --git a/tests/ui/generic-associated-types/issue-86218.rs b/tests/ui/generic-associated-types/issue-86218.rs
index b2c3071f0..61cfdd35a 100644
--- a/tests/ui/generic-associated-types/issue-86218.rs
+++ b/tests/ui/generic-associated-types/issue-86218.rs
@@ -1,6 +1,6 @@
// check-pass
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
pub trait Stream {
type Item;
@@ -18,7 +18,9 @@ trait Yay<AdditionalValue> {
impl<'a> Yay<&'a ()> for () {
type InnerStream<'s> = impl Stream<Item = i32> + 's;
//^ ERROR does not fulfill the required lifetime
- fn foo<'s>() -> Self::InnerStream<'s> { () }
+ fn foo<'s>() -> Self::InnerStream<'s> {
+ ()
+ }
}
fn main() {}
diff --git a/tests/ui/generic-associated-types/issue-87258_a.rs b/tests/ui/generic-associated-types/issue-87258_a.rs
index 9ab683d3d..6f737b21f 100644
--- a/tests/ui/generic-associated-types/issue-87258_a.rs
+++ b/tests/ui/generic-associated-types/issue-87258_a.rs
@@ -1,4 +1,4 @@
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
// See https://github.com/rust-lang/rust/issues/87258#issuecomment-883293367
diff --git a/tests/ui/generic-associated-types/issue-87429-associated-type-default.stderr b/tests/ui/generic-associated-types/issue-87429-associated-type-default.stderr
index b1abe012b..a44bb6993 100644
--- a/tests/ui/generic-associated-types/issue-87429-associated-type-default.stderr
+++ b/tests/ui/generic-associated-types/issue-87429-associated-type-default.stderr
@@ -12,7 +12,8 @@ LL | type Member<'a>: for<'b> PartialEq<Self::Member<'b>> = Foo;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Family2::Member`
help: consider annotating `Foo` with `#[derive(PartialEq)]`
|
-LL | #[derive(PartialEq)]
+LL + #[derive(PartialEq)]
+LL | struct Foo;
|
error: aborting due to previous error
diff --git a/tests/ui/generic-associated-types/issue-87429-specialization.stderr b/tests/ui/generic-associated-types/issue-87429-specialization.stderr
index 11c4ebf60..c259c89a7 100644
--- a/tests/ui/generic-associated-types/issue-87429-specialization.stderr
+++ b/tests/ui/generic-associated-types/issue-87429-specialization.stderr
@@ -22,7 +22,8 @@ LL | type Member<'a>: for<'b> PartialEq<Self::Member<'b>>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Family::Member`
help: consider annotating `Foo` with `#[derive(PartialEq)]`
|
-LL | #[derive(PartialEq)]
+LL + #[derive(PartialEq)]
+LL | struct Foo;
|
error: aborting due to previous error; 1 warning emitted
diff --git a/tests/ui/generic-associated-types/issue-88595.rs b/tests/ui/generic-associated-types/issue-88595.rs
index 24641ee1f..5a40a6129 100644
--- a/tests/ui/generic-associated-types/issue-88595.rs
+++ b/tests/ui/generic-associated-types/issue-88595.rs
@@ -1,7 +1,8 @@
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
fn main() {}
+#[rustfmt::skip]
trait A<'a> {
type B<'b>: Clone
// FIXME(generic_associated_types): Remove one of the below bounds
diff --git a/tests/ui/generic-associated-types/issue-88595.stderr b/tests/ui/generic-associated-types/issue-88595.stderr
index bcefc8066..79d3479af 100644
--- a/tests/ui/generic-associated-types/issue-88595.stderr
+++ b/tests/ui/generic-associated-types/issue-88595.stderr
@@ -1,11 +1,11 @@
error: non-defining opaque type use in defining scope
- --> $DIR/issue-88595.rs:20:35
+ --> $DIR/issue-88595.rs:21:35
|
LL | fn a(&'a self) -> Self::B<'a> {}
| ^^
|
note: lifetime used multiple times
- --> $DIR/issue-88595.rs:17:6
+ --> $DIR/issue-88595.rs:18:6
|
LL | impl<'a> A<'a> for C {
| ^^
diff --git a/tests/ui/generic-associated-types/issue-89008.rs b/tests/ui/generic-associated-types/issue-89008.rs
index 669dbafb5..94b07e674 100644
--- a/tests/ui/generic-associated-types/issue-89008.rs
+++ b/tests/ui/generic-associated-types/issue-89008.rs
@@ -1,7 +1,7 @@
// check-pass
// edition:2021
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
use std::future::Future;
use std::marker::PhantomData;
diff --git a/tests/ui/generic-associated-types/issue-90014.rs b/tests/ui/generic-associated-types/issue-90014.rs
index 55db95a6d..c4d762796 100644
--- a/tests/ui/generic-associated-types/issue-90014.rs
+++ b/tests/ui/generic-associated-types/issue-90014.rs
@@ -1,11 +1,13 @@
// edition:2018
-#![feature(type_alias_impl_trait)]
+#![feature(impl_trait_in_assoc_type)]
use std::future::Future;
trait MakeFut {
- type Fut<'a> where Self: 'a;
+ type Fut<'a>
+ where
+ Self: 'a;
fn make_fut<'a>(&'a self) -> Self::Fut<'a>;
}
diff --git a/tests/ui/generic-associated-types/issue-90014.stderr b/tests/ui/generic-associated-types/issue-90014.stderr
index b4b1bc7da..0d49398ca 100644
--- a/tests/ui/generic-associated-types/issue-90014.stderr
+++ b/tests/ui/generic-associated-types/issue-90014.stderr
@@ -1,14 +1,14 @@
error[E0477]: the type `&mut ()` does not fulfill the required lifetime
- --> $DIR/issue-90014.rs:13:20
+ --> $DIR/issue-90014.rs:15:20
|
-LL | type Fut<'a> where Self: 'a;
+LL | type Fut<'a>
| ------------ definition of `Fut` from trait
...
LL | type Fut<'a> = impl Future<Output = ()>;
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
note: type must outlive the lifetime `'a` as defined here
- --> $DIR/issue-90014.rs:13:14
+ --> $DIR/issue-90014.rs:15:14
|
LL | type Fut<'a> = impl Future<Output = ()>;
| ^^