gccrs icon indicating copy to clipboard operation
gccrs copied to clipboard

Recursive types fail to compile

Open jrmuizel opened this issue 3 years ago • 1 comments

I tried this code:

pub struct Edge<'a> {
    pub next: &'a Edge<'a>
}

I get <source>:2:19: error: failed to lookup HIR 15 for node 'Edge<'a>'

Meta

  • What version of Rust GCC were you using, git sha if possible. 1286acc34e826039ebc8f09ad36dddc30f726283 (the latest snapshot on godbolt)

jrmuizel avatar Apr 26 '22 14:04 jrmuizel

This is related to #1006 and #1073

philberty avatar Apr 26 '22 14:04 philberty

@philberty you may have recently solved this

powerboat9 avatar Jan 25 '23 02:01 powerboat9

Nevermind

<source>:1:21: error: failed to resolve root segment
    1 | struct Foo(&'static Foo);
      |                     ^~~
ASM generation compiler returned: 1
<source>:1:21: error: failed to resolve root segment
    1 | struct Foo(&'static Foo);
      |                     ^~~
Execution build compiler returned: 1

https://godbolt.org/z/exTas3Eeo

powerboat9 avatar Jan 27 '23 03:01 powerboat9