We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
include!
// ./src/lib.rs mod bar { include!("foo.rs"); } // ./src/foo.rs pub struct Foo; impl Foo {} // ^^^ rust analyzer cannot find definition for `Foo`
The above code compiles fine in rustc.
If I trigger code action on Foo, r-a suggests to "Qualify as bar::Foo"(or import it) but the resulting code makes compile error
Foo
bar::Foo
pub struct Foo; impl bar::Foo {} // ^^^ error[E0433]: failed to resolve: use of undeclared crate or module `bar`
If I include foo.rs outside the mod block, it works fine
foo.rs
// ./src/lib.rs include!("foo.rs"); // ./src/foo.rs pub struct Foo; impl Foo {} // ^^^ Recognized as `struct Foo`
The text was updated successfully, but these errors were encountered:
487152b
Auto merge of rust-lang#18361 - Veykril:veykril/push-uzsokssoyznx, r=…
20864ef
…Veykril fix: Fix token downmapping failing for include! inputs Supercedes rust-lang/rust-analyzer#18325 Fixes rust-lang/rust-analyzer#18325 Fixes rust-lang/rust-analyzer#18313 Fixes rust-lang/rust-analyzer#18314
ShoyuVanilla
Successfully merging a pull request may close this issue.
The above code compiles fine in rustc.
If I trigger code action on
Foo
, r-a suggests to "Qualify asbar::Foo
"(or import it) but the resulting code makes compile errorIf I include
foo.rs
outside the mod block, it works fineThe text was updated successfully, but these errors were encountered: