Skip to content

ICE: Out of bounds when relating regions #107419

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

Closed
viichi opened this issue Jan 28, 2023 · 2 comments · Fixed by #107422
Closed

ICE: Out of bounds when relating regions #107419

viichi opened this issue Jan 28, 2023 · 2 comments · Fixed by #107422
Assignees
Labels
A-diagnostics Area: Messages for errors, warnings, and lints I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@viichi
Copy link

viichi commented Jan 28, 2023

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 {}
        }
    }
}
@clubby789
Copy link
Contributor

searched nightlies: from nightly-2023-01-27 to nightly-2023-01-28
regressed nightly: nightly-2023-01-28
searched commit range: d7948c8...ef98292
regressed commit: 7919ef0

bisected with cargo-bisect-rustc v0.6.5

Host triple: x86_64-unknown-linux-gnu
Reproduce with:

cargo bisect-rustc --start 2023-01-27 --end 2023-01-28  --regress ice 

@rustbot label +I-ICE +F-type_alias_impl_trait

@rustbot rustbot added F-type_alias_impl_trait `#[feature(type_alias_impl_trait)]` I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ labels Jan 28, 2023
@Noratrieb Noratrieb changed the title compiler crashed! ICE: Out of bounds when relating regions Jan 28, 2023
@Noratrieb Noratrieb added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jan 28, 2023
@Noratrieb Noratrieb self-assigned this Jan 28, 2023
@Noratrieb Noratrieb added A-diagnostics Area: Messages for errors, warnings, and lints and removed F-type_alias_impl_trait `#[feature(type_alias_impl_trait)]` labels Jan 28, 2023
@Noratrieb
Copy link
Member

Noratrieb commented Jan 28, 2023

Minimized it further:

use std::pin::Pin;

fn foo(_: &mut ()) {}

fn main() {
    let r = Pin::new(&mut ());
    foo(r.get_mut());
    foo(r.get_mut());
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants