1
Fork 0

use rustc_hir_pretty::qpath_to_string to avoid span_to_snippet when rendering path

This commit is contained in:
Michael Goulet 2022-07-16 21:03:30 -07:00
parent 04c590b7ef
commit 7a45a60418
9 changed files with 52 additions and 15 deletions

View file

@ -211,6 +211,10 @@ pub fn path_to_string(segment: &hir::Path<'_>) -> String {
to_string(NO_ANN, |s| s.print_path(segment, false))
}
pub fn qpath_to_string(segment: &hir::QPath<'_>) -> String {
to_string(NO_ANN, |s| s.print_qpath(segment, false))
}
pub fn fn_to_string(
decl: &hir::FnDecl<'_>,
header: hir::FnHeader,