Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for mutually recursive trait definitions #94

Closed
sonmarcho opened this issue Mar 27, 2024 · 0 comments · Fixed by #160
Closed

Add support for mutually recursive trait definitions #94

sonmarcho opened this issue Mar 27, 2024 · 0 comments · Fixed by #160
Labels
C-unsupported-language-feature A rust feature we don't extract well

Comments

@sonmarcho
Copy link
Member

sonmarcho commented Mar 27, 2024

Mutually recursive traits happen in practice, for example here (mutual recursion between PrimeField and Field):

pub trait Trait1 {
    type T: Trait2;
}

pub trait Trait2: Trait1 {}

It would be good to handle those, or at least print a nice error message. For now, Charon panics with:

thread 'rustc' panicked at 'Invalid trait decl group:
tests4::Trait1
tests4::Trait2', src/reorder_decls.rs:116:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: could not compile `tests4` (bin "tests4")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-unsupported-language-feature A rust feature we don't extract well
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants