From 91a4849bbad098dcc9afaf3f6acd186c23401e60 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 19 Jun 2017 12:21:12 -0700 Subject: [PATCH] Add #[inline] to cast methods Avoids function calls in release builds! --- library/stdarch/src/macros.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/library/stdarch/src/macros.rs b/library/stdarch/src/macros.rs index bf84f7151a42..aadb986052fd 100644 --- a/library/stdarch/src/macros.rs +++ b/library/stdarch/src/macros.rs @@ -249,6 +249,7 @@ macro_rules! define_casts { ($(($ty:ident, $floatty:ident, $floatcast:ident)),+) => { $( impl $ty { + #[inline] pub fn $floatcast(self) -> ::$floatty { unsafe { simd_cast(self) } }