From cdff2f3b3083f602736653e1428b5113dd2e7eee Mon Sep 17 00:00:00 2001 From: Matt Brubeck Date: Fri, 29 Jun 2018 11:49:32 -0700 Subject: impl Clone for Box, Box, Box Implements #51908. --- src/libstd/ffi/c_str.rs | 8 ++++++++ src/libstd/ffi/os_str.rs | 8 ++++++++ src/libstd/path.rs | 8 ++++++++ 3 files changed, 24 insertions(+) (limited to 'src/libstd') diff --git a/src/libstd/ffi/c_str.rs b/src/libstd/ffi/c_str.rs index 6513d11dd51..b816f4b7850 100644 --- a/src/libstd/ffi/c_str.rs +++ b/src/libstd/ffi/c_str.rs @@ -706,6 +706,14 @@ impl From> for CString { } } +#[stable(feature = "more_box_slice_clone", since = "1.29.0")] +impl Clone for Box { + #[inline] + fn clone(&self) -> Self { + (**self).into() + } +} + #[stable(feature = "box_from_c_string", since = "1.20.0")] impl From for Box { #[inline] diff --git a/src/libstd/ffi/os_str.rs b/src/libstd/ffi/os_str.rs index 0a3148029d0..b522d134837 100644 --- a/src/libstd/ffi/os_str.rs +++ b/src/libstd/ffi/os_str.rs @@ -628,6 +628,14 @@ impl From for Box { } } +#[stable(feature = "more_box_slice_clone", since = "1.29.0")] +impl Clone for Box { + #[inline] + fn clone(&self) -> Self { + self.to_os_string().into_boxed_os_str() + } +} + #[stable(feature = "shared_from_slice2", since = "1.24.0")] impl From for Arc { #[inline] diff --git a/src/libstd/path.rs b/src/libstd/path.rs index 3dc1e9c3dad..2d868629278 100644 --- a/src/libstd/path.rs +++ b/src/libstd/path.rs @@ -1410,6 +1410,14 @@ impl From for Box { } } +#[stable(feature = "more_box_slice_clone", since = "1.29.0")] +impl Clone for Box { + #[inline] + fn clone(&self) -> Self { + self.to_path_buf().into_boxed_path() + } +} + #[stable(feature = "rust1", since = "1.0.0")] impl<'a, T: ?Sized + AsRef> From<&'a T> for PathBuf { fn from(s: &'a T) -> PathBuf { -- cgit 1.4.1-3-g733a5 From e488cba6784eebc36b9869239b729a4e41048d3f Mon Sep 17 00:00:00 2001 From: Matt Kraai Date: Wed, 11 Jul 2018 17:19:41 -0700 Subject: Uncapitalize "If" --- src/libstd/sync/mpsc/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libstd') diff --git a/src/libstd/sync/mpsc/mod.rs b/src/libstd/sync/mpsc/mod.rs index 2dd3aebe610..cbda5afadcd 100644 --- a/src/libstd/sync/mpsc/mod.rs +++ b/src/libstd/sync/mpsc/mod.rs @@ -689,7 +689,7 @@ impl UnsafeFlavor for Receiver { /// only one [`Receiver`] is supported. /// /// If the [`Receiver`] is disconnected while trying to [`send`] with the -/// [`Sender`], the [`send`] method will return a [`SendError`]. Similarly, If the +/// [`Sender`], the [`send`] method will return a [`SendError`]. Similarly, if the /// [`Sender`] is disconnected while trying to [`recv`], the [`recv`] method will /// return a [`RecvError`]. /// -- cgit 1.4.1-3-g733a5 From e9a88eaaf9a42785aa91b67281ab265ba85bc43e Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Thu, 12 Jul 2018 12:48:10 +0200 Subject: make reference to dirs crate clickable in terminals --- src/libstd/env.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libstd') diff --git a/src/libstd/env.rs b/src/libstd/env.rs index c0e1e2533a0..9066c0b7694 100644 --- a/src/libstd/env.rs +++ b/src/libstd/env.rs @@ -541,7 +541,7 @@ impl Error for JoinPathsError { /// ``` #[rustc_deprecated(since = "1.29.0", reason = "This function's behavior is unexpected and probably not what you want. \ - Consider using the home_dir function from crates.io/crates/dirs instead.")] + Consider using the home_dir function from https://crates.io/crates/dirs instead.")] #[stable(feature = "env", since = "1.0.0")] pub fn home_dir() -> Option { os_imp::home_dir() -- cgit 1.4.1-3-g733a5