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

Trait method calls don't get renamed properly inside bundles #1203

Open
maximebuyse opened this issue Dec 19, 2024 · 1 comment
Open

Trait method calls don't get renamed properly inside bundles #1203

maximebuyse opened this issue Dec 19, 2024 · 1 comment

Comments

@maximebuyse
Copy link
Contributor

mod a{
    trait T {
        fn to_int(&self) -> i32;
    }

    impl T for i32 {
        fn to_int(&self) -> i32 {
            *self
        }
    }

    fn h() -> i32 {0.to_int()}
    pub fn f() {super::b::g()}
}
mod b {
    pub fn g () {super::a::f()}
}

Open this code snippet in the playground

Here in h, the call to to_int is translated to Playground.A.f_to_int instead of just f_to_int. We are missing some renaming.

@franziskuskiefer
Copy link
Member

This appears to be another instance of this bug.
We hit this in libcrux.

mod simd {
    pub(crate) mod traits {
        pub(crate) trait Operations: Copy + Clone {
            type Coefficient: Copy;
        }
    }
}

mod polynomial {
    use super::simd::traits::*;

    #[derive(Clone, Copy)]
    pub(crate) struct PolynomialRingElement<SIMDUnit: Operations> {
        pub(crate) simd_units: [SIMDUnit::Coefficient; 32],
    }
}

Open this code snippet in the playground

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants