about summary refs log tree commit diff
path: root/src/libstd/sys
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2015-02-06 05:40:52 +0530
committerManish Goregaokar <manishsmail@gmail.com>2015-02-06 16:21:10 +0530
commit6c28ad61a20f8c50b73ca9a6b4308acb62acdf2c (patch)
treea1f62bd86df4e572a43ec60c3601f72d9216eaa2 /src/libstd/sys
parentf6d08b0b175afb64157f466dd2aea7fb14d97339 (diff)
parentfb6b970bf8d12182a69b1e7ae222f3e2ebbb9003 (diff)
downloadrust-6c28ad61a20f8c50b73ca9a6b4308acb62acdf2c.tar.gz
rust-6c28ad61a20f8c50b73ca9a6b4308acb62acdf2c.zip
Rollup merge of #21926 - mzabaluev:raw-lifetime, r=alexcrichton
 New functions, `slice::from_raw_parts` and `slice::from_raw_parts_mut`,
are added to implement the lifetime convention as agreed in rust-lang/rfcs#556.
The functions `slice::from_raw_buf` and `slice::from_raw_mut_buf` are
left deprecated for the time being.

Holding back on changing the signature of `std::ffi::c_str_to_bytes` as consensus in rust-lang/rfcs#592 is building to replace it with a composition of other functions.

Contribution to #21923.
Diffstat (limited to 'src/libstd/sys')
-rw-r--r--src/libstd/sys/windows/os.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/sys/windows/os.rs b/src/libstd/sys/windows/os.rs
index c71e2d057c3..d8e3e6981df 100644
--- a/src/libstd/sys/windows/os.rs
+++ b/src/libstd/sys/windows/os.rs
@@ -109,7 +109,7 @@ impl Iterator for Env {
                 len += 1;
             }
             let p = p as *const u16;
-            let s = slice::from_raw_buf(&p, len as usize);
+            let s = slice::from_raw_parts(p, len as usize);
             self.cur = self.cur.offset(len + 1);
 
             let (k, v) = match s.iter().position(|&b| b == '=' as u16) {
@@ -296,7 +296,7 @@ impl Iterator for Args {
 
             // Push it onto the list.
             let ptr = ptr as *const u16;
-            let buf = slice::from_raw_buf(&ptr, len as usize);
+            let buf = slice::from_raw_parts(ptr, len as usize);
             OsStringExt::from_wide(buf)
         })
     }