Skip to content

Commit cc6ad45

Browse files
replaced wrong test with the correct mcve
1 parent b1ab3b7 commit cc6ad45

File tree

2 files changed

+11
-36
lines changed

2 files changed

+11
-36
lines changed

src/test/ui/generic-associated-types/bugs/issue-89008.stderr

-19
This file was deleted.

src/test/ui/generic-associated-types/bugs/issue-89008.rs renamed to src/test/ui/generic-associated-types/issue-89008.rs

+11-17
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,36 @@
1-
// check-fail
1+
// check-pass
22
// edition:2021
3-
// known-bug: #88908
4-
5-
// This should pass, but seems to run into a TAIT bug.
63

74
#![feature(type_alias_impl_trait)]
85

96
use std::future::Future;
7+
use std::marker::PhantomData;
108

119
trait Stream {
1210
type Item;
1311
}
1412

15-
struct Empty<T>(T);
16-
impl<T> Stream for Empty<T> {
17-
type Item = ();
13+
struct Empty<T> {
14+
_phantom: PhantomData<T>,
1815
}
19-
fn empty<T>() -> Empty<T> {
20-
todo!()
16+
17+
impl<T> Stream for Empty<T> {
18+
type Item = T;
2119
}
2220

2321
trait X {
2422
type LineStream<'a, Repr>: Stream<Item = Repr> where Self: 'a;
25-
26-
type LineStreamFut<'a,Repr>: Future<Output = Self::LineStream<'a, Repr>> where Self: 'a;
27-
28-
fn line_stream<'a,Repr>(&'a self) -> Self::LineStreamFut<'a,Repr>;
23+
type LineStreamFut<'a, Repr>: Future<Output = Self::LineStream<'a, Repr>> where Self: 'a;
24+
fn line_stream<'a, Repr>(&'a self) -> Self::LineStreamFut<'a, Repr>;
2925
}
3026

3127
struct Y;
3228

3329
impl X for Y {
3430
type LineStream<'a, Repr> = impl Stream<Item = Repr>;
35-
36-
type LineStreamFut<'a, Repr> = impl Future<Output = Self::LineStream<'a, Repr>> ;
37-
31+
type LineStreamFut<'a, Repr> = impl Future<Output = Self::LineStream<'a, Repr>>;
3832
fn line_stream<'a, Repr>(&'a self) -> Self::LineStreamFut<'a, Repr> {
39-
async {empty()}
33+
async { Empty { _phantom: PhantomData } }
4034
}
4135
}
4236

0 commit comments

Comments
 (0)