Remove NO_ANN
.
This makes `rustc_hir_pretty` more like `rustc_ast_pretty`.
This commit is contained in:
parent
ce363bb6e6
commit
33cee0b22c
1 changed files with 4 additions and 4 deletions
|
@ -49,8 +49,8 @@ pub trait PpAnn {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct NoAnn;
|
pub struct NoAnn;
|
||||||
|
|
||||||
impl PpAnn for NoAnn {}
|
impl PpAnn for NoAnn {}
|
||||||
pub const NO_ANN: &dyn PpAnn = &NoAnn;
|
|
||||||
|
|
||||||
impl PpAnn for &dyn rustc_hir::intravisit::Map<'_> {
|
impl PpAnn for &dyn rustc_hir::intravisit::Map<'_> {
|
||||||
fn nested(&self, state: &mut State<'_>, nested: Nested) {
|
fn nested(&self, state: &mut State<'_>, nested: Nested) {
|
||||||
|
@ -183,15 +183,15 @@ where
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn ty_to_string(ty: &hir::Ty<'_>) -> 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 {
|
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 {
|
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> {
|
impl<'a> State<'a> {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue