Skip to content

Commit d38f6e8

Browse files
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.``
2 parents e7c23ab + 1839748 commit d38f6e8

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)