From 04c271850874a63e9bfc4fef75192c8c1a5164ac Mon Sep 17 00:00:00 2001 From: Hayden Stainsby Date: Mon, 29 Jul 2024 11:23:29 +0200 Subject: [PATCH] docs: reiterate that `[build]` doesn't go in Cargo.toml (#6728) To enable unstable features in Tokio, passing `--cfg tokio_unstable` to the compiler is necessary. We document how to do this in a variety of ways in the main Tokio (lib.rs) documentation. One way is to add a `[build]` section to the file `.cargo/config.toml`. Even though this filename is stated in the documentation, it is quite common that first time users (including this author, some time ago) put it in their `Cargo.toml` file instead. This change adds a "warning" section to the documentation to reiterate the point that this section doesn't go in the cargo manifest (`Cargo.toml`). --- tokio/src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tokio/src/lib.rs b/tokio/src/lib.rs index 70ff89fbf..bd85e2851 100644 --- a/tokio/src/lib.rs +++ b/tokio/src/lib.rs @@ -367,6 +367,12 @@ //! rustflags = ["--cfg", "tokio_unstable"] //! ``` //! +//!
+//! The [build] section does not go in a +//! Cargo.toml file. Instead it must be placed in the Cargo config +//! file .cargo/config.toml. +//!
+//! //! Alternatively, you can specify it with an environment variable: //! //! ```sh