summaryrefslogtreecommitdiff
path: root/rust
diff options
context:
space:
mode:
authorMartin Rodriguez Reboredo <yakoyoku@gmail.com>2023-08-04 14:14:39 -0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-03-28 21:58:57 +0100
commitd7cfc1a42ff05302c78cd9750acf9e14e3c38542 (patch)
treee2a15a5a55f1acb24b50f03a1de76e2c84ed6985 /rust
parent88a96a6fb12939c6e7d446561ef80b410c53ee5a (diff)
downloadlinux-d7cfc1a42ff05302c78cd9750acf9e14e3c38542.tar.gz
linux-d7cfc1a42ff05302c78cd9750acf9e14e3c38542.tar.bz2
linux-d7cfc1a42ff05302c78cd9750acf9e14e3c38542.zip
scripts: generate_rust_analyzer: provide `cfg`s for `core` and `alloc`
[ Upstream commit 4f353e0d1282dfe6b8082290fe8e606c5739a954 ] Both `core` and `alloc` have their `cfgs` (such as `no_rc`) missing in `rust-project.json`. To remedy this, pass the flags to `generate_rust_analyzer.py` for them to be added to a dictionary where each key corresponds to a crate and each value to a list of `cfg`s. The dictionary is then used to pass the `cfg`s to each crate in the generated file (for `core` and `alloc` only). Signed-off-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com> Link: https://lore.kernel.org/r/20230804171448.54976-1-yakoyoku@gmail.com [ Removed `Suggested-by` as discussed in mailing list. ] Signed-off-by: Miguel Ojeda <ojeda@kernel.org> Stable-dep-of: 2e0f91aba507 ("scripts: generate_rust_analyzer: add missing macros deps") Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'rust')
-rw-r--r--rust/Makefile1
1 files changed, 1 insertions, 0 deletions
diff --git a/rust/Makefile b/rust/Makefile
index 003a1277d705..ec737bad7fbb 100644
--- a/rust/Makefile
+++ b/rust/Makefile
@@ -345,6 +345,7 @@ quiet_cmd_rustc_library = $(if $(skip_clippy),RUSTC,$(RUSTC_OR_CLIPPY_QUIET)) L
rust-analyzer:
$(Q)$(srctree)/scripts/generate_rust_analyzer.py \
+ --cfgs='core=$(core-cfgs)' --cfgs='alloc=$(alloc-cfgs)' \
$(abs_srctree) $(abs_objtree) \
$(RUST_LIB_SRC) $(KBUILD_EXTMOD) > \
$(if $(KBUILD_EXTMOD),$(extmod_prefix),$(objtree))/rust-project.json