Make rust-analyzer run flycheck on the build system

This commit is contained in:
bjorn3 2022-10-28 12:48:51 +00:00
parent bd8be325ab
commit ddc66ffecc
2 changed files with 9 additions and 7 deletions

View File

@ -4,7 +4,7 @@
"rust-analyzer.imports.granularity.enforce": true,
"rust-analyzer.imports.granularity.group": "module",
"rust-analyzer.imports.prefix": "crate",
"rust-analyzer.cargo.features": ["unstable-features"],
"rust-analyzer.cargo.features": ["unstable-features", "__check_build_system_using_ra"],
"rust-analyzer.linkedProjects": [
"./Cargo.toml",
{
@ -32,12 +32,6 @@
{
"sysroot_src": "./build_sysroot/sysroot_src/library",
"crates": [
{
"root_module": "./y.rs",
"edition": "2021",
"deps": [],
"cfg": [],
},
{
"root_module": "./example/std_example.rs",
"edition": "2015",

View File

@ -3,6 +3,13 @@ name = "rustc_codegen_cranelift"
version = "0.1.0"
edition = "2021"
[[bin]]
# This is used just to teach rust-analyzer how to check the build system. required-features is used
# to disable it for regular builds.
name = "y"
path = "./y.rs"
required-features = ["__check_build_system_using_ra"]
[lib]
crate-type = ["dylib"]
@ -40,6 +47,7 @@ smallvec = "1.8.1"
unstable-features = ["jit", "inline_asm"]
jit = ["cranelift-jit", "libloading"]
inline_asm = []
__check_build_system_using_ra = []
[package.metadata.rust-analyzer]
rustc_private = true