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

include! macro can't include files outside of project's directory. #17507

Closed
DiscreteTom opened this issue Jun 28, 2024 · 1 comment
Closed
Labels
C-bug Category: bug

Comments

@DiscreteTom
Copy link

DiscreteTom commented Jun 28, 2024

rust-analyzer version: VSCode 0.3.2011-standalone (2fd803c 2024-06-22)

rustc version: rustc 1.78.0 (9b00956e5 2024-04-29)

editor or extension: VSCode

repository link (if public, optional):
https://github.com/DiscreteTom/rust-analyzer-include-issue

code snippet to reproduce:

// see the repo above for more details
include!("../../snippet.rs");

fn main() {
    println!("{}", snippet());
}

Got error:

failed to load file `../../snippet.rs`rust-analyzer[macro-error](https://rust-analyzer.github.io/manual.html#macro-error)

However this is compile-able and runable by cargo build or cargo run.

@DiscreteTom DiscreteTom added the C-bug Category: bug label Jun 28, 2024
@davidbarsky
Copy link
Contributor

Unfortunately a known issue. I'll close this as a dupe of #17040.

@davidbarsky davidbarsky closed this as not planned Won't fix, can't repro, duplicate, stale Jun 28, 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

No branches or pull requests

2 participants