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

Cyclic dependency with trait impl #1124

Open
franziskuskiefer opened this issue Nov 21, 2024 · 2 comments
Open

Cyclic dependency with trait impl #1124

franziskuskiefer opened this issue Nov 21, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@franziskuskiefer
Copy link
Member

mod encoder {
    trait Encode {
        fn encode();
    }

    impl<T: Encode> Encode for Option<T> {
        fn encode() {
            T::encode();
        }
    }

    pub fn foo(){
        super::user::something();
    }
}

mod user {
    pub fn something() {
        super::encoder::foo();
    }
}

Open this code snippet in the playground

@franziskuskiefer franziskuskiefer added the bug Something isn't working label Nov 21, 2024
@W95Psp
Copy link
Collaborator

W95Psp commented Nov 21, 2024

The F* produced here refers to Playground.Encoder.f_encode when calling T::encode(). Instead we need to refer to the bundle.

@karthikbhargavan
Copy link
Contributor

I believe the issue is that the recursive bundle includes the trait and its implementation whereas it should not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants