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
Expression variant of include!
always produces errors
#10647
Comments
|
include!
always yields failed to load file
(macro-error)include!
always produces errors
Got it, thanks for the info. Would it be possible to demote the error into a warning or info, saying something like "rust-analyzer cannot read non-.rs files during macro expansion"?
I've updated title, description and the code in example repository to directly showcase this case. |
I'm running into the same problem (that rust-analyzer only loads .rs files) |
Duplicate of #10178 |
std::include!
has 2 variants depending on how it is used:include!("bindings.rs")
often used in -sys crates.let value = include!("file.in")
used likely much less.The item variant works well, but the expression variant always causes rust-analyzer to emit an error. The only negative effect of the error on rust-analyzer is that it doesn't infer the type of the variable. Specifying the type explicitly works.
Minimal reproduction:
With both
text.in
andtext.rs
being:Gives the following rust-analyzer errors:
Also available at https://github.com/strohel/include-test-case as a complete Cargo crate.
Note that if the included file has
.rs
extension (text.rs
), the errors are slightly different.VSCodium 1.61.2
rust-analyzer v0.2.784 from https://open-vsx.org/extension/matklad/rust-analyzer/0.2.784
The text was updated successfully, but these errors were encountered: