Skip to content

Commit 05a2b00

Browse files
o1oo11ooojeda
authored andcommitted
scripts: generate_rust_analyzer: Add ffi crate
Commit d072acd ("rust: use custom FFI integer types") did not update rust-analyzer to include the new crate. To enable rust-analyzer support for these custom ffi types, add the `ffi` crate as a dependency to the `bindings`, `uapi` and `kernel` crates, which all directly depend on it. Fixes: d072acd ("rust: use custom FFI integer types") Signed-off-by: Lukas Fischer <kernel@o1oo11oo.de> Reviewed-by: Tamir Duberstein <tamird@gmail.com> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20250404125150.85783-2-kernel@o1oo11oo.de Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
1 parent 0af2f6b commit 05a2b00

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

scripts/generate_rust_analyzer.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,12 @@ def append_sysroot_crate(
112112
cfg=["kernel"],
113113
)
114114

115+
append_crate(
116+
"ffi",
117+
srctree / "rust" / "ffi.rs",
118+
["core", "compiler_builtins"],
119+
)
120+
115121
def append_crate_with_generated(
116122
display_name,
117123
deps,
@@ -131,9 +137,9 @@ def append_crate_with_generated(
131137
"exclude_dirs": [],
132138
}
133139

134-
append_crate_with_generated("bindings", ["core"])
135-
append_crate_with_generated("uapi", ["core"])
136-
append_crate_with_generated("kernel", ["core", "macros", "build_error", "pin_init", "bindings", "uapi"])
140+
append_crate_with_generated("bindings", ["core", "ffi"])
141+
append_crate_with_generated("uapi", ["core", "ffi"])
142+
append_crate_with_generated("kernel", ["core", "macros", "build_error", "pin_init", "ffi", "bindings", "uapi"])
137143

138144
def is_root_crate(build_file, target):
139145
try:

0 commit comments

Comments
 (0)