@@ -59,13 +59,21 @@ alloc/test limitation.
5959
6060### The `no_std ` attribute
6161
62+ By default , the standard library is automatically included in the crate root
63+ module . The [`std `] crate is added to the root , along with an implicit
64+ [`macro_use ` attribute ] pulling in all macros exported from `std ` into the
65+ [`macro_use ` prelude ]. Both [`core `] and [`std `] are added to the [extern
66+ prelude ]. The [standard library prelude ] includes everything from the
67+ [`std :: prelude :: v1 `] module .
68+
6269The * `no_std ` [attribute ]* may be applied at the crate level to prevent the
6370[`std `] crate from being automatically added into scope . It does three things :
6471
6572* Prevents `std ` from being added to the [extern prelude ](#extern - prelude ).
6673* Uses [`core :: prelude :: v1 `] in the [standard library prelude ] instead of
6774 [`std :: prelude :: v1 `].
68- * Injects the [`core `] crate into the crate root instead of `std `.
75+ * Injects the [`core `] crate into the crate root instead of [`std `], and pulls
76+ in all macros exported from `core ` in the [`macro_use ` prelude ].
6977
7078> * * Note ** : Using the core prelude over the standard prelude is useful when
7179> either the crate is targeting a platform that does not support the standard
@@ -112,7 +120,12 @@ on a module to indicate that it should not automatically bring the [standard
112120library prelude], [extern prelude], or [tool prelude] into scope for that
113121module or any of its descendants.
114122
115- This attribute does not affect the [language prelude] or [`macro_use` prelude].
123+ This attribute does not affect the [language prelude].
124+
125+ > * * Edition Differences** : In the 2015 edition, the `no_implicit_prelude`
126+ > attribute does not affect the [`macro_use` prelude], and all macros exported
127+ > from the standard library are still included in the `macro_use` prelude.
128+ > Starting in the 2018 edition, it will remove the `macro_use` prelude.
116129
117130[`alloc`]: .. / .. / alloc/ index. html
118131[`Box`]: .. / .. / std/ boxed/ struct . Box. html
0 commit comments