Skip to content
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

Trans stack overflow ICE with infinite type generated by projections #22919

Closed
arielb1 opened this issue Mar 1, 2015 · 3 comments
Closed

Trans stack overflow ICE with infinite type generated by projections #22919

arielb1 opened this issue Mar 1, 2015 · 3 comments
Labels
A-codegen Area: Code generation I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@arielb1
Copy link
Contributor

arielb1 commented Mar 1, 2015

The following program

use std::mem;

pub struct S<T: Tr> {
    pub f: <T as Tr>::I,
}

pub trait Tr {
   type I: Tr;
}

impl<T: Tr> Tr for S<T> {
    type I = S<S<T>>;
}

impl Tr for () {
    type I = ();
}

fn foo<T: Tr>() -> usize {
    mem::size_of::<S<T>>()
}

fn main() {
    println!("{}", foo::<S<()>>());
}

generates a trans-time stack overflow.

@kmcallister kmcallister added A-codegen Area: Code generation I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ labels Mar 2, 2015
@frewsxcv
Copy link
Member

Can confirm this is still an issue

~/Downloads $ rustc --version
rustc 1.0.0-beta.2 (e9080ec39 2015-04-16) (built 2015-04-16)
~/Downloads $ rustc test.rs
thread 'rustc' has overflowed its stack
fish: Job 1, 'rustc test.rs ' terminated by signal SIGILL (Illegal instruction)

@arielb1
Copy link
Contributor Author

arielb1 commented Oct 25, 2015

This is somewhat distinct from #26548, as it creates an irregular type without selection errors.

@arielb1
Copy link
Contributor Author

arielb1 commented Oct 25, 2015

actually, not really.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

3 participants