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``
This commit is contained in:
commit
0b8495b6ac
@ -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;
|
||||
|
@ -49,7 +49,7 @@ fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) {
|
||||
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",
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user