mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 15:15:24 +00:00
Extract coercion logic to InferenceTable
To make it accessible without an InferenceContext.
This commit is contained in:
parent
6a0b199c82
commit
6133e6a002
2 changed files with 34 additions and 18 deletions
|
@ -67,7 +67,7 @@ impl<'a> InferenceContext<'a> {
|
|||
let ty = self.infer_expr_inner(expr, expected);
|
||||
if let Some(target) = expected.only_has_type(&mut self.table) {
|
||||
match self.coerce(Some(expr), &ty, &target) {
|
||||
Ok(res) => res.value,
|
||||
Ok(res) => res,
|
||||
Err(_) => {
|
||||
self.result
|
||||
.type_mismatches
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue