summaryrefslogtreecommitdiffstats
path: root/src/test/ui/generic-associated-types/bugs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/generic-associated-types/bugs/issue-86218.stderr23
-rw-r--r--src/test/ui/generic-associated-types/bugs/issue-88382.stderr4
-rw-r--r--src/test/ui/generic-associated-types/bugs/issue-89008.stderr19
-rw-r--r--src/test/ui/generic-associated-types/bugs/issue-91762.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-86218.rs (renamed from src/test/ui/generic-associated-types/bugs/issue-86218.rs)8
-rw-r--r--src/test/ui/generic-associated-types/issue-89008.rs (renamed from src/test/ui/generic-associated-types/bugs/issue-89008.rs)28
6 files changed, 17 insertions, 67 deletions
diff --git a/src/test/ui/generic-associated-types/bugs/issue-86218.stderr b/src/test/ui/generic-associated-types/bugs/issue-86218.stderr
deleted file mode 100644
index de1b464a4..000000000
--- a/src/test/ui/generic-associated-types/bugs/issue-86218.stderr
+++ /dev/null
@@ -1,23 +0,0 @@
-error[E0477]: the type `<() as Yay<&'a ()>>::InnerStream<'s>` does not fulfill the required lifetime
- --> $DIR/issue-86218.rs:22:28
- |
-LL | type InnerStream<'s> = impl Stream<Item = i32> + 's;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
-note: type must outlive the lifetime `'s` as defined here as required by this binding
- --> $DIR/issue-86218.rs:22:22
- |
-LL | type InnerStream<'s> = impl Stream<Item = i32> + 's;
- | ^^
-
-error: unconstrained opaque type
- --> $DIR/issue-86218.rs:22:28
- |
-LL | type InnerStream<'s> = impl Stream<Item = i32> + 's;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `InnerStream` must be used in combination with a concrete type within the same module
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0477`.
diff --git a/src/test/ui/generic-associated-types/bugs/issue-88382.stderr b/src/test/ui/generic-associated-types/bugs/issue-88382.stderr
index c5fd58096..a9a70bb71 100644
--- a/src/test/ui/generic-associated-types/bugs/issue-88382.stderr
+++ b/src/test/ui/generic-associated-types/bugs/issue-88382.stderr
@@ -9,8 +9,8 @@ LL | do_something(SomeImplementation(), test);
LL | fn test<'a, I: Iterable>(_: &mut I::Iterator<'a>) {}
| ------------------------------------------------- found signature defined here
|
- = note: expected function signature `for<'r> fn(&'r mut std::iter::Empty<usize>) -> _`
- found function signature `for<'a, 'r> fn(&'r mut <_ as Iterable>::Iterator<'a>) -> _`
+ = note: expected function signature `for<'a> fn(&'a mut std::iter::Empty<usize>) -> _`
+ found function signature `for<'a, 'b> fn(&'b mut <_ as Iterable>::Iterator<'a>) -> _`
note: required by a bound in `do_something`
--> $DIR/issue-88382.rs:20:48
|
diff --git a/src/test/ui/generic-associated-types/bugs/issue-89008.stderr b/src/test/ui/generic-associated-types/bugs/issue-89008.stderr
deleted file mode 100644
index 3f72734ef..000000000
--- a/src/test/ui/generic-associated-types/bugs/issue-89008.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error[E0271]: type mismatch resolving `<Empty<_> as Stream>::Item == Repr`
- --> $DIR/issue-89008.rs:38:43
- |
-LL | fn line_stream<'a, Repr>(&'a self) -> Self::LineStreamFut<'a, Repr> {
- | ---- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type mismatch resolving `<Empty<_> as Stream>::Item == Repr`
- | |
- | this type parameter
- |
-note: expected this to be `()`
- --> $DIR/issue-89008.rs:17:17
- |
-LL | type Item = ();
- | ^^
- = note: expected unit type `()`
- found type parameter `Repr`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0271`.
diff --git a/src/test/ui/generic-associated-types/bugs/issue-91762.rs b/src/test/ui/generic-associated-types/bugs/issue-91762.rs
index 796935cc0..dec668bec 100644
--- a/src/test/ui/generic-associated-types/bugs/issue-91762.rs
+++ b/src/test/ui/generic-associated-types/bugs/issue-91762.rs
@@ -1,7 +1,7 @@
// check-fail
// known-bug
-// We almost certaintly want this to pass, but
+// We almost certainly want this to pass, but
// it's particularly difficult currently, because we need a way of specifying
// that `<Self::Base as Functor>::With<T> = Self` without using that when we have
// a `U`. See `https://github.com/rust-lang/rust/pull/92728` for a (hacky)
diff --git a/src/test/ui/generic-associated-types/bugs/issue-86218.rs b/src/test/ui/generic-associated-types/issue-86218.rs
index 3a2d758e7..b2c3071f0 100644
--- a/src/test/ui/generic-associated-types/bugs/issue-86218.rs
+++ b/src/test/ui/generic-associated-types/issue-86218.rs
@@ -1,7 +1,4 @@
-// check-fail
-// known-bug: #86218
-
-// This should pass, but seems to run into a TAIT issue.
+// check-pass
#![feature(type_alias_impl_trait)]
@@ -20,7 +17,8 @@ trait Yay<AdditionalValue> {
impl<'a> Yay<&'a ()> for () {
type InnerStream<'s> = impl Stream<Item = i32> + 's;
- fn foo<'s>() -> Self::InnerStream<'s> { todo!() }
+ //^ ERROR does not fulfill the required lifetime
+ fn foo<'s>() -> Self::InnerStream<'s> { () }
}
fn main() {}
diff --git a/src/test/ui/generic-associated-types/bugs/issue-89008.rs b/src/test/ui/generic-associated-types/issue-89008.rs
index 012aa8df2..669dbafb5 100644
--- a/src/test/ui/generic-associated-types/bugs/issue-89008.rs
+++ b/src/test/ui/generic-associated-types/issue-89008.rs
@@ -1,42 +1,36 @@
-// check-fail
+// check-pass
// edition:2021
-// known-bug: #88908
-
-// This should pass, but seems to run into a TAIT bug.
#![feature(type_alias_impl_trait)]
use std::future::Future;
+use std::marker::PhantomData;
trait Stream {
type Item;
}
-struct Empty<T>(T);
-impl<T> Stream for Empty<T> {
- type Item = ();
+struct Empty<T> {
+ _phantom: PhantomData<T>,
}
-fn empty<T>() -> Empty<T> {
- todo!()
+
+impl<T> Stream for Empty<T> {
+ type Item = T;
}
trait X {
type LineStream<'a, Repr>: Stream<Item = Repr> where Self: 'a;
-
- type LineStreamFut<'a,Repr>: Future<Output = Self::LineStream<'a, Repr>> where Self: 'a;
-
- fn line_stream<'a,Repr>(&'a self) -> Self::LineStreamFut<'a,Repr>;
+ type LineStreamFut<'a, Repr>: Future<Output = Self::LineStream<'a, Repr>> where Self: 'a;
+ fn line_stream<'a, Repr>(&'a self) -> Self::LineStreamFut<'a, Repr>;
}
struct Y;
impl X for Y {
type LineStream<'a, Repr> = impl Stream<Item = Repr>;
-
- type LineStreamFut<'a, Repr> = impl Future<Output = Self::LineStream<'a, Repr>> ;
-
+ type LineStreamFut<'a, Repr> = impl Future<Output = Self::LineStream<'a, Repr>>;
fn line_stream<'a, Repr>(&'a self) -> Self::LineStreamFut<'a, Repr> {
- async {empty()}
+ async { Empty { _phantom: PhantomData } }
}
}