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

rustc stack overflow in adt::represent_type with a non-representable data type #26548

Closed
arielb1 opened this issue Jun 24, 2015 · 2 comments
Closed
Labels
A-type-system Area: Type system

Comments

@arielb1
Copy link
Contributor

arielb1 commented Jun 24, 2015

trait Mirror { type It; }
impl<T> Mirror for T { type It = Self; }
struct S(Option<<S as Mirror>::It>);

fn main() {
    let s = S(None);
}

Repeating segment:

#35 0x00007ffff633e93c in vec::Vec$LT$T$GT$.FromIterator$LT$T$GT$::from_iter::h4423171067686251210 () from /usr/local/lib/librustc_trans-11582ce5.so
#36 0x00007ffff63331c9 in trans::adt::mk_struct::h803bb718ce789c5efre () from /usr/local/lib/librustc_trans-11582ce5.so
#37 0x00007ffff6331120 in trans::adt::represent_type_uncached::h958d03c464d97ef1oZd () from /usr/local/lib/librustc_trans-11582ce5.so
#38 0x00007ffff632f2eb in trans::adt::represent_type::hf8312c9646d1eb27MPd () from /usr/local/lib/librustc_trans-11582ce5.so
#39 0x00007ffff633c5c5 in trans::type_of::sizing_type_of::h1b06c66211779b2fBXL () from /usr/local/lib/librustc_trans-11582ce5.so
@arielb1 arielb1 changed the title rustc stack overflow in adt::represent_type with a non-regular data type rustc stack overflow in adt::represent_type with a non-representable data type Jun 24, 2015
@arielb1
Copy link
Contributor Author

arielb1 commented Jun 24, 2015

Note: the type is regular, just not representable (actual non-regular data types make selection overflow, possibly at trans time).

@eefriedman
Copy link
Contributor

This particular case could be handled in type-checking, but the general case requires some sort of recursion check after the type has been monomorphized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-type-system Area: Type system
Projects
None yet
Development

No branches or pull requests

3 participants