Skip to content

Commit

Permalink
docs: Mention that rust edition/standard 2018 or later should be used
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dcbaker authored and jpakkane committed Oct 4, 2024
1 parent eda59e1 commit 9575ed3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/markdown/Rust.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9575ed3

Please sign in to comment.