Skip to content

Incorrect unresolved module error/actions for submodules under raw identifiers #13141

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
delan opened this issue Aug 29, 2022 · 0 comments · Fixed by #13149
Closed

Incorrect unresolved module error/actions for submodules under raw identifiers #13141

delan opened this issue Aug 29, 2022 · 0 comments · Fixed by #13149

Comments

@delan
Copy link

delan commented Aug 29, 2022

rust-analyzer version: 0.3.1186-standalone (e8e598f 2022-08-28)

rustc version: 1.65.0-nightly (ce36e8825 2022-08-28)

Create a project with cargo new --bin foo.

Given the following src/main.rs, the rust-analyzer(unresolved-module) and code actions correctly suggest creating “const.rs” or “const/mod.rs”.

mod r#const;
fn main() {}

But given the following src/const.rs, they suggest creating “r#const/foo.rs” or “r#const/foo/mod.rs”, even when src/const/foo.rs or src/const/foo/mod.rs exists.

mod foo;

If we rename src/const/foo.rs to src/r#const/foo.rs as suggested, the rust-analyzer(unresolved-module) goes away, but we now have a rustc(E0583) essentially telling us to rename it back, so it looks like including “r#” in module filenames is incorrect.

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

Successfully merging a pull request may close this issue.

1 participant