Skip to content

Commit

Permalink
let-chain fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Nov 16, 2023
1 parent d92c2b5 commit cce82d8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3640,16 +3640,14 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
&& let Some(failed_pred) = failed_pred.to_opt_poly_projection_pred()
&& let Some(found) = failed_pred.skip_binder().term.ty()
{
type_diffs = vec![
Sorts(ty::error::ExpectedFound {
expected: Ty::new_alias(
self.tcx,
ty::Projection,
where_pred.skip_binder().projection_ty,
),
found,
}),
];
type_diffs = vec![Sorts(ty::error::ExpectedFound {
expected: Ty::new_alias(
self.tcx,
ty::Projection,
where_pred.skip_binder().projection_ty,
),
found,
})];
}
}
if let hir::ExprKind::Path(hir::QPath::Resolved(None, path)) = expr.kind
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,9 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
&& let Some(parent) = self.tcx.hir().find_parent(binding.hir_id)
{
// We've reached the root of the method call chain...
if let hir::Node::Local(local) = parent && let Some(binding_expr) = local.init {
if let hir::Node::Local(local) = parent
&& let Some(binding_expr) = local.init
{
// ...and it is a binding. Get the binding creation and continue the chain.
expr = binding_expr;
}
Expand Down

0 comments on commit cce82d8

Please sign in to comment.