]> git.proxmox.com Git - rustc.git/blame - src/libstd/prelude/v1.rs
New upstream version 1.38.0+dfsg1
[rustc.git] / src / libstd / prelude / v1.rs
CommitLineData
bd371182 1//! The first version of the prelude of The Rust Standard Library.
92a42be0
SL
2//!
3//! See the [module-level documentation](../index.html) for more.
1a4d82fc 4
8faf50e0
XL
5
6
85aaf69f 7#![stable(feature = "rust1", since = "1.0.0")]
1a4d82fc 8
2c00a5a8 9// Re-exported core operators
416331ca 10#[cfg(bootstrap)]
85aaf69f 11#[stable(feature = "rust1", since = "1.0.0")]
8faf50e0 12#[doc(no_inline)]
416331ca
XL
13pub use crate::marker::Copy;
14#[stable(feature = "rust1", since = "1.0.0")]
15#[doc(no_inline)]
16pub use crate::marker::{Send, Sized, Sync, Unpin};
85aaf69f 17#[stable(feature = "rust1", since = "1.0.0")]
8faf50e0 18#[doc(no_inline)]
532ac7d7 19pub use crate::ops::{Drop, Fn, FnMut, FnOnce};
1a4d82fc 20
2c00a5a8 21// Re-exported functions
85aaf69f 22#[stable(feature = "rust1", since = "1.0.0")]
8faf50e0 23#[doc(no_inline)]
532ac7d7 24pub use crate::mem::drop;
1a4d82fc 25
2c00a5a8 26// Re-exported types and traits
416331ca 27#[cfg(bootstrap)]
85aaf69f 28#[stable(feature = "rust1", since = "1.0.0")]
8faf50e0 29#[doc(no_inline)]
532ac7d7 30pub use crate::clone::Clone;
416331ca 31#[cfg(bootstrap)]
85aaf69f 32#[stable(feature = "rust1", since = "1.0.0")]
8faf50e0 33#[doc(no_inline)]
532ac7d7 34pub use crate::cmp::{PartialEq, PartialOrd, Eq, Ord};
9346a6ac 35#[stable(feature = "rust1", since = "1.0.0")]
8faf50e0 36#[doc(no_inline)]
532ac7d7 37pub use crate::convert::{AsRef, AsMut, Into, From};
416331ca 38#[cfg(bootstrap)]
85aaf69f 39#[stable(feature = "rust1", since = "1.0.0")]
8faf50e0 40#[doc(no_inline)]
532ac7d7 41pub use crate::default::Default;
9346a6ac 42#[stable(feature = "rust1", since = "1.0.0")]
8faf50e0 43#[doc(no_inline)]
532ac7d7 44pub use crate::iter::{Iterator, Extend, IntoIterator};
85aaf69f 45#[stable(feature = "rust1", since = "1.0.0")]
8faf50e0 46#[doc(no_inline)]
532ac7d7 47pub use crate::iter::{DoubleEndedIterator, ExactSizeIterator};
85aaf69f 48#[stable(feature = "rust1", since = "1.0.0")]
8faf50e0 49#[doc(no_inline)]
532ac7d7 50pub use crate::option::Option::{self, Some, None};
85aaf69f 51#[stable(feature = "rust1", since = "1.0.0")]
8faf50e0 52#[doc(no_inline)]
532ac7d7 53pub use crate::result::Result::{self, Ok, Err};
8faf50e0 54
416331ca
XL
55// Re-exported built-in macros
56#[cfg(not(bootstrap))]
57#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
58#[doc(no_inline)]
59pub use core::prelude::v1::{
60 __rust_unstable_column,
61 asm,
62 assert,
63 cfg,
64 column,
65 compile_error,
66 concat,
67 concat_idents,
68 env,
69 file,
70 format_args,
71 format_args_nl,
72 global_asm,
73 include,
74 include_bytes,
75 include_str,
76 line,
77 log_syntax,
78 module_path,
79 option_env,
80 stringify,
81 trace_macros,
82};
83
84// FIXME: Attribute and derive macros are not documented because for them rustdoc generates
85// dead links which fail link checker testing.
86#[cfg(not(bootstrap))]
87#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
88#[allow(deprecated)]
89#[doc(hidden)]
90pub use core::prelude::v1::{
91 Clone,
92 Copy,
93 Debug,
94 Default,
95 Eq,
96 Hash,
97 Ord,
98 PartialEq,
99 PartialOrd,
100 RustcDecodable,
101 RustcEncodable,
102 bench,
103 global_allocator,
104 test,
105 test_case,
106};
8faf50e0
XL
107
108// The file so far is equivalent to src/libcore/prelude/v1.rs,
109// and below to src/liballoc/prelude.rs.
110// Those files are duplicated rather than using glob imports
111// because we want docs to show these re-exports as pointing to within `std`.
112
113
85aaf69f 114#[stable(feature = "rust1", since = "1.0.0")]
8faf50e0 115#[doc(no_inline)]
532ac7d7 116pub use crate::boxed::Box;
85aaf69f 117#[stable(feature = "rust1", since = "1.0.0")]
8faf50e0 118#[doc(no_inline)]
532ac7d7 119pub use crate::borrow::ToOwned;
85aaf69f 120#[stable(feature = "rust1", since = "1.0.0")]
8faf50e0 121#[doc(no_inline)]
532ac7d7 122pub use crate::string::{String, ToString};
85aaf69f 123#[stable(feature = "rust1", since = "1.0.0")]
8faf50e0 124#[doc(no_inline)]
532ac7d7 125pub use crate::vec::Vec;