Skip to content

ICE: Out of bounds when relating regions #107419

Closed
@viichi

Description

@viichi

https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=d383ef3aefad236b54486affe9c59a27

#![feature(type_alias_impl_trait)]

use std::future::Future;
use std::io::Result;
use std::pin::Pin;

pub trait AsyncReadFrom: Sized {
    type Output<R>: Future<Output = Self>;

    fn async_read_from<R: Unpin>(r: &mut R) -> Self::Output<R>;
}

impl<T: AsyncReadFrom> AsyncReadFrom for (T,) {
    type Output<R> = impl Future<Output = Self>;

    fn async_read_from<R: Unpin>(r: &mut R) -> Self::Output<R> {
        let r = Pin::new(r);
        async move {
            while true {
                T::async_read_from(r.get_mut()).await;
            }
            loop {}
        }
    }
}

Metadata

Metadata

Assignees

Labels

A-diagnosticsArea: Messages for errors, warnings, and lintsI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions