summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-11-09 11:58:25 -0800
committerGitHub <noreply@github.com>2016-11-09 11:58:25 -0800
commitda2ce2276873242a101f205537e7ce297d68f8dd (patch)
treeb0de0fa6de932ca2ebeb973b7c92014903edb54e /src/libstd
parentbca365e688f0424fb99d38d477a9b7863bb070d3 (diff)
parent60c74b76c4698d0223223e42853c5a89fd33fd09 (diff)
downloadrust-da2ce2276873242a101f205537e7ce297d68f8dd.tar.gz
rust-da2ce2276873242a101f205537e7ce297d68f8dd.zip
Auto merge of #37670 - eddyb:rollup, r=eddyb
Rollup of 15 pull requests

- Successful merges: #36868, #37134, #37229, #37250, #37370, #37428, #37432, #37472, #37524, #37614, #37622, #37627, #37636, #37644, #37654
- Failed merges: #37463, #37542, #37645
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/ffi/c_str.rs2
-rw-r--r--src/libstd/net/udp.rs3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/libstd/ffi/c_str.rs b/src/libstd/ffi/c_str.rs
index 3ad5b5627d3..d1b8fcd7440 100644
--- a/src/libstd/ffi/c_str.rs
+++ b/src/libstd/ffi/c_str.rs
@@ -686,7 +686,7 @@ impl ToOwned for CStr {
     type Owned = CString;
 
     fn to_owned(&self) -> CString {
-        unsafe { CString::from_vec_unchecked(self.to_bytes().to_vec()) }
+        CString { inner: self.to_bytes_with_nul().to_vec().into_boxed_slice() }
     }
 }
 
diff --git a/src/libstd/net/udp.rs b/src/libstd/net/udp.rs
index c03ac496adb..559250adac5 100644
--- a/src/libstd/net/udp.rs
+++ b/src/libstd/net/udp.rs
@@ -67,6 +67,9 @@ impl UdpSocket {
     ///
     /// Address type can be any implementor of `ToSocketAddrs` trait. See its
     /// documentation for concrete examples.
+    /// This will return an error when the IP version of the local socket
+    /// does not match that returned from `ToSocketAddrs`
+    /// See https://github.com/rust-lang/rust/issues/34202 for more details.
     #[stable(feature = "rust1", since = "1.0.0")]
     pub fn send_to<A: ToSocketAddrs>(&self, buf: &[u8], addr: A)
                                      -> io::Result<usize> {