diff options
| author | Caleb Zulawski <caleb.zulawski@gmail.com> | 2020-09-26 14:41:01 -0400 |
|---|---|---|
| committer | Caleb Zulawski <caleb.zulawski@gmail.com> | 2020-09-26 14:41:01 -0400 |
| commit | 88bfbb001e291ba97b3b6d6cea3456bbd4fbf640 (patch) | |
| tree | 5e2cec864e79c1608a453165255c03195e74ea00 | |
| parent | b9bf9ef3c2dab2d38f964f13154e517515e8e2f3 (diff) | |
| download | rust-88bfbb001e291ba97b3b6d6cea3456bbd4fbf640.tar.gz rust-88bfbb001e291ba97b3b6d6cea3456bbd4fbf640.zip | |
Mark trait methods inline
| -rw-r--r-- | crates/core_simd/src/macros.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/crates/core_simd/src/macros.rs b/crates/core_simd/src/macros.rs index 165029cca5e..2f93db19035 100644 --- a/crates/core_simd/src/macros.rs +++ b/crates/core_simd/src/macros.rs @@ -141,24 +141,28 @@ macro_rules! base_vector_traits { impl Copy for $name {} impl Clone for $name { + #[inline] fn clone(&self) -> Self { *self } } impl Default for $name { + #[inline] fn default() -> Self { Self::splat(<$type>::default()) } } impl PartialEq for $name { + #[inline] fn eq(&self, other: &Self) -> bool { AsRef::<[$type]>::as_ref(self) == AsRef::<[$type]>::as_ref(other) } } impl PartialOrd for $name { + #[inline] fn partial_cmp(&self, other: &Self) -> Option<core::cmp::Ordering> { AsRef::<[$type]>::as_ref(self).partial_cmp(AsRef::<[$type]>::as_ref(other)) } @@ -213,12 +217,14 @@ macro_rules! integer_vector_traits { impl Eq for $name {} impl Ord for $name { + #[inline] fn cmp(&self, other: &Self) -> core::cmp::Ordering { AsRef::<[$type]>::as_ref(self).cmp(AsRef::<[$type]>::as_ref(other)) } } impl core::hash::Hash for $name { + #[inline] fn hash<H>(&self, state: &mut H) where H: core::hash::Hasher |
