summaryrefslogtreecommitdiff
path: root/docs/markdown/Rust.md
AgeCommit message (Collapse)Author
2025-12-22Merge branch 'clippy-json'John Turner
2025-12-22docs: update info on Cargo workspace objectPaolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-12-22docs: add release notes for rust.workspace()Paolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-12-20add clippy-json targetJohn Turner
Add a clippy-json target to the ninja script. This is useful for rust-analyzer, which requires an "external check command" to function when not using cargo. Also we add a "clippy-json-prereq" target, and invoke it in the clippy.py script. The prereq target tries to build as much of the project as possible with "-k0".
2025-10-27rust: drop +SUFFIX from crate namePaolo Bonzini
Allow multiple targets for the same crate name, which is useful when the same crate is used for both the host and the build machine. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-07-29docs: update for mixed Rust/non-Rust sourcesPaolo Bonzini
2025-05-01docs: Update link to rust-analyzer docsM Henning
2024-10-04docs: Mention that rust edition/standard 2018 or later should be usedDylan Baker
As the 2018 standard changes the way rust handles externs, and is the first edition that allows `--extern crate=path` to completely replace (in all but a few corner cases) the use of `extern crate` in the rust files.
2024-07-10docs: explain not to use extern crate in Rust codeAlyssa Ross
2023-06-21rust: fix -C prefer-dynamic behaviorAlyssa Ross
I noticed when building a project that uses a proc macro that Meson passed -C prefer-dynamic for the executable, and not the proc macro, while cargo passed -C prefer-dynamic for the proc macro, but not for the executable. Meson's behavior broke setting -C panic=abort on the executable. As far as we can tell, because we explicitly pass each library path to rustc, the only thing -C prefer-dynamic affects in Meson is how the standard libraries are linked. Generally, one does not want the standard libraries to be dynamically linked, because if the Rust compiler is ever updated, anything linked against the old standard libraries will likely break, due to the lack of a stable Rust ABI. Therefore, I've reorganised Meson's behavior around the principle that the standard libraries should only be dynamically linked when Rust dynamic linking has already been opted into in some other way. The details of how this manifests are now explained in the documentation.
2022-09-12rust: Generate a rust-project.json file when rust targets are presentDylan Baker
When at least one Rust target is present, we now generate a rust-project.json file, which can be consumed by rust-analyzer. This is placed in the build directory, and the editor must be configured to look for this (as it is not a default search path).
2022-06-27docs: fix broken link to structured sourcesEli Schwartz
We used the wrong spelling for both the object and the function. Link to both, once in the description and once in the example code.
2022-03-22docs/rust: fix markdown titleDylan Baker
VSCode is perfectly happy with the trailing `---`, hotdoc only likes `...` apparently.
2022-03-07docs: Add a document on using Rust in MesonDylan Baker
This is hardly complete, but it's a start.