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))]
|
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_root_url = "https://doc.rust-lang.org/nightly/",
|
|
|
|
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]
|
2018-12-21 10:08:26 +00:00
|
|
|
#![warn(deprecated_in_future)]
|
2019-01-28 09:49:11 +00:00
|
|
|
#![warn(missing_docs)]
|
|
|
|
#![warn(missing_debug_implementations)]
|
2019-04-15 02:23:21 +00:00
|
|
|
#![allow(explicit_outlives_requirements)]
|
2020-11-19 20:01:48 +00:00
|
|
|
#![feature(rustc_allow_const_fn_unstable)]
|
2015-08-11 21:31:23 +00:00
|
|
|
#![feature(allow_internal_unstable)]
|
2018-05-23 00:07:51 +00:00
|
|
|
#![feature(arbitrary_self_types)]
|
2016-05-04 14:08:21 +00:00
|
|
|
#![feature(asm)]
|
2017-03-17 14:05:44 +00:00
|
|
|
#![feature(cfg_target_has_atomic)]
|
2020-12-30 13:04:59 +00:00
|
|
|
#![feature(const_heap)]
|
2019-12-31 23:25:20 +00:00
|
|
|
#![feature(const_alloc_layout)]
|
2020-12-02 15:17:37 +00:00
|
|
|
#![feature(const_assert_type)]
|
2020-03-08 13:24:32 +00:00
|
|
|
#![feature(const_discriminant)]
|
2020-11-04 10:41:57 +00:00
|
|
|
#![feature(const_cell_into_inner)]
|
2020-12-26 01:25:08 +00:00
|
|
|
#![feature(const_intrinsic_copy)]
|
2021-01-18 21:59:56 +00:00
|
|
|
#![feature(const_intrinsic_forget)]
|
2020-08-22 19:25:39 +00:00
|
|
|
#![feature(const_float_classify)]
|
2020-08-22 19:24:35 +00:00
|
|
|
#![feature(const_float_bits_conv)]
|
2020-02-03 20:49:31 +00:00
|
|
|
#![feature(const_int_unchecked_arith)]
|
2021-05-09 00:18:44 +00:00
|
|
|
#![feature(const_inherent_unchecked_arith)]
|
2020-09-17 18:02:56 +00:00
|
|
|
#![feature(const_mut_refs)]
|
2021-01-18 21:59:56 +00:00
|
|
|
#![feature(const_refs_to_cell)]
|
2019-12-27 01:59:55 +00:00
|
|
|
#![feature(const_panic)]
|
2020-09-12 23:55:34 +00:00
|
|
|
#![feature(const_pin)]
|
2021-04-18 17:02:33 +00:00
|
|
|
#![cfg_attr(bootstrap, feature(const_fn))]
|
2020-09-20 15:22:17 +00:00
|
|
|
#![feature(const_fn_union)]
|
2020-11-19 20:01:48 +00:00
|
|
|
#![feature(const_impl_trait)]
|
2020-10-07 22:56:26 +00:00
|
|
|
#![feature(const_fn_floating_point_arithmetic)]
|
|
|
|
#![feature(const_fn_fn_ptr_basics)]
|
2021-04-18 16:36:41 +00:00
|
|
|
#![cfg_attr(not(bootstrap), feature(const_fn_trait_bound))]
|
2020-07-01 13:07:23 +00:00
|
|
|
#![feature(const_option)]
|
2020-07-30 19:30:56 +00:00
|
|
|
#![feature(const_precise_live_drops)]
|
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)]
|
2020-12-02 02:01:18 +00:00
|
|
|
#![feature(const_raw_ptr_deref)]
|
2020-05-06 05:43:18 +00:00
|
|
|
#![feature(const_slice_from_raw_parts)]
|
|
|
|
#![feature(const_slice_ptr_len)]
|
2020-07-29 21:56:58 +00:00
|
|
|
#![feature(const_size_of_val)]
|
2021-03-13 19:33:27 +00:00
|
|
|
#![feature(const_swap)]
|
2020-07-29 21:56:58 +00:00
|
|
|
#![feature(const_align_of_val)]
|
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-06-26 12:19:50 +00:00
|
|
|
#![feature(const_likely)]
|
2020-07-17 19:57:13 +00:00
|
|
|
#![feature(const_unreachable_unchecked)]
|
2020-12-02 15:17:37 +00:00
|
|
|
#![feature(const_maybe_uninit_assume_init)]
|
2020-12-07 23:05:26 +00:00
|
|
|
#![feature(const_maybe_uninit_as_ptr)]
|
2019-06-29 11:06:22 +00:00
|
|
|
#![feature(custom_inner_attributes)]
|
2019-06-29 14:51:20 +00:00
|
|
|
#![feature(decl_macro)]
|
2018-03-09 19:31:04 +00:00
|
|
|
#![feature(doc_cfg)]
|
2021-03-09 03:35:53 +00:00
|
|
|
#![cfg_attr(bootstrap, feature(doc_spotlight))]
|
|
|
|
#![cfg_attr(not(bootstrap), feature(doc_notable_trait))]
|
2020-05-21 19:22:47 +00:00
|
|
|
#![feature(duration_consts_2)]
|
Stabilize extended_key_value_attributes
# Stabilization report
## Summary
This stabilizes using macro expansion in key-value attributes, like so:
```rust
#[doc = include_str!("my_doc.md")]
struct S;
#[path = concat!(env!("OUT_DIR"), "/generated.rs")]
mod m;
```
See the changes to the reference for details on what macros are allowed;
see Petrochenkov's excellent blog post [on internals](https://internals.rust-lang.org/t/macro-expansion-points-in-attributes/11455)
for alternatives that were considered and rejected ("why accept no more
and no less?")
This has been available on nightly since 1.50 with no major issues.
## Notes
### Accepted syntax
The parser accepts arbitrary Rust expressions in this position, but any expression other than a macro invocation will ultimately lead to an error because it is not expected by the built-in expression forms (e.g., `#[doc]`). Note that decorators and the like may be able to observe other expression forms.
### Expansion ordering
Expansion of macro expressions in "inert" attributes occurs after decorators have executed, analogously to macro expressions appearing in the function body or other parts of decorator input.
There is currently no way for decorators to accept macros in key-value position if macro expansion must be performed before the decorator executes (if the macro can simply be copied into the output for later expansion, that can work).
## Test cases
- https://github.com/rust-lang/rust/blob/master/src/test/ui/attributes/key-value-expansion-on-mac.rs
- https://github.com/rust-lang/rust/blob/master/src/test/rustdoc/external-doc.rs
The feature has also been dogfooded extensively in the compiler and
standard library:
- https://github.com/rust-lang/rust/pull/83329
- https://github.com/rust-lang/rust/pull/83230
- https://github.com/rust-lang/rust/pull/82641
- https://github.com/rust-lang/rust/pull/80534
## Implementation history
- Initial proposal: https://github.com/rust-lang/rust/issues/55414#issuecomment-554005412
- Experiment to see how much code it would break: https://github.com/rust-lang/rust/pull/67121
- Preliminary work to restrict expansion that would conflict with this
feature: https://github.com/rust-lang/rust/pull/77271
- Initial implementation: https://github.com/rust-lang/rust/pull/78837
- Fix for an ICE: https://github.com/rust-lang/rust/pull/80563
## Unresolved Questions
~~https://github.com/rust-lang/rust/pull/83366#issuecomment-805180738 listed some concerns, but they have been resolved as of this final report.~~
## Additional Information
There are two workarounds that have a similar effect for `#[doc]`
attributes on nightly. One is to emulate this behavior by using a limited version of this feature that was stabilized for historical reasons:
```rust
macro_rules! forward_inner_docs {
($e:expr => $i:item) => {
#[doc = $e]
$i
};
}
forward_inner_docs!(include_str!("lib.rs") => struct S {});
```
This also works for other attributes (like `#[path = concat!(...)]`).
The other is to use `doc(include)`:
```rust
#![feature(external_doc)]
#[doc(include = "lib.rs")]
struct S {}
```
The first works, but is non-trivial for people to discover, and
difficult to read and maintain. The second is a strange special-case for
a particular use of the macro. This generalizes it to work for any use
case, not just including files.
I plan to remove `doc(include)` when this is stabilized. The
`forward_inner_docs` workaround will still compile without warnings, but
I expect it to be used less once it's no longer necessary.
2021-03-22 05:10:10 +00:00
|
|
|
#![cfg_attr(bootstrap, feature(extended_key_value_attributes))]
|
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)]
|
2020-04-22 19:45:35 +00:00
|
|
|
#![feature(negative_impls)]
|
2019-12-11 14:55:29 +00:00
|
|
|
#![feature(never_type)]
|
2018-09-26 21:26:46 +00:00
|
|
|
#![feature(nll)]
|
2018-01-21 08:44:41 +00:00
|
|
|
#![feature(exhaustive_patterns)]
|
2015-08-11 21:31:23 +00:00
|
|
|
#![feature(no_core)]
|
2020-12-30 13:04:59 +00:00
|
|
|
#![feature(auto_traits)]
|
2020-11-21 21:18:04 +00:00
|
|
|
#![cfg_attr(bootstrap, feature(or_patterns))]
|
2017-03-17 14:05:44 +00:00
|
|
|
#![feature(prelude_import)]
|
2021-03-26 20:10:21 +00:00
|
|
|
#![feature(ptr_metadata)]
|
2015-12-11 21:07:11 +00:00
|
|
|
#![feature(repr_simd, platform_intrinsics)]
|
2016-03-10 19:20:09 +00:00
|
|
|
#![feature(rustc_attrs)]
|
2018-02-18 01:23:19 +00:00
|
|
|
#![feature(simd_ffi)]
|
2020-08-17 18:34:44 +00:00
|
|
|
#![feature(min_specialization)]
|
2015-01-30 20:26:44 +00:00
|
|
|
#![feature(staged_api)]
|
2019-02-01 11:43:29 +00:00
|
|
|
#![feature(std_internals)]
|
2018-02-18 01:23:19 +00:00
|
|
|
#![feature(stmt_expr_attributes)]
|
2020-10-01 17:06:44 +00:00
|
|
|
#![feature(str_split_as_str)]
|
2020-10-01 20:39:20 +00:00
|
|
|
#![feature(str_split_inclusive_as_str)]
|
2021-02-27 11:45:18 +00:00
|
|
|
#![feature(char_indices_offset)]
|
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)]
|
2017-03-17 14:05:44 +00:00
|
|
|
#![feature(unwind_attributes)]
|
2020-07-16 13:12:59 +00:00
|
|
|
#![feature(variant_count)]
|
2018-05-10 18:02:19 +00:00
|
|
|
#![feature(tbm_target_feature)]
|
|
|
|
#![feature(sse4a_target_feature)]
|
|
|
|
#![feature(arm_target_feature)]
|
|
|
|
#![feature(powerpc_target_feature)]
|
|
|
|
#![feature(mips_target_feature)]
|
|
|
|
#![feature(aarch64_target_feature)]
|
2018-08-15 17:51:24 +00:00
|
|
|
#![feature(wasm_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(rtm_target_feature)]
|
|
|
|
#![feature(f16c_target_feature)]
|
2018-08-10 17:01:18 +00:00
|
|
|
#![feature(hexagon_target_feature)]
|
2020-07-16 13:12:59 +00:00
|
|
|
#![feature(const_fn_transmute)]
|
2019-01-07 15:20:25 +00:00
|
|
|
#![feature(abi_unadjusted)]
|
2019-01-19 23:25:06 +00:00
|
|
|
#![feature(adx_target_feature)]
|
2019-02-11 14:29:25 +00:00
|
|
|
#![feature(external_doc)]
|
2019-07-31 19:00:35 +00:00
|
|
|
#![feature(associated_type_bounds)]
|
2019-12-20 22:15:50 +00:00
|
|
|
#![feature(const_caller_location)]
|
2020-07-05 16:39:04 +00:00
|
|
|
#![feature(slice_ptr_get)]
|
2020-03-15 18:43:25 +00:00
|
|
|
#![feature(no_niche)] // rust-lang/rust#68303
|
2021-05-03 15:47:43 +00:00
|
|
|
#![cfg_attr(not(bootstrap), feature(no_coverage))] // rust-lang/rust#84605
|
2020-10-26 18:14:12 +00:00
|
|
|
#![feature(int_error_matching)]
|
2020-06-30 17:10:22 +00:00
|
|
|
#![deny(unsafe_op_in_unsafe_fn)]
|
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;
|
|
|
|
|
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 03:38:31 +00:00
|
|
|
pub mod raw;
|
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-03-28 03:35:02 +00:00
|
|
|
#[cfg_attr(bootstrap, allow(rustdoc::non_autolinks))]
|
|
|
|
#[cfg_attr(not(bootstrap), 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
|
|
|
|
2018-04-03 18:11:49 +00:00
|
|
|
#[stable(feature = "simd_arch", since = "1.27.0")]
|
2019-01-21 17:42:04 +00:00
|
|
|
pub use core_arch::arch;
|