charon icon indicating copy to clipboard operation
charon copied to clipboard

Compilation hangs when having a type defined inside a trait

Open dbsc opened this issue 1 year ago • 3 comments

The following code snippet

pub trait Trait1 {
    type T: Trait2;
}

pub trait Trait2: Trait1 {
    type U;
}

makes charon hang. The motivation for this structure can be found in arkworks/ff.

dbsc avatar Mar 27 '24 15:03 dbsc

The stack overflow happens in hax; the last bit in charon is: https://github.com/AeneasVerif/charon/blob/fd3f417a7408c137b1a645fb276e3bd77518da78/charon/src/translate_traits.rs?plain=1#L344

Seems pretty innocent; do you think this is something to fix on hax's side?

Marking it as blocked on hax for now.

Nadrieril avatar Apr 16 '24 12:04 Nadrieril

Yes, let's fix it on hax's side. But maybe wait for the merge of charon_traits_merge?

sonmarcho avatar Apr 19 '24 06:04 sonmarcho

This fails in hax on THIR too. I filed the issue there: https://github.com/hacspec/hax/issues/692

Nadrieril avatar May 30 '24 13:05 Nadrieril

This was fixed in hax. I'll add a regression test in my next PR.

Nadrieril avatar Aug 28 '24 12:08 Nadrieril