You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/names/preludes.md
+24-7
Original file line number
Diff line number
Diff line change
@@ -18,9 +18,22 @@ There are several different preludes:
18
18
19
19
## Standard library prelude
20
20
21
-
The standard library prelude includes names from the [`std::prelude::v1`]
22
-
module. If the [`no_std` attribute] is used, then it instead uses the names
23
-
from the [`core::prelude::v1`] module.
21
+
Each crate has a standard library prelude, which consists of the names from a single standard library module. The module used depends on the crate's edition, and on whether the [`no_std` attribute] is applied to the crate:
This choice of prelude is in effect throughout the crate, including code generated by macros defined in crates with a different edition or `no_std` attribute.
30
+
31
+
32
+
> **Note**:
33
+
>
34
+
> [`std::prelude::rust_2015`] and [`std::prelude::rust_2018`] have the same contents as [`std::prelude::v1`].
35
+
>
36
+
> [`core::prelude::rust_2015`] and [`core::prelude::rust_2018`] have the same contents as [`core::prelude::v1`].
24
37
25
38
## Extern prelude
26
39
@@ -63,15 +76,13 @@ By default, the standard library is automatically included in the crate root
0 commit comments