From 33cee0b22c8831b8521fd150e6be85a6425be037 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Tue, 14 Nov 2023 10:44:08 +1100 Subject: [PATCH] Remove `NO_ANN`. This makes `rustc_hir_pretty` more like `rustc_ast_pretty`. --- compiler/rustc_hir_pretty/src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/rustc_hir_pretty/src/lib.rs b/compiler/rustc_hir_pretty/src/lib.rs index 5f82d9f06c6..5996d60b525 100644 --- a/compiler/rustc_hir_pretty/src/lib.rs +++ b/compiler/rustc_hir_pretty/src/lib.rs @@ -49,8 +49,8 @@ fn post(&self, _state: &mut State<'_>, _node: AnnNode<'_>) {} } pub struct NoAnn; + impl PpAnn for NoAnn {} -pub const NO_ANN: &dyn PpAnn = &NoAnn; impl PpAnn for &dyn rustc_hir::intravisit::Map<'_> { fn nested(&self, state: &mut State<'_>, nested: Nested) { @@ -183,15 +183,15 @@ fn to_string(ann: &dyn PpAnn, f: F) -> String } pub fn ty_to_string(ty: &hir::Ty<'_>) -> String { - to_string(NO_ANN, |s| s.print_type(ty)) + to_string(&NoAnn, |s| s.print_type(ty)) } pub fn qpath_to_string(segment: &hir::QPath<'_>) -> String { - to_string(NO_ANN, |s| s.print_qpath(segment, false)) + to_string(&NoAnn, |s| s.print_qpath(segment, false)) } pub fn pat_to_string(pat: &hir::Pat<'_>) -> String { - to_string(NO_ANN, |s| s.print_pat(pat)) + to_string(&NoAnn, |s| s.print_pat(pat)) } impl<'a> State<'a> {