about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCaleb Zulawski <caleb.zulawski@gmail.com>2020-09-23 08:11:43 -0400
committerGitHub <noreply@github.com>2020-09-23 08:11:43 -0400
commitc74eec7e25d0ab505dbb8f31d2e63839e5384c15 (patch)
treec2aa65350283a8b4d842544b7be034ce87f8e060
parent0f837a9147a1ba22cfb12a4480ce1c18d3afc6b8 (diff)
downloadrust-c74eec7e25d0ab505dbb8f31d2e63839e5384c15.tar.gz
rust-c74eec7e25d0ab505dbb8f31d2e63839e5384c15.zip
Apply suggestions from code review
Co-authored-by: Lokathor <zefria@gmail.com>
-rw-r--r--crates/core_simd/src/lib.rs2
-rw-r--r--crates/core_simd/src/macros.rs9
2 files changed, 6 insertions, 5 deletions
diff --git a/crates/core_simd/src/lib.rs b/crates/core_simd/src/lib.rs
index 8db640157ee..b4fc58476f8 100644
--- a/crates/core_simd/src/lib.rs
+++ b/crates/core_simd/src/lib.rs
@@ -1,5 +1,5 @@
 #![feature(repr_simd)]
-
+#![warn(missing_docs)]
 #[macro_use]
 mod macros;
 
diff --git a/crates/core_simd/src/macros.rs b/crates/core_simd/src/macros.rs
index 64d9c4b217f..91c1071a2ee 100644
--- a/crates/core_simd/src/macros.rs
+++ b/crates/core_simd/src/macros.rs
@@ -69,6 +69,7 @@ macro_rules! define_type {
 
         // splat
         impl From<$type> for $name {
+            #[inline]
             fn from(value: $type) -> Self {
                 Self::splat(value)
             }
@@ -126,16 +127,16 @@ macro_rules! define_type {
         pub struct $name($($itype),*);
 
         impl $name {
-            /// Construct a vector by setting each lane to a single value.
+            /// Construct a vector by setting all lanes to the given value.
             #[inline]
-            pub fn splat(value: $type) -> Self {
+            pub const fn splat(value: $type) -> Self {
                 Self($(value as $itype),*)
             }
 
-            /// Construct a vector by setting each lane.
+            /// Construct a vector by setting each lane to the given values.
             #[allow(clippy::too_many_arguments)]
             #[inline]
-            pub fn new($($ivar: $itype),*) -> Self {
+            pub const fn new($($ivar: $itype),*) -> Self {
                 Self($($ivar),*)
             }
         }