Self: Sized,
Self: ~const Destruct,
{
- #[cfg(not(bootstrap))]
- {
- max_by(self, other, Ord::cmp)
- }
-
- #[cfg(bootstrap)]
- match self.cmp(&other) {
- Ordering::Less | Ordering::Equal => other,
- Ordering::Greater => self,
- }
+ max_by(self, other, Ord::cmp)
}
/// Compares and returns the minimum of two values.
Self: Sized,
Self: ~const Destruct,
{
- #[cfg(not(bootstrap))]
- {
- min_by(self, other, Ord::cmp)
- }
-
- #[cfg(bootstrap)]
- match self.cmp(&other) {
- Ordering::Less | Ordering::Equal => self,
- Ordering::Greater => other,
- }
+ min_by(self, other, Ord::cmp)
}
/// Restrict a value to a certain interval.
F: ~const Destruct,
K: ~const Destruct,
{
- cfg_if! {
- if #[cfg(bootstrap)] {
- const fn imp<T, F: ~const FnMut(&T) -> K, K: ~const Ord>(
- f: &mut F,
- (v1, v2): (&T, &T),
- ) -> Ordering
- where
- T: ~const Destruct,
- K: ~const Destruct,
- {
- f(v1).cmp(&f(v2))
- }
- min_by(v1, v2, ConstFnMutClosure::new(&mut f, imp))
- } else {
- min_by(v1, v2, const |v1, v2| f(v1).cmp(&f(v2)))
- }
- }
+ min_by(v1, v2, const |v1, v2| f(v1).cmp(&f(v2)))
}
/// Compares and returns the maximum of two values.
use crate::marker::Tuple;
use crate::mem;
-#[cfg(not(bootstrap))]
pub mod mir;
// These imports are used for simplifying intra-doc links
/// 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.
//!
//! # Examples
//!
-#![cfg_attr(bootstrap, doc = "```rust,compile_fail")]
-#![cfg_attr(not(bootstrap), doc = "```rust")]
+//! ```rust
//! #![feature(core_intrinsics, custom_mir)]
//!
//! extern crate core;
///
/// # Examples
///
- #[cfg_attr(bootstrap, doc = "```rust,compile_fail")]
- #[cfg_attr(not(bootstrap), doc = "```rust")]
+ /// ```rust
/// #![feature(custom_mir, core_intrinsics)]
///
/// extern crate core;
#![feature(cfg_sanitize)]
#![feature(cfg_target_has_atomic)]
#![feature(cfg_target_has_atomic_equal_alignment)]
-#![cfg_attr(not(bootstrap), feature(const_closures))]
+#![feature(const_closures)]
#![feature(const_fn_floating_point_arithmetic)]
#![feature(const_mut_refs)]
#![feature(const_precise_live_drops)]
#![feature(sse4a_target_feature)]
#![feature(tbm_target_feature)]
#![feature(wasm_target_feature)]
-#![cfg_attr(bootstrap, feature(f16c_target_feature))]
// allow using `core::` in intra-doc links
#[allow(unused_extern_crates)]
pub unsafe fn uninitialized<T>() -> T {
// SAFETY: the caller must guarantee that an uninitialized value is valid for `T`.
unsafe {
- #[cfg(not(bootstrap))] // If the compiler hits this itself then it deserves the UB.
intrinsics::assert_mem_uninitialized_valid::<T>();
let mut val = MaybeUninit::<T>::uninit();
/// Like `panic`, but without unwinding and track_caller to reduce the impact on codesize.
#[cfg_attr(not(feature = "panic_immediate_abort"), inline(never), cold)]
#[cfg_attr(feature = "panic_immediate_abort", inline)]
-#[cfg_attr(not(bootstrap), lang = "panic_nounwind")] // needed by codegen for non-unwinding panics
+#[lang = "panic_nounwind"] // needed by codegen for non-unwinding panics
#[rustc_nounwind]
pub fn panic_nounwind(expr: &'static str) -> ! {
panic_nounwind_fmt(fmt::Arguments::new_v1(&[expr], &[]));
/// any extra arguments (including those synthesized by track_caller).
#[cfg_attr(not(feature = "panic_immediate_abort"), inline(never), cold)]
#[cfg_attr(feature = "panic_immediate_abort", inline)]
-#[cfg_attr(bootstrap, lang = "panic_no_unwind")] // needed by codegen for panic in nounwind function
-#[cfg_attr(not(bootstrap), lang = "panic_cannot_unwind")] // needed by codegen for panic in nounwind function
+#[lang = "panic_cannot_unwind"] // needed by codegen for panic in nounwind function
#[rustc_nounwind]
fn panic_cannot_unwind() -> ! {
panic_nounwind("panic in a function that cannot unwind")
/// Currently, `Context` only serves to provide access to a [`&Waker`](Waker)
/// which can be used to wake the current task.
#[stable(feature = "futures_api", since = "1.36.0")]
-#[cfg_attr(not(bootstrap), lang = "Context")]
+#[lang = "Context"]
pub struct Context<'a> {
waker: &'a Waker,
// Ensure we future-proof against variance changes by forcing