Skip to content

Commit 1839748

Browse files
impl PartialEq<Punct> for char; symmetry for rust-lang#78636
Also fixes the "since" version of the original.
1 parent 9b471a3 commit 1839748

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

library/proc_macro/src/lib.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -842,13 +842,20 @@ impl fmt::Debug for Punct {
842842
}
843843
}
844844

845-
#[stable(feature = "proc_macro_punct_eq", since = "1.49.0")]
845+
#[stable(feature = "proc_macro_punct_eq", since = "1.50.0")]
846846
impl PartialEq<char> for Punct {
847847
fn eq(&self, rhs: &char) -> bool {
848848
self.as_char() == *rhs
849849
}
850850
}
851851

852+
#[stable(feature = "proc_macro_punct_eq_flipped", since = "1.52.0")]
853+
impl PartialEq<Punct> for char {
854+
fn eq(&self, rhs: &Punct) -> bool {
855+
*self == rhs.as_char()
856+
}
857+
}
858+
852859
/// An identifier (`ident`).
853860
#[derive(Clone)]
854861
#[stable(feature = "proc_macro_lib2", since = "1.29.0")]

0 commit comments

Comments
 (0)