Skip to content

include!ing files without .rs suffix does not work #10178

@kinnison

Description

@kinnison

I have a project (https://gitlab.com/subplot/subplot) which has a build.rs which writes a file out to be included into the build.

The file is written out to OUT_DIR (embedded_files.inc)

In my code I have:

static EMBEDDED_FILES: &[(&str, &[u8])] = include!(concat!(env!("OUT_DIR"), "/embedded_files.inc"));

In VSCode, I have that line have the following error shown:

failed to load file `/home/dsilvers/dev-git/subplot/target/debug/build/subplot-a90f1b6ad6ba44a6/out/embedded_files.inc`
rust-analyzer(macro-error)

However, that file very much does exist, so the error is spurious. Is there a way to get rust-analyzer to find this file and stop complaining?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-configconfigurationA-vfsC-ArchitectureBig architectural things which we need to figure up-front (or suggestions for rewrites :0) )C-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions