Skip to content

Block-level DefMap nesting is wrong in inner modules #8614

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

Closed
jonas-schievink opened this issue Apr 21, 2021 · 0 comments · Fixed by #10863
Closed

Block-level DefMap nesting is wrong in inner modules #8614

jonas-schievink opened this issue Apr 21, 2021 · 0 comments · Fixed by #10863
Labels
A-nameres name, path and module resolution S-actionable Someone could pick this issue up and work on it right now

Comments

@jonas-schievink
Copy link
Contributor

#8613 adds a test that demonstrates the issue:

fn f() { // (0)
    mod module {
        struct Struct {}
        fn f() { // (1)
            use self::Struct;
            $0
        }
    }
}

Here, we wrongly store (0) (the block root module) as the module containing (1)'s DefMap, when it should actually be mod module.

Luckily, almost nobody uses modules inside items, so the impact is somewhat limited, but this still points out some issues with how we store inner items, which I do plan to address at some point.

@jonas-schievink jonas-schievink added the A-nameres name, path and module resolution label Apr 21, 2021
@lnicola lnicola added the S-actionable Someone could pick this issue up and work on it right now label Apr 21, 2021
@bors bors bot closed this as completed in 5ea8a9c Nov 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-nameres name, path and module resolution S-actionable Someone could pick this issue up and work on it right now
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants