Skip to content

Replaced wrong test with the correct mcve #103335

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions src/test/ui/generic-associated-types/bugs/issue-89008.stderr

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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 } }
}
}

Expand Down