/// Any use other than with `if` statements will probably not have an effect.
///
/// This intrinsic does not have a stable counterpart.
+ #[rustc_const_unstable(feature = "const_likely", issue = "none")]
pub fn likely(b: bool) -> bool;
/// Hints to the compiler that branch condition is likely to be false.
/// Any use other than with `if` statements will probably not have an effect.
///
/// This intrinsic does not have a stable counterpart.
+ #[rustc_const_unstable(feature = "const_likely", issue = "none")]
pub fn unlikely(b: bool) -> bool;
/// Executes a breakpoint trap, for inspection by a debugger.
#![feature(const_slice_from_raw_parts)]
#![feature(const_slice_ptr_len)]
#![feature(const_type_name)]
+#![feature(const_likely)]
#![feature(custom_inner_attributes)]
#![feature(decl_macro)]
#![feature(doc_cfg)]
);
self.copy_op(self.operand_index(args[0], index)?, dest)?;
}
+ sym::likely | sym::unlikely => {
+ // These just return their argument
+ let a = self.read_immediate(args[0])?;
+ self.write_immediate(*a, dest)?;
+ }
// FIXME(#73156): Handle source code coverage in const eval
sym::count_code_region => (),
_ => return Ok(false),
lhs,
lib,
lifetime,
+ likely,
line,
link,
linkage,
underscore_lifetimes,
uniform_paths,
universal_impl_trait,
+ unlikely,
unmarked_api,
unreachable_code,
unrestricted_attribute_tokens,