mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
fix: Implement Expactation::Castable and add a test case for it
This commit is contained in:
parent
5e6208b1df
commit
f8f1cb93e0
3 changed files with 41 additions and 8 deletions
|
@ -610,9 +610,9 @@ impl<'a> InferenceContext<'a> {
|
|||
}
|
||||
}
|
||||
Expr::Cast { expr, type_ref } => {
|
||||
// FIXME: propagate the "castable to" expectation (and find a test case that shows this is necessary)
|
||||
let _inner_ty = self.infer_expr_inner(*expr, &Expectation::none());
|
||||
let cast_ty = self.make_ty(type_ref);
|
||||
let _inner_ty =
|
||||
self.infer_expr_inner(*expr, &Expectation::Castable(cast_ty.clone()));
|
||||
// FIXME check the cast...
|
||||
cast_ty
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue