Skip to content

Commit 3a50257

Browse files
J3m3ojeda
authored andcommitted
scripts: generate_rust_analyzer: quote: treat core and std as dependencies
Fix the `generate_rust_analyzer.py` script to ensure that the `rust-project.json` it produces includes `core` and `std` in the `deps` field for the `quote` crate. `quote` directly references items from both `core` and `std`, so rust-analyzer should treat them as dependencies to provide correct IDE support. For example, the `::quote::ToTokens` trait is implemented for `std::ffi::CString`. With `std` listed in the `deps` field, rust-analyzer can show the expected autocomplete for the `::quote::ToTokens` methods on `std::ffi::CString`. Verified the explicit uses of `core` and `std` using: grep -rnE 'core::|std::' rust/quote/ Fixes: 88de91c ("rust: quote: enable support in kbuild") Signed-off-by: Jesung Yang <y.j3ms.n@gmail.com> Reviewed-by: Tamir Duberstein <tamird@gmail.com> Link: https://patch.msgid.link/cef76fc1105481d219953c8552eb5eb07dac707a.1764062688.git.y.j3ms.n@gmail.com [ Reworded title. - Miguel ] Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
1 parent 87417cc commit 3a50257

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

scripts/generate_rust_analyzer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def append_sysroot_crate(
9696
append_crate(
9797
"quote",
9898
srctree / "rust" / "quote" / "lib.rs",
99-
["alloc", "proc_macro", "proc_macro2"],
99+
["core", "alloc", "std", "proc_macro", "proc_macro2"],
100100
cfg=crates_cfgs["quote"],
101101
)
102102

0 commit comments

Comments
 (0)