Auto merge of #78636 - dtolnay:puncteq, r=petrochenkov
Add PartialEq<char> for proc_macro::Punct `punct.as_char() == '░'` is pervasive when parsing anything involving punct. I think `punct == '░'` is sufficiently unambiguous that it makes sense to provide the impl.1899c489d4/library/proc_macro/src/quote.rs (L79)
1899c489d4/library/proc_macro/src/quote.rs (L83)
1899c489d4/src/test/ui/suggestions/auxiliary/issue-61963.rs (L26)
1899c489d4/src/test/ui/proc-macro/auxiliary/three-equals.rs (L23)
This commit is contained in:
commit
cb5b87133a
2 changed files with 16 additions and 1 deletions
|
@ -842,6 +842,13 @@ impl fmt::Debug for Punct {
|
|||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "proc_macro_punct_eq", since = "1.49.0")]
|
||||
impl PartialEq<char> for Punct {
|
||||
fn eq(&self, rhs: &char) -> bool {
|
||||
self.as_char() == *rhs
|
||||
}
|
||||
}
|
||||
|
||||
/// An identifier (`ident`).
|
||||
#[derive(Clone)]
|
||||
#[stable(feature = "proc_macro_lib2", since = "1.29.0")]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue