about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-07-12 12:50:13 +0000
committerbors <bors@rust-lang.org>2018-07-12 12:50:13 +0000
commit7db82ccd765cbfe55c3d8a2c434bc6f9b986843d (patch)
tree41bda55edea65f5ef3f02b198ce2984b97e666e2 /src/libstd
parentd334027c58060449cc45b8e5cc37dd51ca077d30 (diff)
parenta7c2c68b135b40666bda030315007c29ce197901 (diff)
downloadrust-7db82ccd765cbfe55c3d8a2c434bc6f9b986843d.tar.gz
rust-7db82ccd765cbfe55c3d8a2c434bc6f9b986843d.zip
Auto merge of #52303 - kennytm:rollup, r=kennytm
Rollup of 9 pull requests

Successful merges:

 - #51816 (bootstrap: write texts to a .tmp file first for atomicity)
 - #51912 (impl Clone for Box<CStr>, Box<OsStr>, Box<Path>)
 - #52164 (use proper footnote syntax for references)
 - #52220 (Deny bare trait objects in `src/bootstrap`)
 - #52276 (rustc: Verify #[proc_macro] is only a word)
 - #52277 (Uncapitalize "If")
 - #52287 (Deny bare trait objects in src/librustc_resolve)
 - #52295 (Deny bare trait objects in src/libsyntax_ext)
 - #52298 (make reference to dirs crate clickable in terminals)

Failed merges:

r? @ghost
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/env.rs2
-rw-r--r--src/libstd/ffi/c_str.rs8
-rw-r--r--src/libstd/ffi/os_str.rs8
-rw-r--r--src/libstd/path.rs8
-rw-r--r--src/libstd/sync/mpsc/mod.rs2
5 files changed, 26 insertions, 2 deletions
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<PathBuf> {
     os_imp::home_dir()
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<Box<CStr>> for CString {
     }
 }
 
+#[stable(feature = "more_box_slice_clone", since = "1.29.0")]
+impl Clone for Box<CStr> {
+    #[inline]
+    fn clone(&self) -> Self {
+        (**self).into()
+    }
+}
+
 #[stable(feature = "box_from_c_string", since = "1.20.0")]
 impl From<CString> for Box<CStr> {
     #[inline]
diff --git a/src/libstd/ffi/os_str.rs b/src/libstd/ffi/os_str.rs
index 4ada6a77a8e..b1c6e7af693 100644
--- a/src/libstd/ffi/os_str.rs
+++ b/src/libstd/ffi/os_str.rs
@@ -642,6 +642,14 @@ impl From<OsString> for Box<OsStr> {
     }
 }
 
+#[stable(feature = "more_box_slice_clone", since = "1.29.0")]
+impl Clone for Box<OsStr> {
+    #[inline]
+    fn clone(&self) -> Self {
+        self.to_os_string().into_boxed_os_str()
+    }
+}
+
 #[stable(feature = "shared_from_slice2", since = "1.24.0")]
 impl From<OsString> for Arc<OsStr> {
     #[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<PathBuf> for Box<Path> {
     }
 }
 
+#[stable(feature = "more_box_slice_clone", since = "1.29.0")]
+impl Clone for Box<Path> {
+    #[inline]
+    fn clone(&self) -> Self {
+        self.to_path_buf().into_boxed_path()
+    }
+}
+
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<'a, T: ?Sized + AsRef<OsStr>> From<&'a T> for PathBuf {
     fn from(s: &'a T) -> PathBuf {
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<T> UnsafeFlavor<T> for Receiver<T> {
 /// 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`].
 ///