#
std/prelude/
v1.rs

    1//! The first version of the prelude of The Rust Standard Library.
    2//!
    3//! See the [module-level documentation](super) for more.
    4
    5#![stable(feature = "rust1", since = "1.0.0")]
    6
    7// No formatting: this file is nothing but re-exports, and their order is worth preserving.
    8#![cfg_attr(rustfmt, rustfmt::skip)]
    9
    10// Re-exported core operators
    11#[stable(feature = "rust1", since = "1.0.0")]
    12#[doc(no_inline)]
    13pub use crate::marker::{Send, Sized, Sync, Unpin};
    14#[stable(feature = "rust1", since = "1.0.0")]
    15#[doc(no_inline)]
    16pub use crate::ops::{Drop, Fn, FnMut, FnOnce};
    17#[stable(feature = "async_closure", since = "1.85.0")]
    18#[doc(no_inline)]
    19pub use crate::ops::{AsyncFn, AsyncFnMut, AsyncFnOnce};
    20
    21// Re-exported functions
    22#[stable(feature = "rust1", since = "1.0.0")]
    23#[doc(no_inline)]
    24pub use crate::mem::drop;
    25#[stable(feature = "size_of_prelude", since = "1.80.0")]
    26#[doc(no_inline)]
    27pub use crate::mem::{align_of, align_of_val, size_of, size_of_val};
    28
    29// Re-exported types and traits
    30#[stable(feature = "rust1", since = "1.0.0")]
    31#[doc(no_inline)]
    32pub use crate::convert::{AsMut, AsRef, From, Into};
    33#[stable(feature = "rust1", since = "1.0.0")]
    34#[doc(no_inline)]
    35pub use crate::iter::{DoubleEndedIterator, ExactSizeIterator};
    36#[stable(feature = "rust1", since = "1.0.0")]
    37#[doc(no_inline)]
    38pub use crate::iter::{Extend, IntoIterator, Iterator};
    39#[stable(feature = "rust1", since = "1.0.0")]
    40#[doc(no_inline)]
    41pub use crate::option::Option::{self, None, Some};
    42#[stable(feature = "rust1", since = "1.0.0")]
    43#[doc(no_inline)]
    44pub 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)]
    49pub use core::prelude::v1::{
    50    assert, cfg, column, compile_error, concat, env, file, format_args,
    51    format_args_nl, include, include_bytes, include_str, line, log_syntax, module_path, option_env,
    52    stringify, trace_macros, Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd,
    53};
    54
    55#[unstable(
    56    feature = "concat_bytes",
    57    issue = "87555",
    58    reason = "`concat_bytes` is not stable enough for use and is subject to change"
    59)]
    60#[doc(no_inline)]
    61pub use core::prelude::v1::concat_bytes;
    62
    63// Do not `doc(no_inline)` so that they become doc items on their own
    64// (no public module for them to be re-exported from).
    65#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
    66pub use core::prelude::v1::{
    67    alloc_error_handler, bench, derive, global_allocator, test, test_case,
    68};
    69
    70#[unstable(feature = "derive_const", issue = "118304")]
    71pub use core::prelude::v1::derive_const;
    72
    73// Do not `doc(no_inline)` either.
    74#[unstable(
    75    feature = "cfg_accessible",
    76    issue = "64797",
    77    reason = "`cfg_accessible` is not fully implemented"
    78)]
    79pub use core::prelude::v1::cfg_accessible;
    80
    81// Do not `doc(no_inline)` either.
    82#[unstable(
    83    feature = "cfg_eval",
    84    issue = "82679",
    85    reason = "`cfg_eval` is a recently implemented feature"
    86)]
    87pub use core::prelude::v1::cfg_eval;
    88
    89// Do not `doc(no_inline)` either.
    90#[unstable(
    91    feature = "type_ascription",
    92    issue = "23416",
    93    reason = "placeholder syntax for type ascription"
    94)]
    95pub use core::prelude::v1::type_ascribe;
    96
    97// Do not `doc(no_inline)` either.
    98#[unstable(
    99    feature = "deref_patterns",
    100    issue = "87121",
    101    reason = "placeholder syntax for deref patterns"
    102)]
    103pub use core::prelude::v1::deref;
    104
    105// Do not `doc(no_inline)` either.
    106#[unstable(
    107    feature = "type_alias_impl_trait",
    108    issue = "63063",
    109    reason = "`type_alias_impl_trait` has open design concerns"
    110)]
    111pub use core::prelude::v1::define_opaque;
    112
    113// The file so far is equivalent to core/src/prelude/v1.rs. It is duplicated
    114// rather than glob imported because we want docs to show these re-exports as
    115// pointing to within `std`.
    116// Below are the items from the alloc crate.
    117
    118#[stable(feature = "rust1", since = "1.0.0")]
    119#[doc(no_inline)]
    120pub use crate::borrow::ToOwned;
    121#[stable(feature = "rust1", since = "1.0.0")]
    122#[doc(no_inline)]
    123pub use crate::boxed::Box;
    124#[stable(feature = "rust1", since = "1.0.0")]
    125#[doc(no_inline)]
    126pub use crate::string::{String, ToString};
    127#[stable(feature = "rust1", since = "1.0.0")]
    128#[doc(no_inline)]
    129pub use crate::vec::Vec;