mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-29 02:03:53 +00:00
implementing Display for enums too.
This commit is contained in:
parent
787043496a
commit
31eec5e80c
File diff suppressed because it is too large
Load Diff
@ -69,8 +69,8 @@ fn generate_ast(grammar: AstSrc<'_>) -> Result<String> {
|
||||
}
|
||||
|
||||
impl std::fmt::Display for #name {
|
||||
fn fmt(..) -> std::fmt::Result {
|
||||
std::fmt::Display::fmt(self.syntax())
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||
std::fmt::Display::fmt(self.syntax(), f)
|
||||
}
|
||||
}
|
||||
|
||||
@ -120,6 +120,12 @@ fn generate_ast(grammar: AstSrc<'_>) -> Result<String> {
|
||||
}
|
||||
)*
|
||||
|
||||
impl std::fmt::Display for #name {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||
std::fmt::Display::fmt(self.syntax(), f)
|
||||
}
|
||||
}
|
||||
|
||||
impl AstNode for #name {
|
||||
fn can_cast(kind: SyntaxKind) -> bool {
|
||||
match kind {
|
||||
|
Loading…
Reference in New Issue
Block a user