]> git.lizzy.rs Git - rust.git/blobdiff - crates/hir_ty/src/infer/expr.rs
Add lowering of array lengths in types
[rust.git] / crates / hir_ty / src / infer / expr.rs
index 2178ffd07717da2d3158aec13126657c2d7c7f68..5e942075249ab2f4ec9bfa9d6f55917c6ff64ec0 100644 (file)
@@ -8,6 +8,7 @@
     expr::{Array, BinaryOp, Expr, ExprId, Literal, Statement, UnaryOp},
     path::{GenericArg, GenericArgs},
     resolver::resolver_for_expr,
+    type_ref::ConstScalar,
     AssocContainerId, FieldId, Lookup,
 };
 use hir_expand::name::{name, Name};
@@ -15,9 +16,7 @@
 use syntax::ast::RangeOp;
 
 use crate::{
-    autoderef,
-    consts::ConstScalar,
-    dummy_usize_const,
+    autoderef, dummy_usize_const,
     lower::lower_to_chalk_mutability,
     mapping::from_chalk,
     method_resolution, op,
@@ -737,7 +736,8 @@ fn infer_expr_inner(&mut self, tgt_expr: ExprId, expected: &Expectation) -> Ty {
                                 TyKind::Scalar(Scalar::Uint(UintTy::Usize)).intern(&Interner),
                             ),
                         );
-                        // FIXME: support length for Repeat array expressions
+                        // FIXME: we don't know the length here because hir Exprs don't actually
+                        // get the value out of the AST, even though it is there.
                         None
                     }
                 };