Rollup merge of #80595 - pthariensflame:patch-1, r=m-ou-se

`impl PartialEq<Punct> for char`; symmetry for #78636

Also fixes the "since" version of the original.

Pinging ``@dtolnay`` and ``@petrochenkov.``
This commit is contained in:
Guillaume Gomez 2021-02-20 20:36:54 +01:00 committed by GitHub
commit d38f6e82a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -842,13 +842,20 @@ impl fmt::Debug for Punct {
} }
} }
#[stable(feature = "proc_macro_punct_eq", since = "1.49.0")] #[stable(feature = "proc_macro_punct_eq", since = "1.50.0")]
impl PartialEq<char> for Punct { impl PartialEq<char> for Punct {
fn eq(&self, rhs: &char) -> bool { fn eq(&self, rhs: &char) -> bool {
self.as_char() == *rhs self.as_char() == *rhs
} }
} }
#[stable(feature = "proc_macro_punct_eq_flipped", since = "1.52.0")]
impl PartialEq<Punct> for char {
fn eq(&self, rhs: &Punct) -> bool {
*self == rhs.as_char()
}
}
/// An identifier (`ident`). /// An identifier (`ident`).
#[derive(Clone)] #[derive(Clone)]
#[stable(feature = "proc_macro_lib2", since = "1.29.0")] #[stable(feature = "proc_macro_lib2", since = "1.29.0")]