File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -785,13 +785,20 @@ impl Nonterminal {
785785 /// See issue #73345 for more details.
786786 /// FIXME(#73933): Remove this eventually.
787787 pub fn pretty_printing_compatibility_hack ( & self ) -> bool {
788- if let NtItem ( item) = self {
789- let name = item. ident . name ;
790- if name == sym:: ProceduralMasqueradeDummyType || name == sym:: ProcMacroHack {
791- if let ast:: ItemKind :: Enum ( enum_def, _) = & item. kind {
792- if let [ variant] = & * enum_def. variants {
793- return variant. ident . name == sym:: Input ;
794- }
788+ let item = match self {
789+ NtItem ( item) => item,
790+ NtStmt ( stmt) => match & stmt. kind {
791+ ast:: StmtKind :: Item ( item) => item,
792+ _ => return false ,
793+ } ,
794+ _ => return false ,
795+ } ;
796+
797+ let name = item. ident . name ;
798+ if name == sym:: ProceduralMasqueradeDummyType || name == sym:: ProcMacroHack {
799+ if let ast:: ItemKind :: Enum ( enum_def, _) = & item. kind {
800+ if let [ variant] = & * enum_def. variants {
801+ return variant. ident . name == sym:: Input ;
795802 }
796803 }
797804 }
You can’t perform that action at this time.
0 commit comments