gccrs icon indicating copy to clipboard operation
gccrs copied to clipboard

Mutally recursive types are not resolved in TyTy

Open jdupak opened this issue 1 year ago • 2 comments

struct S(&'static T);
struct T(&'static S);
./lifetime.rs:32:19: error: failed to resolve root segment
   32 | struct S(&'static T);
      |                   ^

jdupak avatar Nov 23 '23 12:11 jdupak

Maybe related to #2733

jdupak avatar Nov 23 '23 12:11 jdupak

Yeah i haven't done recursive types I've got two ideas how to solve it and I can't decide whats the right way to do it.

Off the top of my head other front-ends in GCC detect the recusive case and do a check that yes its recursive but enforce it can only be a pointer type of some kind but i am not sure if this is the correct rust semantics.

philberty avatar Dec 12 '23 13:12 philberty