Skip to content

Commit 0b8495b

Browse files
authored
Rollup merge of rust-lang#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``
2 parents 70b8d15 + 359fa98 commit 0b8495b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

clippy_lints/src/matches/match_wild_err_arm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub(crate) fn check<'tcx>(cx: &LateContext<'tcx>, ex: &Expr<'tcx>, arms: &[Arm<'
1919
if is_type_diagnostic_item(cx, ex_ty, sym::Result) {
2020
for arm in arms {
2121
if let PatKind::TupleStruct(ref path, inner, _) = arm.pat.kind {
22-
let path_str = rustc_hir_pretty::to_string(rustc_hir_pretty::NO_ANN, |s| s.print_qpath(path, false));
22+
let path_str = rustc_hir_pretty::qpath_to_string(path);
2323
if path_str == "Err" {
2424
let mut matching_wild = inner.iter().any(is_wild);
2525
let mut ident_bind_name = kw::Underscore;

clippy_lints/src/mut_reference.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ impl<'tcx> LateLintPass<'tcx> for UnnecessaryMutPassed {
4949
cx,
5050
arguments.iter().collect(),
5151
cx.typeck_results().expr_ty(fn_expr),
52-
&rustc_hir_pretty::to_string(rustc_hir_pretty::NO_ANN, |s| s.print_qpath(path, false)),
52+
&rustc_hir_pretty::qpath_to_string(path),
5353
"function",
5454
);
5555
}

0 commit comments

Comments
 (0)