Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/mir/lower.rs')
-rw-r--r--crates/hir-ty/src/mir/lower.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/hir-ty/src/mir/lower.rs b/crates/hir-ty/src/mir/lower.rs
index 4359a1acb5..d1277762eb 100644
--- a/crates/hir-ty/src/mir/lower.rs
+++ b/crates/hir-ty/src/mir/lower.rs
@@ -6,7 +6,7 @@ use base_db::Crate;
use hir_def::{
AdtId, DefWithBodyId, EnumVariantId, ExpressionStoreOwnerId, GenericParamId, HasModule,
ItemContainerId, LocalFieldId, Lookup, TraitId,
- expr_store::{Body, ExpressionStore, HygieneId, path::Path},
+ expr_store::{Body, ExpressionStore, HygieneId, body::Param, path::Path},
hir::{
ArithOp, Array, BinaryOp, BindingAnnotation, BindingId, ClosureKind, ExprId, ExprOrPatId,
LabelId, Literal, MatchArm, Pat, PatId, RecordLitField, RecordSpread,
@@ -2312,7 +2312,7 @@ pub fn mir_body_query<'db>(db: &'db dyn HirDatabase, def: InferBodyId) -> Result
let (store, root_expr, self_param, params) = match def {
InferBodyId::DefWithBodyId(def) => {
let body = Body::of(db, def);
- (&**body, body.root_expr(), body.self_param(), &*body.params)
+ (&**body, body.root_expr(), body.self_param.map(|param| param.formal), &*body.params)
}
InferBodyId::AnonConstId(def) => {
let loc = def.loc(db);
@@ -2351,7 +2351,7 @@ pub fn lower_body_to_mir<'db>(
infer: &InferenceResult,
root_expr: ExprId,
self_param: Option<BindingId>,
- params: &[PatId],
+ params: &[Param<PatId>],
) -> Result<'db, MirBody> {
// Extract params and self_param only when lowering the body's root expression for a function.
if let Some(fid) = owner.as_function() {
@@ -2366,7 +2366,7 @@ pub fn lower_body_to_mir<'db>(
store,
infer,
root_expr,
- params.iter().copied().zip(param_tys),
+ params.iter().map(|param| param.formal).zip(param_tys),
self_param,
)
} else {