mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
Diagnose call expression on non-callable things
This commit is contained in:
parent
3ba876a4a6
commit
3c7a0aa00e
6 changed files with 83 additions and 14 deletions
|
@ -364,7 +364,13 @@ impl<'a> InferenceContext<'a> {
|
|||
}
|
||||
(params, ret_ty)
|
||||
}
|
||||
None => (Vec::new(), self.err_ty()), // FIXME diagnostic
|
||||
None => {
|
||||
self.result.diagnostics.push(InferenceDiagnostic::ExpectedFunction {
|
||||
call_expr: tgt_expr,
|
||||
found: callee_ty.clone(),
|
||||
});
|
||||
(Vec::new(), self.err_ty())
|
||||
}
|
||||
};
|
||||
let indices_to_skip = self.check_legacy_const_generics(derefed_callee, args);
|
||||
self.register_obligations_for_call(&callee_ty);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue