mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
Add std::ops::Index support for infering
This commit is contained in:
parent
242f0ae1d8
commit
dddee23f43
5 changed files with 63 additions and 5 deletions
|
@ -422,10 +422,14 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> {
|
|||
}
|
||||
}
|
||||
Expr::Index { base, index } => {
|
||||
let _base_ty = self.infer_expr_inner(*base, &Expectation::none());
|
||||
let _index_ty = self.infer_expr(*index, &Expectation::none());
|
||||
// FIXME: use `std::ops::Index::Output` to figure out the real return type
|
||||
Ty::Unknown
|
||||
let base_ty = self.infer_expr_inner(*base, &Expectation::none());
|
||||
let index_ty = self.infer_expr(*index, &Expectation::none());
|
||||
|
||||
self.resolve_associated_type_with_params(
|
||||
base_ty,
|
||||
self.resolve_ops_index_output(),
|
||||
&[index_ty],
|
||||
)
|
||||
}
|
||||
Expr::Tuple { exprs } => {
|
||||
let mut tys = match &expected.ty {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue