diff options
| author | Francis Gagné <fragag1@gmail.com> | 2018-03-10 17:43:44 -0500 |
|---|---|---|
| committer | Francis Gagné <fragag1@gmail.com> | 2018-03-26 23:42:30 -0400 |
| commit | afa7f5bc8ac79503bb99a20a1dd19365318f504f (patch) | |
| tree | 2a25faac7b80b3037cb70fbf6574054aee205605 | |
| parent | f48c043154aeed1af44e6be66b17122fafacda51 (diff) | |
| download | rust-afa7f5bc8ac79503bb99a20a1dd19365318f504f.tar.gz rust-afa7f5bc8ac79503bb99a20a1dd19365318f504f.zip | |
Add #[inline] to Clone impls for primitive types
| -rw-r--r-- | src/libcore/clone.rs | 5 |
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 } |
