- Including an example of how to create a rust-analyzer `rust-project.json` config
- Adding `rust-project.json` to `.gitignore`
Signed-off-by: Matthew Wood <mat@thepacketgeek.com>
This follows the contents of `samples/rust/rust_minimal.rs` in v9, which
is the trimmed down version of v8 where `String` is not in `alloc` anymore.
Now, the log looks like:
[ 1.076945] rust_out_of_tree: Rust out-of-tree sample (init)
[ 1.084944] rust_out_of_tree: My numbers are [72, 108, 200]
[ 1.085944] rust_out_of_tree: Rust out-of-tree sample (exit)
Link: https://lore.kernel.org/lkml/20220805154231.31257-27-ojeda@kernel.org/
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
See commit 593e65924b2e ("rust: take str literal instead bstr literal
in `module!` macro") in the main repository:
For simplicity (avoid parsing), escape sequences and raw string literals
are not yet handled.
Module names, aliases and license strings are restricted to ASCII only.
Signed-off-by: Gary Guo <gary@garyguo.net>
Link: https://github.com/Rust-for-Linux/linux/issues/252
Link: https://lore.kernel.org/lkml/YukvvPOOu8uZl7+n@yadro.com/
Link: 593e65924b
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
See commit dda49a0a5bb6 ("treewide: use `GPL` as the license string
instead of `GPL v2`") in the main repository:
Since commit bf7fbeeae6db ("module: Cure the MODULE_LICENSE "GPL" vs.
"GPL v2" bogosity"), Documentation/process/license-rules.rst explains
that `MODULE_LICENSE` arguments can simply use `GPL` instead of `GPL v2`,
because it is not meant to replace the proper licensing information.
Since the `license:` field of the `module!` macro is the same as
`MODULE_LICENSE`, use the simpler form in Rust too.
Link: dda49a0a5b
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Since PR https://github.com/Rust-for-Linux/linux/pull/635 ("rust:
avoid the need of crate attributes in kernel modules") in the main
repository, these attributes are handled by the build system, thus
there is no need (and it is an error) to specify them.
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>