Skip to content

Forward declared structures fail type resolution #1006

@philberty

Description

@philberty

I tried this code:

union B {
    a: A,
    b: f32
}

struct A {
    data: i32,
    len: usize,
}

I expected to see this happen: compile without error

Instead, this happened:

<source>:2:8: error: failed to lookup HIR 16 for node 'A'
    2 |     a: A,
      |        ^

see: https://godbolt.org/z/jY4bEWK3z

Meta

  • What version of Rust GCC were you using, git sha if possible. b82408f

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions