diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-12-22 12:56:18 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-12-22 15:17:26 -0800 |
| commit | 3583d613b9c81855feb067aeeebb525cf8a4184c (patch) | |
| tree | 931437f34b35af7d9f74b9fa5e335ddcfed35184 /src/libstd | |
| parent | 8824c39945cf8cbdd0e1a07824e3d2f4823b8e7b (diff) | |
| download | rust-3583d613b9c81855feb067aeeebb525cf8a4184c.tar.gz rust-3583d613b9c81855feb067aeeebb525cf8a4184c.zip | |
Test fixes and rebase conflicts
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/path/windows.rs | 8 | ||||
| -rw-r--r-- | src/libstd/sys/unix/os.rs | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/libstd/path/windows.rs b/src/libstd/path/windows.rs index b24966241ff..7d10188c437 100644 --- a/src/libstd/path/windows.rs +++ b/src/libstd/path/windows.rs @@ -827,8 +827,12 @@ impl Path { let s = if self.has_nonsemantic_trailing_slash() { self.repr[0..self.repr.len()-1] } else { self.repr[] }; - let idx = s.rfind(if !prefix_is_verbatim(self.prefix) { is_sep } - else { is_sep_verbatim }); + let sep_test: fn(char) -> bool = if !prefix_is_verbatim(self.prefix) { + is_sep + } else { + is_sep_verbatim + }; + let idx = s.rfind(sep_test); let prefixlen = self.prefix_len(); self.sepidx = idx.and_then(|x| if x < prefixlen { None } else { Some(x) }); } diff --git a/src/libstd/sys/unix/os.rs b/src/libstd/sys/unix/os.rs index 6c909d7562d..316d97064ee 100644 --- a/src/libstd/sys/unix/os.rs +++ b/src/libstd/sys/unix/os.rs @@ -189,7 +189,7 @@ pub fn load_self() -> Option<Vec<u8>> { if sz == 0 { return None; } let mut v: Vec<u8> = Vec::with_capacity(sz as uint); let err = sysctl(mib.as_mut_ptr(), mib.len() as ::libc::c_uint, - v.as_mut_ptr() as *mut c_void, &mut sz, + v.as_mut_ptr() as *mut libc::c_void, &mut sz, ptr::null_mut(), 0u as libc::size_t); if err != 0 { return None; } if sz == 0 { return None; } |
