about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFrancis Gagné <fragag1@gmail.com>2018-03-10 17:43:44 -0500
committerFrancis Gagné <fragag1@gmail.com>2018-03-26 23:42:30 -0400
commitafa7f5bc8ac79503bb99a20a1dd19365318f504f (patch)
tree2a25faac7b80b3037cb70fbf6574054aee205605
parentf48c043154aeed1af44e6be66b17122fafacda51 (diff)
downloadrust-afa7f5bc8ac79503bb99a20a1dd19365318f504f.tar.gz
rust-afa7f5bc8ac79503bb99a20a1dd19365318f504f.zip
Add #[inline] to Clone impls for primitive types
-rw-r--r--src/libcore/clone.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libcore/clone.rs b/src/libcore/clone.rs
index b6a5948e645..f8e8c69621a 100644
--- a/src/libcore/clone.rs
+++ b/src/libcore/clone.rs
@@ -162,6 +162,7 @@ mod impls {
             $(
                 #[stable(feature = "rust1", since = "1.0.0")]
                 impl Clone for $t {
+                    #[inline]
                     fn clone(&self) -> Self {
                         *self
                     }
@@ -179,6 +180,7 @@ mod impls {
 
     #[stable(feature = "never_type", since = "1.26.0")]
     impl Clone for ! {
+        #[inline]
         fn clone(&self) -> Self {
             *self
         }
@@ -186,6 +188,7 @@ mod impls {
 
     #[stable(feature = "rust1", since = "1.0.0")]
     impl<T: ?Sized> Clone for *const T {
+        #[inline]
         fn clone(&self) -> Self {
             *self
         }
@@ -193,6 +196,7 @@ mod impls {
 
     #[stable(feature = "rust1", since = "1.0.0")]
     impl<T: ?Sized> Clone for *mut T {
+        #[inline]
         fn clone(&self) -> Self {
             *self
         }
@@ -201,6 +205,7 @@ mod impls {
     // Shared references can be cloned, but mutable references *cannot*!
     #[stable(feature = "rust1", since = "1.0.0")]
     impl<'a, T: ?Sized> Clone for &'a T {
+        #[inline]
         fn clone(&self) -> Self {
             *self
         }