Rollup merge of #83952 - estebank:issue-83943, r=petrochenkov
Account for `ExprKind::Block` when suggesting .into() and deref Fix #83943.
This commit is contained in:
commit
97c50d529b
5 changed files with 41 additions and 4 deletions
|
@ -205,6 +205,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
found: Ty<'tcx>,
|
||||
expected_ty_expr: Option<&'tcx hir::Expr<'tcx>>,
|
||||
) {
|
||||
let expr = expr.peel_blocks();
|
||||
if let Some((sp, msg, suggestion, applicability)) = self.check_ref(expr, found, expected) {
|
||||
err.span_suggestion(sp, msg, suggestion, applicability);
|
||||
} else if let (ty::FnDef(def_id, ..), true) =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue