Make some trivial functions #[inline(always)]

This commit is contained in:
Eduardo Sánchez Muñoz
2022-12-07 17:11:17 +01:00
parent 91b8f34ac2
commit 00e7b54d46
9 changed files with 33 additions and 25 deletions

View File

@@ -160,7 +160,7 @@ pub const unsafe fn unreachable_unchecked() -> ! {
/// ```
///
/// [`thread::yield_now`]: ../../std/thread/fn.yield_now.html
#[inline]
#[inline(always)]
#[stable(feature = "renamed_spin_loop", since = "1.49.0")]
pub fn spin_loop() {
#[cfg(target_arch = "x86")]
@@ -345,6 +345,7 @@ pub const fn black_box<T>(dummy: T) -> T {
#[unstable(feature = "hint_must_use", issue = "94745")]
#[rustc_const_unstable(feature = "hint_must_use", issue = "94745")]
#[must_use] // <-- :)
#[inline(always)]
pub const fn must_use<T>(value: T) -> T {
value
}