-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Recursize unsized types cause ICE #23524
Labels
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Comments
steveklabnik
added
the
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
label
Mar 19, 2015
Visiting for triage: this is still an issue |
Closed
bltavares
added a commit
to bltavares/glacier
that referenced
this issue
Oct 31, 2015
Reference rust-lang/rust#23524
Closed
Triage: Still an issue. |
Changing the code to not use unsized enums which currently aren't supported fixes this ICE. Since this no longer ICE's, I'm going to close. struct Tree(u16, [Option<Box<Tree>>]);
struct Node<T: ?Sized> {
population: u16,
children: T,
}
struct Tree2(Node<Tree>);
fn main() {
use std::mem::size_of;
use std::sync::atomic;
println!("{:?}", size_of::<&Tree>());
println!("{:?}", size_of::<&Tree2>());
}
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://is.gd/o35wcP
Expected: Not sure, maybe some error about fat pointers growing unboundedly.
Actual: Uncommenting either line results in ICE.
What I am trying to achieve is something like:
This general pattern (lengths depending on prior values) is useful for building data structures. It does not seem to be covered by DST and otherwise requires unsafe.
The text was updated successfully, but these errors were encountered: