diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-11-14 10:44:08 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-11-22 08:13:21 +1100 |
| commit | 33cee0b22c8831b8521fd150e6be85a6425be037 (patch) | |
| tree | af16c5719468aac5351f1bc7cada75188b0f1083 | |
| parent | ce363bb6e6b2b50dd897e550f41d366eae52aae2 (diff) | |
| download | rust-33cee0b22c8831b8521fd150e6be85a6425be037.tar.gz rust-33cee0b22c8831b8521fd150e6be85a6425be037.zip | |
Remove `NO_ANN`.
This makes `rustc_hir_pretty` more like `rustc_ast_pretty`.
| -rw-r--r-- | compiler/rustc_hir_pretty/src/lib.rs | 8 |
1 files 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 @@ pub trait PpAnn { } 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 @@ where } 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> { |
