From afed4f6d00e7c94550d3d00ef19cedc7466c69c0 Mon Sep 17 00:00:00 2001 From: Lukas Bergdoll Date: Sat, 8 Nov 2025 11:19:52 +0100 Subject: [PATCH 1/2] Reflect explicit macro import in reference --- src/names/preludes.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/names/preludes.md b/src/names/preludes.md index 97c1ba77df..1cd385bc0a 100644 --- a/src/names/preludes.md +++ b/src/names/preludes.md @@ -79,12 +79,11 @@ alloc/test limitation. r[names.preludes.extern.no_std] ### The `no_std` attribute -r[names.preludes.extern.no_std.intro] -By default, the standard library is automatically included in the crate root -module. The [`std`] crate is added to the root, along with an implicit -[`macro_use` attribute] pulling in all macros exported from `std` into the -[`macro_use` prelude]. Both [`core`] and [`std`] are added to the [extern -prelude]. +r[names.preludes.extern.no_std.intro] By default, the standard library is +automatically included in the crate root module. The [`std`] crate is added to +the root. Both [`core`] and [`std`] are added to the [extern prelude]. Standard +library macros are imported via [use declarations] and are *not* part of the +[`macro_use` prelude]. r[names.preludes.extern.no_std.allowed-positions] The *`no_std` [attribute]* may be applied at the crate level to prevent the @@ -97,8 +96,7 @@ r[names.preludes.extern.no_std.extern] r[names.preludes.extern.no_std.module] * Affects which module is used to make up the [standard library prelude] (as described above). r[names.preludes.extern.no_std.core] -* Injects the [`core`] crate into the crate root instead of [`std`], and pulls - in all macros exported from `core` in the [`macro_use` prelude]. +* Injects the [`core`] crate into the crate root instead of [`std`]. > [!NOTE] > Using the core prelude over the standard prelude is useful when either the crate is targeting a platform that does not support the standard library or is purposefully not using the capabilities of the standard library. Those capabilities are mainly dynamic memory allocation (e.g. `Box` and `Vec`) and file and network capabilities (e.g. `std::fs` and `std::io`). From 1e9df55dce2cb67291bb79943ae2b801631bb869 Mon Sep 17 00:00:00 2001 From: Travis Cross Date: Sun, 9 Nov 2025 00:06:18 +0000 Subject: [PATCH 2/2] Restore line break after rule ID and unwrap We put line breaks after our rule identifiers. For new text, or text that would have to be rewrapped, we unwrap the lines. Let's do that here. --- src/names/preludes.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/names/preludes.md b/src/names/preludes.md index 1cd385bc0a..137a8a3755 100644 --- a/src/names/preludes.md +++ b/src/names/preludes.md @@ -79,11 +79,8 @@ alloc/test limitation. r[names.preludes.extern.no_std] ### The `no_std` attribute -r[names.preludes.extern.no_std.intro] By default, the standard library is -automatically included in the crate root module. The [`std`] crate is added to -the root. Both [`core`] and [`std`] are added to the [extern prelude]. Standard -library macros are imported via [use declarations] and are *not* part of the -[`macro_use` prelude]. +r[names.preludes.extern.no_std.intro] +By default, the standard library is automatically included in the crate root module. The [`std`] crate is added to the root. Both [`core`] and [`std`] are added to the [extern prelude]. Standard library macros are imported via [use declarations] and are *not* part of the [`macro_use` prelude]. r[names.preludes.extern.no_std.allowed-positions] The *`no_std` [attribute]* may be applied at the crate level to prevent the