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

Renaming a struct that has a function with the same name will break code: #18892

Open
Tracked by #18812
Veykril opened this issue Jan 9, 2025 · 0 comments
Open
Tracked by #18812
Labels
A-ide general IDE features C-bug Category: bug

Comments

@Veykril
Copy link
Member

Veykril commented Jan 9, 2025

// This currently export both the function and the struct
pub use aligned::Aligned;

mod aligned {
    // Renaming this struct will rename the `pub use` above, breaking the use in the test
    pub struct Aligned {
        size: usize,
    }

    #[allow(non_snake_case)]
    pub fn Aligned(size: usize) -> Aligned {
        Aligned {
            size
        }
    }
}

#[test]
fn aligned_rename_failure() {
    Aligned(5);
}
@Veykril Veykril mentioned this issue Jan 9, 2025
5 tasks
@Veykril Veykril added C-bug Category: bug A-ide general IDE features labels Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ide general IDE features C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

1 participant