From 9575ed30abba70508749d69a9f601e2c6ed657c2 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Fri, 4 Oct 2024 10:48:59 -0700 Subject: [PATCH] docs: Mention that rust edition/standard 2018 or later should be used 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. --- docs/markdown/Rust.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/markdown/Rust.md b/docs/markdown/Rust.md index 74f68442c638..d30fe68373cc 100644 --- a/docs/markdown/Rust.md +++ b/docs/markdown/Rust.md @@ -10,7 +10,9 @@ short-description: Working with Rust in Meson Meson can't track dependency information for crates linked by rustc as a result of `extern crate` statements in Rust source code. If your crate dependencies are properly expressed in Meson, there should be no -need for `extern crate` statements in your Rust code. +need for `extern crate` statements in your Rust code, as long as you use the +Rust 2018 edition or later. This means adding `rust_std=2018` (or later) to the +`project(default_options)` argument. An example of the problems with `extern crate` is that if you delete a crate from a Meson build file, other crates that depend on that crate