diff options
author | Miguel Ojeda <ojeda@kernel.org> | 2025-04-13 02:56:50 +0200 |
---|---|---|
committer | Miguel Ojeda <ojeda@kernel.org> | 2025-05-23 16:31:43 +0200 |
commit | 3d5bef5d47c371e17041cd6c84e9c08e54ea9e63 (patch) | |
tree | 24f5581847043f84f7f0e405b397bc1b3fefd327 /scripts/generate_rust_analyzer.py | |
parent | f7819f7988f9c7292315c522d65301ced5cfa7db (diff) |
rust: add C FFI types to the prelude
Rust kernel code is supposed to use the custom mapping of C FFI types,
i.e. those from the `ffi` crate, rather than the ones coming from `core`.
Thus, to minimize mistakes and to simplify the code everywhere, just
provide them in the `kernel` prelude and ask in the Coding Guidelines
to use them directly, i.e. as a single segment path.
After this lands, we can start cleaning up the existing users.
Ideally, we would use something like Clippy's `disallowed-types` to
prevent the use of the `core` ones, but that one sees through aliases.
Link: https://lore.kernel.org/rust-for-linux/CANiq72kc4gzfieD-FjuWfELRDXXD2vLgPv4wqk3nt4pjdPQ=qg@mail.gmail.com/
Reviewed-by: Danilo Krummrich <dakr@kernel.org>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Link: https://lore.kernel.org/r/20250413005650.1745894-1-ojeda@kernel.org
[ Reworded content of the documentation to focus on how to use the
aliases first. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'scripts/generate_rust_analyzer.py')
0 files changed, 0 insertions, 0 deletions