]> git.lizzy.rs Git - rust.git/blob - library/core/src/prelude/v1.rs
Gate macros behind `#[cfg(not(bootstrap))]`
[rust.git] / library / core / src / prelude / v1.rs
1 //! The first version of the core prelude.
2 //!
3 //! See the [module-level documentation](super) for more.
4
5 #![stable(feature = "core_prelude", since = "1.4.0")]
6
7 // Re-exported core operators
8 #[stable(feature = "core_prelude", since = "1.4.0")]
9 #[doc(no_inline)]
10 pub use crate::marker::{Copy, Send, Sized, Sync, Unpin};
11 #[stable(feature = "core_prelude", since = "1.4.0")]
12 #[doc(no_inline)]
13 pub use crate::ops::{Drop, Fn, FnMut, FnOnce};
14
15 // Re-exported functions
16 #[stable(feature = "core_prelude", since = "1.4.0")]
17 #[doc(no_inline)]
18 pub use crate::mem::drop;
19
20 // Re-exported types and traits
21 #[stable(feature = "core_prelude", since = "1.4.0")]
22 #[doc(no_inline)]
23 pub use crate::clone::Clone;
24 #[stable(feature = "core_prelude", since = "1.4.0")]
25 #[doc(no_inline)]
26 pub use crate::cmp::{Eq, Ord, PartialEq, PartialOrd};
27 #[stable(feature = "core_prelude", since = "1.4.0")]
28 #[doc(no_inline)]
29 pub use crate::convert::{AsMut, AsRef, From, Into};
30 #[stable(feature = "core_prelude", since = "1.4.0")]
31 #[doc(no_inline)]
32 pub use crate::default::Default;
33 #[stable(feature = "core_prelude", since = "1.4.0")]
34 #[doc(no_inline)]
35 pub use crate::iter::{DoubleEndedIterator, ExactSizeIterator};
36 #[stable(feature = "core_prelude", since = "1.4.0")]
37 #[doc(no_inline)]
38 pub use crate::iter::{Extend, IntoIterator, Iterator};
39 #[stable(feature = "core_prelude", since = "1.4.0")]
40 #[doc(no_inline)]
41 pub use crate::option::Option::{self, None, Some};
42 #[stable(feature = "core_prelude", since = "1.4.0")]
43 #[doc(no_inline)]
44 pub use crate::result::Result::{self, Err, Ok};
45
46 // Re-exported built-in macros
47 #[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
48 #[doc(no_inline)]
49 pub use crate::fmt::macros::Debug;
50 #[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
51 #[doc(no_inline)]
52 pub use crate::hash::macros::Hash;
53
54 #[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
55 #[allow(deprecated)]
56 #[doc(no_inline)]
57 pub use crate::{
58     assert, cfg, column, compile_error, concat, concat_idents, env, file, format_args,
59     format_args_nl, include, include_bytes, include_str, line, log_syntax, module_path, option_env,
60     stringify, trace_macros,
61 };
62
63 #[unstable(
64     feature = "concat_bytes",
65     issue = "87555",
66     reason = "`concat_bytes` is not stable enough for use and is subject to change"
67 )]
68 #[doc(no_inline)]
69 pub use crate::concat_bytes;
70
71 // Do not `doc(inline)` these `doc(hidden)` items.
72 #[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
73 #[allow(deprecated)]
74 pub use crate::macros::builtin::{RustcDecodable, RustcEncodable};
75
76 // Do not `doc(no_inline)` so that they become doc items on their own
77 // (no public module for them to be re-exported from).
78 #[cfg(not(bootstrap))]
79 #[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
80 pub use crate::macros::builtin::alloc_error_handler;
81 #[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
82 pub use crate::macros::builtin::{bench, derive, global_allocator, test, test_case};
83
84 #[unstable(feature = "derive_const", issue = "none")]
85 #[cfg(not(bootstrap))]
86 pub use crate::macros::builtin::derive_const;
87
88 #[unstable(
89     feature = "cfg_accessible",
90     issue = "64797",
91     reason = "`cfg_accessible` is not fully implemented"
92 )]
93 pub use crate::macros::builtin::cfg_accessible;
94
95 #[unstable(
96     feature = "cfg_eval",
97     issue = "82679",
98     reason = "`cfg_eval` is a recently implemented feature"
99 )]
100 pub use crate::macros::builtin::cfg_eval;
101
102 #[unstable(
103     feature = "type_ascription",
104     issue = "23416",
105     reason = "placeholder syntax for type ascription"
106 )]
107 #[cfg(not(bootstrap))]
108 pub use crate::macros::builtin::type_ascribe;