From 5f59e1c8f9fcd31eae199514abf9d59d09f336c0 Mon Sep 17 00:00:00 2001 From: Michael McConville Date: Thu, 17 Dec 2015 21:04:54 -0500 Subject: Make runtime function return size_t It returns sizeof(dirent_t), so I'm not sure why its return type is int. It's only used once, and that usage immediately casts it to usize. --- src/libstd/sys/unix/fs.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/libstd/sys') diff --git a/src/libstd/sys/unix/fs.rs b/src/libstd/sys/unix/fs.rs index 8ea8f0c6c77..4b4310a1477 100644 --- a/src/libstd/sys/unix/fs.rs +++ b/src/libstd/sys/unix/fs.rs @@ -127,11 +127,11 @@ impl Iterator for ReadDir { fn next(&mut self) -> Option> { extern { - fn rust_dirent_t_size() -> c_int; + fn rust_dirent_t_size() -> size_t; } let mut buf: Vec = Vec::with_capacity(unsafe { - rust_dirent_t_size() as usize + rust_dirent_t_size() }); let ptr = buf.as_mut_ptr() as *mut libc::dirent; -- cgit 1.4.1-3-g733a5 From cf03ceed14683419d1b6c9a04141f415b982348f Mon Sep 17 00:00:00 2001 From: Michael McConville Date: Thu, 17 Dec 2015 21:24:14 -0500 Subject: Add a type prefix to fix build Apparently this file's use annotations have changed since I last pulled on my test machine. --- src/libstd/sys/unix/fs.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libstd/sys') diff --git a/src/libstd/sys/unix/fs.rs b/src/libstd/sys/unix/fs.rs index 4b4310a1477..8ff3a892c06 100644 --- a/src/libstd/sys/unix/fs.rs +++ b/src/libstd/sys/unix/fs.rs @@ -127,7 +127,7 @@ impl Iterator for ReadDir { fn next(&mut self) -> Option> { extern { - fn rust_dirent_t_size() -> size_t; + fn rust_dirent_t_size() -> libc::size_t; } let mut buf: Vec = Vec::with_capacity(unsafe { -- cgit 1.4.1-3-g733a5