about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-10-12 18:36:43 +0200
committerGitHub <noreply@github.com>2023-10-12 18:36:43 +0200
commit0b8495b6acc936e54a282228081fc6d0c5534a5d (patch)
tree33da274ad6994e555ffd0514467289b831a12694
parent70b8d15a854fb90d58a929f2b554f08a61c63b9a (diff)
parent359fa9822b4130a97197df0d9cf8a642013cd9a2 (diff)
downloadrust-0b8495b6acc936e54a282228081fc6d0c5534a5d.tar.gz
rust-0b8495b6acc936e54a282228081fc6d0c5534a5d.zip
Rollup merge of #116625 - nnethercote:rustc_hir_pretty, r=fee1-dead
`rustc_hir_pretty` cleanups

Just some improvements I found while looking through this code.

r? ``@fee1-dead``
-rw-r--r--clippy_lints/src/matches/match_wild_err_arm.rs2
-rw-r--r--clippy_lints/src/mut_reference.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/clippy_lints/src/matches/match_wild_err_arm.rs b/clippy_lints/src/matches/match_wild_err_arm.rs
index de911f7a028..a2903e52ae0 100644
--- a/clippy_lints/src/matches/match_wild_err_arm.rs
+++ b/clippy_lints/src/matches/match_wild_err_arm.rs
@@ -19,7 +19,7 @@ pub(crate) fn check<'tcx>(cx: &LateContext<'tcx>, ex: &Expr<'tcx>, arms: &[Arm<'
     if is_type_diagnostic_item(cx, ex_ty, sym::Result) {
         for arm in arms {
             if let PatKind::TupleStruct(ref path, inner, _) = arm.pat.kind {
-                let path_str = rustc_hir_pretty::to_string(rustc_hir_pretty::NO_ANN, |s| s.print_qpath(path, false));
+                let path_str = rustc_hir_pretty::qpath_to_string(path);
                 if path_str == "Err" {
                     let mut matching_wild = inner.iter().any(is_wild);
                     let mut ident_bind_name = kw::Underscore;
diff --git a/clippy_lints/src/mut_reference.rs b/clippy_lints/src/mut_reference.rs
index e53e146ec5d..01b850cdb11 100644
--- a/clippy_lints/src/mut_reference.rs
+++ b/clippy_lints/src/mut_reference.rs
@@ -49,7 +49,7 @@ impl<'tcx> LateLintPass<'tcx> for UnnecessaryMutPassed {
                         cx,
                         arguments.iter().collect(),
                         cx.typeck_results().expr_ty(fn_expr),
-                        &rustc_hir_pretty::to_string(rustc_hir_pretty::NO_ANN, |s| s.print_qpath(path, false)),
+                        &rustc_hir_pretty::qpath_to_string(path),
                         "function",
                     );
                 }