diff options
Diffstat (limited to '')
-rw-r--r-- | library/core/src/intrinsics.rs | 6 | ||||
-rw-r--r-- | library/core/src/intrinsics/mir.rs | 18 |
2 files changed, 15 insertions, 9 deletions
diff --git a/library/core/src/intrinsics.rs b/library/core/src/intrinsics.rs index a315a28fb..18a90599c 100644 --- a/library/core/src/intrinsics.rs +++ b/library/core/src/intrinsics.rs @@ -58,7 +58,6 @@ use crate::marker::DiscriminantKind; use crate::marker::Tuple; use crate::mem; -#[cfg(not(bootstrap))] pub mod mir; // These imports are used for simplifying intra-doc links @@ -963,7 +962,6 @@ extern "rust-intrinsic" { /// This intrinsic does not have a stable counterpart. #[rustc_const_unstable(feature = "const_assert_type2", issue = "none")] #[rustc_safe_intrinsic] - #[cfg(not(bootstrap))] pub fn assert_mem_uninitialized_valid<T>(); /// Gets a reference to a static `Location` indicating where it was called. @@ -2095,6 +2093,10 @@ extern "rust-intrinsic" { /// Above some backend-decided threshold this will emit calls to `memcmp`, /// like slice equality does, instead of causing massive code size. /// + /// Since this works by comparing the underlying bytes, the actual `T` is + /// not particularly important. It will be used for its size and alignment, + /// but any validity restrictions will be ignored, not enforced. + /// /// # Safety /// /// It's UB to call this if any of the *bytes* in `*a` or `*b` are uninitialized or carry a diff --git a/library/core/src/intrinsics/mir.rs b/library/core/src/intrinsics/mir.rs index e3157b669..72db1d87c 100644 --- a/library/core/src/intrinsics/mir.rs +++ b/library/core/src/intrinsics/mir.rs @@ -42,7 +42,7 @@ //! another function. The `dialect` and `phase` parameters indicate which [version of MIR][dialect //! docs] you are inserting here. Generally you'll want to use `#![custom_mir(dialect = "built")]` //! if you want your MIR to be modified by the full MIR pipeline, or `#![custom_mir(dialect = -//! "runtime", phase = "optimized")] if you don't. +//! "runtime", phase = "optimized")]` if you don't. //! //! [dialect docs]: //! https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/enum.MirPhase.html @@ -60,8 +60,7 @@ //! //! # Examples //! -#![cfg_attr(bootstrap, doc = "```rust,compile_fail")] -#![cfg_attr(not(bootstrap), doc = "```rust")] +//! ```rust //! #![feature(core_intrinsics, custom_mir)] //! //! extern crate core; @@ -211,13 +210,16 @@ //! //! #### Statements //! - Assign statements work via normal Rust assignment. -//! - [`Retag`] statements have an associated function. +//! - [`Retag`], [`StorageLive`], [`StorageDead`], [`Deinit`] statements have an associated function. //! //! #### Rvalues //! //! - Operands implicitly convert to `Use` rvalues. //! - `&`, `&mut`, `addr_of!`, and `addr_of_mut!` all work to create their associated rvalue. -//! - [`Discriminant`] has an associated function. +//! - [`Discriminant`] and [`Len`] have associated functions. +//! - Unary and binary operations use their normal Rust syntax - `a * b`, `!c`, etc. +//! - Checked binary operations are represented by wrapping the associated binop in [`Checked`]. +//! - Array repetition syntax (`[foo; 10]`) creates the associated rvalue. //! //! #### Terminators //! @@ -261,6 +263,9 @@ define!("mir_drop_and_replace", fn DropAndReplace<T>(place: T, value: T, goto: B define!("mir_call", fn Call<T>(place: T, goto: BasicBlock, call: T)); define!("mir_storage_live", fn StorageLive<T>(local: T)); define!("mir_storage_dead", fn StorageDead<T>(local: T)); +define!("mir_deinit", fn Deinit<T>(place: T)); +define!("mir_checked", fn Checked<T>(binop: T) -> (T, bool)); +define!("mir_len", fn Len<T>(place: T) -> usize); define!("mir_retag", fn Retag<T>(place: T)); define!("mir_move", fn Move<T>(place: T) -> T); define!("mir_static", fn Static<T>(s: T) -> &'static T); @@ -294,8 +299,7 @@ define!( /// /// # Examples /// - #[cfg_attr(bootstrap, doc = "```rust,compile_fail")] - #[cfg_attr(not(bootstrap), doc = "```rust")] + /// ```rust /// #![feature(custom_mir, core_intrinsics)] /// /// extern crate core; |