Don't call a type uncallable if its signature has errors in it
This commit is contained in:
parent
8164cdb9ee
commit
c0c2d39668
3 changed files with 25 additions and 0 deletions
|
|
@ -581,6 +581,14 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
callee_ty: Ty<'tcx>,
|
||||
arg_exprs: &'tcx [hir::Expr<'tcx>],
|
||||
) -> ErrorGuaranteed {
|
||||
// Callee probe fails when APIT references errors, so suppress those
|
||||
// errors here.
|
||||
if let Some((_, _, args)) = self.extract_callable_info(callee_ty)
|
||||
&& let Err(err) = args.error_reported()
|
||||
{
|
||||
return err;
|
||||
}
|
||||
|
||||
let mut unit_variant = None;
|
||||
if let hir::ExprKind::Path(qpath) = &callee_expr.kind
|
||||
&& let Res::Def(def::DefKind::Ctor(kind, CtorKind::Const), _)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue