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

Closed
franziskuskiefer opened this issue Nov 21, 2024 · 5 comments
Closed

Cyclic dependency with trait impl #1124

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

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.

Copy link

This issue has been marked as stale due to a lack of activity for 60 days. If you believe this issue is still relevant, please provide an update or comment to keep it open. Otherwise, it will be closed in 7 days.

@github-actions github-actions bot added the stale label Jan 30, 2025
@franziskuskiefer
Copy link
Member Author

@maximebuyse will investigate when #1199 is merged.

@maximebuyse
Copy link
Contributor

This was fixed by #1199. The reproducer still does not lax-check though, but I documented the problem (which is different) in #1283 (comment).

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

Successfully merging a pull request may close this issue.

4 participants