diff options
| author | Nick Cameron <ncameron@mozilla.com> | 2014-11-17 21:39:01 +1300 |
|---|---|---|
| committer | Nick Cameron <ncameron@mozilla.com> | 2014-11-17 22:41:33 +1300 |
| commit | ca08540a0039e827114752d11166ea8cb1387068 (patch) | |
| tree | 53b03a7c1563b089518fdcf1be7e9d789fdd0897 /src/libstd/path | |
| parent | 803aacd5aef78f90fdd06ae7653fc20eec224992 (diff) | |
| download | rust-ca08540a0039e827114752d11166ea8cb1387068.tar.gz rust-ca08540a0039e827114752d11166ea8cb1387068.zip | |
Fix fallout from coercion removal
Diffstat (limited to 'src/libstd/path')
| -rw-r--r-- | src/libstd/path/posix.rs | 18 | ||||
| -rw-r--r-- | src/libstd/path/windows.rs | 14 |
2 files changed, 16 insertions, 16 deletions
diff --git a/src/libstd/path/posix.rs b/src/libstd/path/posix.rs index e2ff824a7c9..3e013ba20c4 100644 --- a/src/libstd/path/posix.rs +++ b/src/libstd/path/posix.rs @@ -462,7 +462,7 @@ mod tests { #[test] fn test_paths() { - let empty: &[u8] = []; + let empty: &[u8] = &[]; t!(v: Path::new(empty), b"."); t!(v: Path::new(b"/"), b"/"); t!(v: Path::new(b"a/b/c"), b"a/b/c"); @@ -731,14 +731,14 @@ mod tests { (s: $path:expr, $push:expr, $exp:expr) => ( { let mut p = Path::new($path); - p.push_many($push); + p.push_many(&$push); assert!(p.as_str() == Some($exp)); } ); (v: $path:expr, $push:expr, $exp:expr) => ( { let mut p = Path::new($path); - p.push_many($push); + p.push_many(&$push); assert!(p.as_vec() == $exp); } ) @@ -836,14 +836,14 @@ mod tests { (s: $path:expr, $join:expr, $exp:expr) => ( { let path = Path::new($path); - let res = path.join_many($join); + let res = path.join_many(&$join); assert!(res.as_str() == Some($exp)); } ); (v: $path:expr, $join:expr, $exp:expr) => ( { let path = Path::new($path); - let res = path.join_many($join); + let res = path.join_many(&$join); assert!(res.as_vec() == $exp); } ) @@ -859,7 +859,7 @@ mod tests { #[test] fn test_with_helpers() { - let empty: &[u8] = []; + let empty: &[u8] = &[]; t!(v: Path::new(b"a/b/c").with_filename(b"d"), b"a/b/d"); t!(v: Path::new(b"a/b/c\xFF").with_filename(b"\x80"), b"a/b/\x80"); @@ -1173,7 +1173,7 @@ mod tests { { let path = Path::new($path); let comps = path.components().collect::<Vec<&[u8]>>(); - let exp: &[&str] = $exp; + let exp: &[&str] = &$exp; let exps = exp.iter().map(|x| x.as_bytes()).collect::<Vec<&[u8]>>(); assert!(comps == exps, "components: Expected {}, found {}", comps, exps); @@ -1187,7 +1187,7 @@ mod tests { { let path = Path::new($arg); let comps = path.components().collect::<Vec<&[u8]>>(); - let exp: &[&[u8]] = [$($exp),*]; + let exp: &[&[u8]] = &[$($exp),*]; assert_eq!(comps.as_slice(), exp); let comps = path.components().rev().collect::<Vec<&[u8]>>(); let exp = exp.iter().rev().map(|&x|x).collect::<Vec<&[u8]>>(); @@ -1219,7 +1219,7 @@ mod tests { { let path = Path::new($arg); let comps = path.str_components().collect::<Vec<Option<&str>>>(); - let exp: &[Option<&str>] = $exp; + let exp: &[Option<&str>] = &$exp; assert_eq!(comps.as_slice(), exp); let comps = path.str_components().rev().collect::<Vec<Option<&str>>>(); let exp = exp.iter().rev().map(|&x|x).collect::<Vec<Option<&str>>>(); diff --git a/src/libstd/path/windows.rs b/src/libstd/path/windows.rs index b8016e3e8f4..a053f57bf12 100644 --- a/src/libstd/path/windows.rs +++ b/src/libstd/path/windows.rs @@ -1195,7 +1195,7 @@ mod tests { #[test] fn test_paths() { - let empty: &[u8] = []; + let empty: &[u8] = &[]; t!(v: Path::new(empty), b"."); t!(v: Path::new(b"\\"), b"\\"); t!(v: Path::new(b"a\\b\\c"), b"a\\b\\c"); @@ -1571,14 +1571,14 @@ mod tests { (s: $path:expr, $push:expr, $exp:expr) => ( { let mut p = Path::new($path); - p.push_many($push); + p.push_many(&$push); assert_eq!(p.as_str(), Some($exp)); } ); (v: $path:expr, $push:expr, $exp:expr) => ( { let mut p = Path::new($path); - p.push_many($push); + p.push_many(&$push); assert_eq!(p.as_vec(), $exp); } ) @@ -1712,14 +1712,14 @@ mod tests { (s: $path:expr, $join:expr, $exp:expr) => ( { let path = Path::new($path); - let res = path.join_many($join); + let res = path.join_many(&$join); assert_eq!(res.as_str(), Some($exp)); } ); (v: $path:expr, $join:expr, $exp:expr) => ( { let path = Path::new($path); - let res = path.join_many($join); + let res = path.join_many(&$join); assert_eq!(res.as_vec(), $exp); } ) @@ -2252,7 +2252,7 @@ mod tests { let path = Path::new($path); let comps = path.str_components().map(|x|x.unwrap()) .collect::<Vec<&str>>(); - let exp: &[&str] = $exp; + let exp: &[&str] = &$exp; assert_eq!(comps.as_slice(), exp); let comps = path.str_components().rev().map(|x|x.unwrap()) .collect::<Vec<&str>>(); @@ -2309,7 +2309,7 @@ mod tests { { let path = Path::new($path); let comps = path.components().collect::<Vec<&[u8]>>(); - let exp: &[&[u8]] = $exp; + let exp: &[&[u8]] = &$exp; assert_eq!(comps.as_slice(), exp); let comps = path.components().rev().collect::<Vec<&[u8]>>(); let exp = exp.iter().rev().map(|&x|x).collect::<Vec<&[u8]>>(); |
