Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit ddc66ff

Browse files
committed
Make rust-analyzer run flycheck on the build system
1 parent bd8be32 commit ddc66ff

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

.vscode/settings.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"rust-analyzer.imports.granularity.enforce": true,
55
"rust-analyzer.imports.granularity.group": "module",
66
"rust-analyzer.imports.prefix": "crate",
7-
"rust-analyzer.cargo.features": ["unstable-features"],
7+
"rust-analyzer.cargo.features": ["unstable-features", "__check_build_system_using_ra"],
88
"rust-analyzer.linkedProjects": [
99
"./Cargo.toml",
1010
{
@@ -32,12 +32,6 @@
3232
{
3333
"sysroot_src": "./build_sysroot/sysroot_src/library",
3434
"crates": [
35-
{
36-
"root_module": "./y.rs",
37-
"edition": "2021",
38-
"deps": [],
39-
"cfg": [],
40-
},
4135
{
4236
"root_module": "./example/std_example.rs",
4337
"edition": "2015",

Cargo.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ name = "rustc_codegen_cranelift"
33
version = "0.1.0"
44
edition = "2021"
55

6+
[[bin]]
7+
# This is used just to teach rust-analyzer how to check the build system. required-features is used
8+
# to disable it for regular builds.
9+
name = "y"
10+
path = "./y.rs"
11+
required-features = ["__check_build_system_using_ra"]
12+
613
[lib]
714
crate-type = ["dylib"]
815

@@ -40,6 +47,7 @@ smallvec = "1.8.1"
4047
unstable-features = ["jit", "inline_asm"]
4148
jit = ["cranelift-jit", "libloading"]
4249
inline_asm = []
50+
__check_build_system_using_ra = []
4351

4452
[package.metadata.rust-analyzer]
4553
rustc_private = true

0 commit comments

Comments
 (0)