diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-03-10 17:59:23 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-03-31 13:39:14 -0700 |
| commit | 5cf126ae2f6af1cdac901f6995e3c2bab35e587f (patch) | |
| tree | f7e9a256438a06caa8bdc0f881e0f4bbb5a7e4de /src/libstd/old_path | |
| parent | 80bf31dd514055177b22c3dc66836d39eb5b1648 (diff) | |
| download | rust-5cf126ae2f6af1cdac901f6995e3c2bab35e587f.tar.gz rust-5cf126ae2f6af1cdac901f6995e3c2bab35e587f.zip | |
std: Remove #[old_orphan_check] from PartialEq
This is a deprecated attribute that is slated for removal, and it also affects all implementors of the trait. This commit removes the attribute and fixes up implementors accordingly. The primary implementation which was lost was the ability to compare `&[T]` and `Vec<T>` (in that order). This change also modifies the `assert_eq!` macro to not consider both directions of equality, only the one given in the left/right forms to the macro. This modification is motivated due to the fact that `&[T] == Vec<T>` no longer compiles, causing hundreds of errors in unit tests in the standard library (and likely throughout the community as well). cc #19470 [breaking-change]
Diffstat (limited to 'src/libstd/old_path')
| -rw-r--r-- | src/libstd/old_path/posix.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/libstd/old_path/posix.rs b/src/libstd/old_path/posix.rs index bbc1756bee6..67190de08c3 100644 --- a/src/libstd/old_path/posix.rs +++ b/src/libstd/old_path/posix.rs @@ -126,7 +126,7 @@ impl GenericPathUnsafe for Path { unsafe fn set_filename_unchecked<T: BytesContainer>(&mut self, filename: T) { let filename = filename.container_as_bytes(); match self.sepidx { - None if b".." == self.repr => { + None if self.repr == b".." => { let mut v = Vec::with_capacity(3 + filename.len()); v.push_all(dot_dot_static); v.push(SEP_BYTE); @@ -186,7 +186,7 @@ impl GenericPath for Path { fn dirname<'a>(&'a self) -> &'a [u8] { match self.sepidx { - None if b".." == self.repr => &self.repr, + None if self.repr == b".." => &self.repr, None => dot_static, Some(0) => &self.repr[..1], Some(idx) if &self.repr[idx+1..] == b".." => &self.repr, @@ -196,8 +196,7 @@ impl GenericPath for Path { fn filename<'a>(&'a self) -> Option<&'a [u8]> { match self.sepidx { - None if b"." == self.repr || - b".." == self.repr => None, + None if self.repr == b"." || self.repr == b".." => None, None => Some(&self.repr), Some(idx) if &self.repr[idx+1..] == b".." => None, Some(0) if self.repr[1..].is_empty() => None, @@ -207,13 +206,13 @@ impl GenericPath for Path { fn pop(&mut self) -> bool { match self.sepidx { - None if b"." == self.repr => false, + None if self.repr == b"." => false, None => { self.repr = vec![b'.']; self.sepidx = None; true } - Some(0) if b"/" == self.repr => false, + Some(0) if self.repr == b"/" => false, Some(idx) => { if idx == 0 { self.repr.truncate(idx+1); @@ -245,7 +244,7 @@ impl GenericPath for Path { } else { let mut ita = self.components(); let mut itb = other.components(); - if b"." == self.repr { + if self.repr == b"." { return match itb.next() { None => true, Some(b) => b != b".." |
