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

removing unused imports generates invalid use module_name::self #17139

Closed
harrysarson opened this issue Apr 25, 2024 · 0 comments · Fixed by #17140
Closed

removing unused imports generates invalid use module_name::self #17139

harrysarson opened this issue Apr 25, 2024 · 0 comments · Fixed by #17140
Labels
C-bug Category: bug

Comments

@harrysarson
Copy link
Contributor

harrysarson commented Apr 25, 2024

rust-analyzer version: rust-analyzer version: 0.3.1932-standalone (47a901b 2024-04-21)

rustc version: rustc 1.79.0-nightly (ef8b9dcf2 2024-04-24)

editor or extension: VScode v0.3.1932

code snippet to reproduce:

mod inner {
    pub struct X();
    pub struct Y();
}

mod z {
    use super::inner::{self, X}$0;

    fn f() {
        let y = inner::Y();
    }
}

becomes

mod inner {
    pub struct X();
    pub struct Y();
}

mod z {
    use super::inner:self;

    fn f() {
        let y = inner::Y();
    }
}

which is invalid. It should be use super::inner instead.

@harrysarson harrysarson added the C-bug Category: bug label Apr 25, 2024
@harrysarson harrysarson changed the title removing unused imports generates invalid use module_name::self cccccbhlfveedtugibljctridfritbcigrkntnultrr removing unused imports generates invalid use module_name::self Apr 25, 2024
@bors bors closed this as completed in e3e22c6 May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant