diff options
| author | bors <bors@rust-lang.org> | 2016-04-28 07:59:02 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2016-04-28 07:59:02 -0700 |
| commit | ea6b3ddee9663e27221f366671261b21618394a0 (patch) | |
| tree | 0343b5361085cbbe94966b0608b7483e54a953c5 /src/libsyntax/parse | |
| parent | 4751e45521e5a1e70f5cf5086b7712c999546af8 (diff) | |
| parent | b9dd8aa4c291ce464655735802e68b26fe9c6862 (diff) | |
| download | rust-ea6b3ddee9663e27221f366671261b21618394a0.tar.gz rust-ea6b3ddee9663e27221f366671261b21618394a0.zip | |
Auto merge of #33257 - steveklabnik:rollup, r=steveklabnik
Rollup of 7 pull requests - Successful merges: #32991, #33056, #33095, #33152, #33212, #33218, #33234 - Failed merges: #32912
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/token.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index fcb6c3539db..47de32ed7d0 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -566,6 +566,28 @@ impl<'a> PartialEq<InternedString> for &'a str { } } +impl PartialEq<str> for InternedString { + #[inline(always)] + fn eq(&self, other: &str) -> bool { + PartialEq::eq(&self.string[..], other) + } + #[inline(always)] + fn ne(&self, other: &str) -> bool { + PartialEq::ne(&self.string[..], other) + } +} + +impl PartialEq<InternedString> for str { + #[inline(always)] + fn eq(&self, other: &InternedString) -> bool { + PartialEq::eq(self, &other.string[..]) + } + #[inline(always)] + fn ne(&self, other: &InternedString) -> bool { + PartialEq::ne(self, &other.string[..]) + } +} + impl Decodable for InternedString { fn decode<D: Decoder>(d: &mut D) -> Result<InternedString, D::Error> { Ok(intern(d.read_str()?.as_ref()).as_str()) |
