Skip to content

Commit cce82d8

Browse files
committed
let-chain fmt
1 parent d92c2b5 commit cce82d8

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs

+8-10
Original file line numberDiff line numberDiff line change
@@ -3640,16 +3640,14 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
36403640
&& let Some(failed_pred) = failed_pred.to_opt_poly_projection_pred()
36413641
&& let Some(found) = failed_pred.skip_binder().term.ty()
36423642
{
3643-
type_diffs = vec![
3644-
Sorts(ty::error::ExpectedFound {
3645-
expected: Ty::new_alias(
3646-
self.tcx,
3647-
ty::Projection,
3648-
where_pred.skip_binder().projection_ty,
3649-
),
3650-
found,
3651-
}),
3652-
];
3643+
type_diffs = vec![Sorts(ty::error::ExpectedFound {
3644+
expected: Ty::new_alias(
3645+
self.tcx,
3646+
ty::Projection,
3647+
where_pred.skip_binder().projection_ty,
3648+
),
3649+
found,
3650+
})];
36533651
}
36543652
}
36553653
if let hir::ExprKind::Path(hir::QPath::Resolved(None, path)) = expr.kind

compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1116,7 +1116,9 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
11161116
&& let Some(parent) = self.tcx.hir().find_parent(binding.hir_id)
11171117
{
11181118
// We've reached the root of the method call chain...
1119-
if let hir::Node::Local(local) = parent && let Some(binding_expr) = local.init {
1119+
if let hir::Node::Local(local) = parent
1120+
&& let Some(binding_expr) = local.init
1121+
{
11201122
// ...and it is a binding. Get the binding creation and continue the chain.
11211123
expr = binding_expr;
11221124
}

0 commit comments

Comments
 (0)