Skip to content

Recursize unsized types cause ICE #23524

Closed
@jamii

Description

@jamii

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:

struct Node: {
  population: u16,
  children: [Option<Node>; popcount(population)]
}

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions