Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/infer/expr.rs')
-rw-r--r--crates/hir-ty/src/infer/expr.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/crates/hir-ty/src/infer/expr.rs b/crates/hir-ty/src/infer/expr.rs
index 75e6440334..4903a15a08 100644
--- a/crates/hir-ty/src/infer/expr.rs
+++ b/crates/hir-ty/src/infer/expr.rs
@@ -269,7 +269,8 @@ impl<'db> InferenceContext<'_, 'db> {
| Expr::Box { .. }
| Expr::RecordLit { .. }
| Expr::Yeet { .. }
- | Expr::Missing => false,
+ | Expr::Missing
+ | Expr::IncludeBytes => false,
}
}
@@ -893,6 +894,11 @@ impl<'db> InferenceContext<'_, 'db> {
self.types.types.unit
}
}
+ Expr::IncludeBytes => {
+ let len = self.table.next_const_var(Span::Dummy);
+ let arr = Ty::new_array_with_const_len(self.interner(), self.types.types.u8, len);
+ Ty::new_ref(self.interner(), self.types.regions.statik, arr, Mutability::Not)
+ }
};
let ty = self.insert_type_vars_shallow(ty);
self.write_expr_ty(tgt_expr, ty);