2014-05-22 16:44:54 +00:00
|
|
|
//! # The Rust Core Library
|
2014-05-13 04:22:35 +00:00
|
|
|
//!
|
2015-11-05 13:33:30 +00:00
|
|
|
//! The Rust Core Library is the dependency-free[^free] foundation of [The
|
2014-05-20 04:53:00 +00:00
|
|
|
//! Rust Standard Library](../std/index.html). It is the portable glue
|
|
|
|
//! between the language and its libraries, defining the intrinsic and
|
|
|
|
//! primitive building blocks of all Rust code. It links to no
|
2014-05-20 18:39:40 +00:00
|
|
|
//! upstream libraries, no system libraries, and no libc.
|
2014-05-20 04:53:00 +00:00
|
|
|
//!
|
2015-11-05 13:33:30 +00:00
|
|
|
//! [^free]: Strictly speaking, there are some symbols which are needed but
|
2015-11-18 10:35:29 +00:00
|
|
|
//! they aren't always necessary.
|
2015-11-05 13:33:30 +00:00
|
|
|
//!
|
2014-05-20 04:53:00 +00:00
|
|
|
//! The core library is *minimal*: it isn't even aware of heap allocation,
|
|
|
|
//! nor does it provide concurrency or I/O. These things require
|
2014-05-20 18:39:40 +00:00
|
|
|
//! platform integration, and this library is platform-agnostic.
|
2014-05-20 04:53:00 +00:00
|
|
|
//!
|
|
|
|
//! # How to use the core library
|
|
|
|
//!
|
2016-07-15 17:17:35 +00:00
|
|
|
//! Please note that all of these details are currently not considered stable.
|
|
|
|
//!
|
2014-05-20 17:40:14 +00:00
|
|
|
// FIXME: Fill me in with more detail when the interface settles
|
2014-05-20 04:53:00 +00:00
|
|
|
//! This library is built on the assumption of a few existing symbols:
|
2014-05-13 04:22:35 +00:00
|
|
|
//!
|
|
|
|
//! * `memcpy`, `memcmp`, `memset` - These are core memory routines which are
|
|
|
|
//! often generated by LLVM. Additionally, this library can make explicit
|
2014-05-19 15:51:16 +00:00
|
|
|
//! calls to these functions. Their signatures are the same as found in C.
|
2014-05-14 18:24:12 +00:00
|
|
|
//! These functions are often provided by the system libc, but can also be
|
2019-01-02 07:18:13 +00:00
|
|
|
//! provided by the [compiler-builtins crate](https://crates.io/crates/compiler_builtins).
|
2014-05-13 04:22:35 +00:00
|
|
|
//!
|
2017-06-28 00:41:24 +00:00
|
|
|
//! * `rust_begin_panic` - This function takes four arguments, a
|
|
|
|
//! `fmt::Arguments`, a `&'static str`, and two `u32`'s. These four arguments
|
2016-07-15 17:17:35 +00:00
|
|
|
//! dictate the panic message, the file at which panic was invoked, and the
|
2017-06-27 02:26:52 +00:00
|
|
|
//! line and column inside the file. It is up to consumers of this core
|
|
|
|
//! library to define this panic function; it is only required to never
|
2018-04-30 08:57:11 +00:00
|
|
|
//! return. This requires a `lang` attribute named `panic_impl`.
|
2016-08-14 11:33:53 +00:00
|
|
|
//!
|
|
|
|
//! * `rust_eh_personality` - is used by the failure mechanisms of the
|
|
|
|
//! compiler. This is often mapped to GCC's personality function, but crates
|
|
|
|
//! which do not trigger a panic can be assured that this function is never
|
|
|
|
//! called. The `lang` attribute is called `eh_personality`.
|
2014-06-28 20:57:36 +00:00
|
|
|
|
|
|
|
// Since libcore defines many fundamental lang items, all tests live in a
|
|
|
|
// separate crate, libcoretest, to avoid bizarre issues.
|
2018-05-05 19:29:19 +00:00
|
|
|
//
|
|
|
|
// Here we explicitly #[cfg]-out this whole crate when testing. If we don't do
|
|
|
|
// this, both the generated test artifact and the linked libtest (which
|
|
|
|
// transitively includes libcore) will both define the same set of lang items,
|
2020-01-10 14:36:22 +00:00
|
|
|
// and this will cause the E0152 "found duplicate lang item" error. See
|
2018-05-05 19:29:19 +00:00
|
|
|
// discussion in #50466 for details.
|
|
|
|
//
|
|
|
|
// This cfg won't affect doc tests.
|
2018-05-05 17:02:05 +00:00
|
|
|
#![cfg(not(test))]
|
2021-07-18 15:21:59 +00:00
|
|
|
// To run libcore tests without x.py without ending up with two copies of libcore, Miri needs to be
|
|
|
|
// able to "empty" this crate. See <https://github.com/rust-lang/miri-test-libstd/issues/4>.
|
|
|
|
// rustc itself never sets the feature, so this line has no affect there.
|
|
|
|
#![cfg(any(not(feature = "miri-test-libstd"), test, doctest))]
|
2015-12-03 01:31:49 +00:00
|
|
|
#![stable(feature = "core", since = "1.6.0")]
|
2019-12-22 22:42:04 +00:00
|
|
|
#![doc(
|
|
|
|
html_playground_url = "https://play.rust-lang.org/",
|
|
|
|
issue_tracker_base_url = "https://github.com/rust-lang/rust/issues/",
|
|
|
|
test(no_crate_inject, attr(deny(warnings))),
|
|
|
|
test(attr(allow(dead_code, deprecated, unused_variables, unused_mut)))
|
|
|
|
)]
|
2015-08-11 21:31:23 +00:00
|
|
|
#![no_core]
|
2021-08-04 16:24:57 +00:00
|
|
|
//
|
2021-08-04 15:54:07 +00:00
|
|
|
// Lints:
|
|
|
|
#![deny(rust_2021_incompatible_or_patterns)]
|
|
|
|
#![deny(unsafe_op_in_unsafe_fn)]
|
2018-12-21 10:08:26 +00:00
|
|
|
#![warn(deprecated_in_future)]
|
2019-01-28 09:49:11 +00:00
|
|
|
#![warn(missing_debug_implementations)]
|
2021-08-04 15:54:07 +00:00
|
|
|
#![warn(missing_docs)]
|
2019-04-15 02:23:21 +00:00
|
|
|
#![allow(explicit_outlives_requirements)]
|
2021-08-04 16:24:57 +00:00
|
|
|
//
|
2021-08-04 16:16:03 +00:00
|
|
|
// Library features for const fns:
|
2021-08-04 15:54:07 +00:00
|
|
|
#![feature(const_align_of_val)]
|
2019-12-31 23:25:20 +00:00
|
|
|
#![feature(const_alloc_layout)]
|
2021-07-06 12:38:26 +00:00
|
|
|
#![feature(const_arguments_as_str)]
|
2020-12-02 15:17:37 +00:00
|
|
|
#![feature(const_assert_type)]
|
2021-08-04 15:54:07 +00:00
|
|
|
#![feature(const_caller_location)]
|
2020-11-04 10:41:57 +00:00
|
|
|
#![feature(const_cell_into_inner)]
|
2021-08-04 15:54:07 +00:00
|
|
|
#![feature(const_discriminant)]
|
2020-08-22 19:24:35 +00:00
|
|
|
#![feature(const_float_bits_conv)]
|
2021-08-04 15:54:07 +00:00
|
|
|
#![feature(const_float_classify)]
|
|
|
|
#![feature(const_heap)]
|
2021-05-09 00:18:44 +00:00
|
|
|
#![feature(const_inherent_unchecked_arith)]
|
2021-08-04 15:54:07 +00:00
|
|
|
#![feature(const_int_unchecked_arith)]
|
|
|
|
#![feature(const_intrinsic_copy)]
|
|
|
|
#![feature(const_intrinsic_forget)]
|
|
|
|
#![feature(const_likely)]
|
|
|
|
#![feature(const_maybe_uninit_as_ptr)]
|
|
|
|
#![feature(const_maybe_uninit_assume_init)]
|
2020-07-01 13:07:23 +00:00
|
|
|
#![feature(const_option)]
|
2021-08-04 15:54:07 +00:00
|
|
|
#![feature(const_pin)]
|
2020-04-24 07:19:11 +00:00
|
|
|
#![feature(const_ptr_offset)]
|
2019-12-18 17:00:59 +00:00
|
|
|
#![feature(const_ptr_offset_from)]
|
2020-12-26 00:27:13 +00:00
|
|
|
#![feature(const_ptr_read)]
|
2021-01-18 21:59:56 +00:00
|
|
|
#![feature(const_ptr_write)]
|
2020-07-16 13:12:59 +00:00
|
|
|
#![feature(const_raw_ptr_comparison)]
|
2021-08-04 15:54:07 +00:00
|
|
|
#![feature(const_size_of_val)]
|
2020-05-06 05:43:18 +00:00
|
|
|
#![feature(const_slice_from_raw_parts)]
|
|
|
|
#![feature(const_slice_ptr_len)]
|
2021-03-13 19:33:27 +00:00
|
|
|
#![feature(const_swap)]
|
2020-12-27 18:46:01 +00:00
|
|
|
#![feature(const_trait_impl)]
|
2020-09-22 22:39:19 +00:00
|
|
|
#![feature(const_type_id)]
|
2019-12-18 17:00:59 +00:00
|
|
|
#![feature(const_type_name)]
|
2020-07-17 19:57:13 +00:00
|
|
|
#![feature(const_unreachable_unchecked)]
|
2021-08-14 16:35:12 +00:00
|
|
|
#![feature(const_default_impls)]
|
2021-08-04 15:54:07 +00:00
|
|
|
#![feature(duration_consts_2)]
|
|
|
|
#![feature(ptr_metadata)]
|
|
|
|
#![feature(slice_ptr_get)]
|
|
|
|
#![feature(variant_count)]
|
2021-08-04 16:24:57 +00:00
|
|
|
//
|
2021-08-04 15:54:07 +00:00
|
|
|
// Language features:
|
|
|
|
#![feature(abi_unadjusted)]
|
2021-08-05 16:58:52 +00:00
|
|
|
#![feature(allow_internal_unsafe)]
|
2021-08-04 15:54:07 +00:00
|
|
|
#![feature(allow_internal_unstable)]
|
|
|
|
#![feature(asm)]
|
|
|
|
#![feature(associated_type_bounds)]
|
|
|
|
#![feature(auto_traits)]
|
|
|
|
#![feature(cfg_target_has_atomic)]
|
|
|
|
#![feature(const_fn_floating_point_arithmetic)]
|
|
|
|
#![feature(const_fn_fn_ptr_basics)]
|
|
|
|
#![feature(const_fn_trait_bound)]
|
|
|
|
#![cfg_attr(bootstrap, feature(const_fn_transmute))]
|
|
|
|
#![cfg_attr(bootstrap, feature(const_fn_union))]
|
|
|
|
#![feature(const_impl_trait)]
|
|
|
|
#![feature(const_mut_refs)]
|
|
|
|
#![feature(const_panic)]
|
|
|
|
#![feature(const_precise_live_drops)]
|
|
|
|
#![feature(const_raw_ptr_deref)]
|
|
|
|
#![feature(const_refs_to_cell)]
|
2019-06-29 14:51:20 +00:00
|
|
|
#![feature(decl_macro)]
|
2018-03-09 19:31:04 +00:00
|
|
|
#![feature(doc_cfg)]
|
2021-05-06 11:36:07 +00:00
|
|
|
#![feature(doc_notable_trait)]
|
2021-08-04 15:54:07 +00:00
|
|
|
#![feature(exhaustive_patterns)]
|
2018-04-02 09:26:16 +00:00
|
|
|
#![feature(extern_types)]
|
2015-08-11 21:31:23 +00:00
|
|
|
#![feature(fundamental)]
|
2020-12-19 13:23:59 +00:00
|
|
|
#![feature(intra_doc_pointers)]
|
2015-06-09 18:18:03 +00:00
|
|
|
#![feature(intrinsics)]
|
|
|
|
#![feature(lang_items)]
|
2018-02-18 01:23:19 +00:00
|
|
|
#![feature(link_llvm_intrinsics)]
|
2020-01-14 13:40:42 +00:00
|
|
|
#![feature(llvm_asm)]
|
2021-08-04 15:54:07 +00:00
|
|
|
#![feature(min_specialization)]
|
2020-04-22 19:45:35 +00:00
|
|
|
#![feature(negative_impls)]
|
2019-12-11 14:55:29 +00:00
|
|
|
#![feature(never_type)]
|
2015-08-11 21:31:23 +00:00
|
|
|
#![feature(no_core)]
|
2021-08-04 15:54:07 +00:00
|
|
|
#![feature(no_coverage)] // rust-lang/rust#84605
|
|
|
|
#![feature(no_niche)] // rust-lang/rust#68303
|
|
|
|
#![feature(platform_intrinsics)]
|
2017-03-17 14:05:44 +00:00
|
|
|
#![feature(prelude_import)]
|
2021-08-04 15:54:07 +00:00
|
|
|
#![feature(repr_simd)]
|
|
|
|
#![feature(rustc_allow_const_fn_unstable)]
|
2016-03-10 19:20:09 +00:00
|
|
|
#![feature(rustc_attrs)]
|
2018-02-18 01:23:19 +00:00
|
|
|
#![feature(simd_ffi)]
|
2015-01-30 20:26:44 +00:00
|
|
|
#![feature(staged_api)]
|
2018-02-18 01:23:19 +00:00
|
|
|
#![feature(stmt_expr_attributes)]
|
2020-10-19 13:38:11 +00:00
|
|
|
#![feature(trait_alias)]
|
2019-07-04 14:05:50 +00:00
|
|
|
#![feature(transparent_unions)]
|
2020-09-04 00:11:02 +00:00
|
|
|
#![feature(try_blocks)]
|
2015-01-06 17:24:46 +00:00
|
|
|
#![feature(unboxed_closures)]
|
2020-11-19 20:01:48 +00:00
|
|
|
#![feature(unsized_fn_params)]
|
2021-08-04 16:24:57 +00:00
|
|
|
//
|
2021-08-04 15:54:07 +00:00
|
|
|
// Target features:
|
2018-05-10 18:02:19 +00:00
|
|
|
#![feature(aarch64_target_feature)]
|
2021-08-04 15:54:07 +00:00
|
|
|
#![feature(adx_target_feature)]
|
|
|
|
#![feature(arm_target_feature)]
|
2018-12-17 20:06:06 +00:00
|
|
|
#![feature(avx512_target_feature)]
|
2019-01-19 23:25:06 +00:00
|
|
|
#![feature(cmpxchg16b_target_feature)]
|
2019-07-15 11:57:34 +00:00
|
|
|
#![feature(f16c_target_feature)]
|
2018-08-10 17:01:18 +00:00
|
|
|
#![feature(hexagon_target_feature)]
|
2021-08-04 15:54:07 +00:00
|
|
|
#![feature(mips_target_feature)]
|
|
|
|
#![feature(powerpc_target_feature)]
|
|
|
|
#![feature(rtm_target_feature)]
|
|
|
|
#![feature(sse4a_target_feature)]
|
|
|
|
#![feature(tbm_target_feature)]
|
|
|
|
#![feature(wasm_target_feature)]
|
2018-04-03 18:11:49 +00:00
|
|
|
|
2021-04-30 14:54:18 +00:00
|
|
|
// allow using `core::` in intra-doc links
|
|
|
|
#[allow(unused_extern_crates)]
|
|
|
|
extern crate self as core;
|
|
|
|
|
2016-08-22 10:02:28 +00:00
|
|
|
#[prelude_import]
|
|
|
|
#[allow(unused)]
|
|
|
|
use prelude::v1::*;
|
2014-05-02 01:06:59 +00:00
|
|
|
|
2019-10-30 19:59:15 +00:00
|
|
|
#[cfg(not(test))] // See #65860
|
2015-01-06 17:24:46 +00:00
|
|
|
#[macro_use]
|
2014-05-01 17:47:18 +00:00
|
|
|
mod macros;
|
|
|
|
|
2021-07-07 16:25:46 +00:00
|
|
|
// We don't export this through #[macro_export] for now, to avoid breakage.
|
|
|
|
// See https://github.com/rust-lang/rust/issues/82913
|
|
|
|
#[cfg(not(test))]
|
|
|
|
#[unstable(feature = "assert_matches", issue = "82775")]
|
|
|
|
/// Unstable module containing the unstable `assert_matches` macro.
|
2021-07-16 16:18:14 +00:00
|
|
|
pub mod assert_matches {
|
2021-07-07 16:25:46 +00:00
|
|
|
#[unstable(feature = "assert_matches", issue = "82775")]
|
|
|
|
pub use crate::macros::{assert_matches, debug_assert_matches};
|
|
|
|
}
|
|
|
|
|
2016-10-23 13:27:49 +00:00
|
|
|
#[macro_use]
|
|
|
|
mod internal_macros;
|
|
|
|
|
2020-09-04 14:00:38 +00:00
|
|
|
#[path = "num/shells/int_macros.rs"]
|
2015-01-06 17:24:46 +00:00
|
|
|
#[macro_use]
|
2014-12-19 04:09:57 +00:00
|
|
|
mod int_macros;
|
|
|
|
|
2020-09-04 14:00:38 +00:00
|
|
|
#[path = "num/shells/i128.rs"]
|
2019-12-22 22:42:04 +00:00
|
|
|
pub mod i128;
|
2020-09-04 14:00:38 +00:00
|
|
|
#[path = "num/shells/i16.rs"]
|
2019-12-22 22:42:04 +00:00
|
|
|
pub mod i16;
|
2020-09-04 14:00:38 +00:00
|
|
|
#[path = "num/shells/i32.rs"]
|
2019-12-22 22:42:04 +00:00
|
|
|
pub mod i32;
|
2020-09-04 14:00:38 +00:00
|
|
|
#[path = "num/shells/i64.rs"]
|
2019-12-22 22:42:04 +00:00
|
|
|
pub mod i64;
|
2020-09-04 14:00:38 +00:00
|
|
|
#[path = "num/shells/i8.rs"]
|
2019-12-22 22:42:04 +00:00
|
|
|
pub mod i8;
|
2020-09-04 14:00:38 +00:00
|
|
|
#[path = "num/shells/isize.rs"]
|
2019-12-22 22:42:04 +00:00
|
|
|
pub mod isize;
|
2016-08-23 00:56:52 +00:00
|
|
|
|
2020-09-04 14:00:38 +00:00
|
|
|
#[path = "num/shells/u128.rs"]
|
2019-12-22 22:42:04 +00:00
|
|
|
pub mod u128;
|
2020-09-04 14:00:38 +00:00
|
|
|
#[path = "num/shells/u16.rs"]
|
2019-12-22 22:42:04 +00:00
|
|
|
pub mod u16;
|
2020-09-04 14:00:38 +00:00
|
|
|
#[path = "num/shells/u32.rs"]
|
2019-12-22 22:42:04 +00:00
|
|
|
pub mod u32;
|
2020-09-04 14:00:38 +00:00
|
|
|
#[path = "num/shells/u64.rs"]
|
2019-12-22 22:42:04 +00:00
|
|
|
pub mod u64;
|
2020-09-04 14:00:38 +00:00
|
|
|
#[path = "num/shells/u8.rs"]
|
2019-12-22 22:42:04 +00:00
|
|
|
pub mod u8;
|
2020-09-04 14:00:38 +00:00
|
|
|
#[path = "num/shells/usize.rs"]
|
2019-12-22 22:42:04 +00:00
|
|
|
pub mod usize;
|
2016-08-23 00:56:52 +00:00
|
|
|
|
2019-12-22 22:42:04 +00:00
|
|
|
#[path = "num/f32.rs"]
|
|
|
|
pub mod f32;
|
|
|
|
#[path = "num/f64.rs"]
|
|
|
|
pub mod f64;
|
2014-05-01 05:23:26 +00:00
|
|
|
|
2015-04-18 06:45:55 +00:00
|
|
|
#[macro_use]
|
2014-05-01 05:14:22 +00:00
|
|
|
pub mod num;
|
|
|
|
|
2014-05-02 01:06:59 +00:00
|
|
|
/* The libcore prelude, not as all-encompassing as the libstd prelude */
|
|
|
|
|
|
|
|
pub mod prelude;
|
|
|
|
|
2014-05-01 03:04:56 +00:00
|
|
|
/* Core modules for ownership management */
|
|
|
|
|
2019-12-22 22:42:04 +00:00
|
|
|
pub mod hint;
|
2014-05-01 03:04:56 +00:00
|
|
|
pub mod intrinsics;
|
2014-05-01 03:13:05 +00:00
|
|
|
pub mod mem;
|
2014-05-01 03:17:50 +00:00
|
|
|
pub mod ptr;
|
2014-05-01 03:22:55 +00:00
|
|
|
|
|
|
|
/* Core language traits */
|
|
|
|
|
2019-12-22 22:42:04 +00:00
|
|
|
pub mod borrow;
|
|
|
|
pub mod clone;
|
2014-06-28 20:57:36 +00:00
|
|
|
pub mod cmp;
|
2019-12-22 22:42:04 +00:00
|
|
|
pub mod convert;
|
2014-05-01 03:46:51 +00:00
|
|
|
pub mod default;
|
2019-12-22 22:42:04 +00:00
|
|
|
pub mod marker;
|
|
|
|
pub mod ops;
|
2014-05-01 03:33:08 +00:00
|
|
|
|
|
|
|
/* Core types and methods on primitives */
|
|
|
|
|
2014-05-01 03:36:58 +00:00
|
|
|
pub mod any;
|
2015-02-27 19:48:51 +00:00
|
|
|
pub mod array;
|
2018-03-04 18:44:43 +00:00
|
|
|
pub mod ascii;
|
2014-05-01 18:19:56 +00:00
|
|
|
pub mod cell;
|
|
|
|
pub mod char;
|
2019-12-22 22:42:04 +00:00
|
|
|
pub mod ffi;
|
|
|
|
pub mod iter;
|
2020-07-18 00:09:47 +00:00
|
|
|
#[unstable(feature = "once_cell", issue = "74465")]
|
2020-01-14 03:34:23 +00:00
|
|
|
pub mod lazy;
|
2019-12-22 22:42:04 +00:00
|
|
|
pub mod option;
|
2018-01-23 15:31:53 +00:00
|
|
|
pub mod panic;
|
2014-10-09 19:17:22 +00:00
|
|
|
pub mod panicking;
|
2018-08-09 15:20:22 +00:00
|
|
|
pub mod pin;
|
2014-05-01 06:25:35 +00:00
|
|
|
pub mod result;
|
2020-11-13 17:24:26 +00:00
|
|
|
#[unstable(feature = "async_stream", issue = "79024")]
|
|
|
|
pub mod stream;
|
2019-12-22 22:42:04 +00:00
|
|
|
pub mod sync;
|
2015-07-13 18:57:46 +00:00
|
|
|
|
2019-12-22 22:42:04 +00:00
|
|
|
pub mod fmt;
|
2014-12-13 02:43:07 +00:00
|
|
|
pub mod hash;
|
2019-12-22 22:42:04 +00:00
|
|
|
pub mod slice;
|
|
|
|
pub mod str;
|
2017-12-11 18:42:01 +00:00
|
|
|
pub mod time;
|
2014-05-01 06:19:52 +00:00
|
|
|
|
2018-04-05 15:09:28 +00:00
|
|
|
pub mod unicode;
|
|
|
|
|
2018-05-31 01:23:10 +00:00
|
|
|
/* Async */
|
|
|
|
pub mod future;
|
|
|
|
pub mod task;
|
|
|
|
|
2018-03-28 20:37:37 +00:00
|
|
|
/* Heap memory allocator trait */
|
|
|
|
#[allow(missing_docs)]
|
2018-04-03 12:41:15 +00:00
|
|
|
pub mod alloc;
|
|
|
|
|
2014-10-31 09:41:25 +00:00
|
|
|
// note: does not need to be public
|
2019-09-07 16:04:19 +00:00
|
|
|
mod bool;
|
2014-12-19 03:13:32 +00:00
|
|
|
mod tuple;
|
2017-10-19 06:12:37 +00:00
|
|
|
mod unit;
|
2018-02-18 01:23:19 +00:00
|
|
|
|
2020-02-24 07:59:39 +00:00
|
|
|
#[stable(feature = "core_primitive", since = "1.43.0")]
|
2019-12-26 17:55:13 +00:00
|
|
|
pub mod primitive;
|
|
|
|
|
2019-01-21 17:42:04 +00:00
|
|
|
// Pull in the `core_arch` crate directly into libcore. The contents of
|
2019-07-15 11:53:44 +00:00
|
|
|
// `core_arch` are in a different repository: rust-lang/stdarch.
|
2019-01-21 17:42:04 +00:00
|
|
|
//
|
|
|
|
// `core_arch` depends on libcore, but the contents of this module are
|
|
|
|
// set up in such a way that directly pulling it here works such that the
|
|
|
|
// crate uses the this crate as its libcore.
|
2020-06-12 02:31:49 +00:00
|
|
|
#[path = "../../stdarch/crates/core_arch/src/mod.rs"]
|
2020-06-30 17:10:22 +00:00
|
|
|
#[allow(
|
|
|
|
missing_docs,
|
|
|
|
missing_debug_implementations,
|
|
|
|
dead_code,
|
|
|
|
unused_imports,
|
|
|
|
unsafe_op_in_unsafe_fn
|
|
|
|
)]
|
2021-05-06 11:36:07 +00:00
|
|
|
#[allow(rustdoc::bare_urls)]
|
2020-06-28 00:11:04 +00:00
|
|
|
// FIXME: This annotation should be moved into rust-lang/stdarch after clashing_extern_declarations is
|
2020-06-19 08:14:54 +00:00
|
|
|
// merged. It currently cannot because bootstrap fails as the lint hasn't been defined yet.
|
2020-07-16 13:12:59 +00:00
|
|
|
#[allow(clashing_extern_declarations)]
|
2018-02-18 01:23:19 +00:00
|
|
|
#[unstable(feature = "stdsimd", issue = "48556")]
|
2019-01-21 17:42:04 +00:00
|
|
|
mod core_arch;
|
2018-02-18 01:23:19 +00:00
|
|
|
|
2021-07-17 18:48:00 +00:00
|
|
|
#[doc = include_str!("../../stdarch/crates/core_arch/src/core_arch_docs.md")]
|
2018-04-03 18:11:49 +00:00
|
|
|
#[stable(feature = "simd_arch", since = "1.27.0")]
|
2021-07-17 18:48:00 +00:00
|
|
|
pub mod arch {
|
|
|
|
#[stable(feature = "simd_arch", since = "1.27.0")]
|
|
|
|
pub use crate::core_arch::arch::*;
|
|
|
|
|
|
|
|
/// Inline assembly.
|
|
|
|
///
|
|
|
|
/// Read the [unstable book] for the usage.
|
|
|
|
///
|
|
|
|
/// [unstable book]: ../../unstable-book/library-features/asm.html
|
|
|
|
#[unstable(
|
|
|
|
feature = "asm",
|
|
|
|
issue = "72016",
|
|
|
|
reason = "inline assembly is not stable enough for use and is subject to change"
|
|
|
|
)]
|
|
|
|
#[rustc_builtin_macro]
|
|
|
|
pub macro asm("assembly template", $(operands,)* $(options($(option),*))?) {
|
|
|
|
/* compiler built-in */
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Module-level inline assembly.
|
|
|
|
#[unstable(
|
|
|
|
feature = "global_asm",
|
|
|
|
issue = "35119",
|
|
|
|
reason = "`global_asm!` is not stable enough for use and is subject to change"
|
|
|
|
)]
|
|
|
|
#[rustc_builtin_macro]
|
|
|
|
pub macro global_asm("assembly template", $(operands,)* $(options($(option),*))?) {
|
|
|
|
/* compiler built-in */
|
|
|
|
}
|
|
|
|
}
|