Skip to content

Commit 24b2337

Browse files
committed
Implement lowering for reference types
1 parent 8efa0fa commit 24b2337

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

chalk-integration/src/lowering.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,6 +1221,24 @@ impl LowerTy for Ty {
12211221
)?,
12221222
})
12231223
.intern(interner)),
1224+
1225+
Ty::Ref {
1226+
mutability,
1227+
lifetime,
1228+
ty,
1229+
} => Ok(chalk_ir::TyData::Apply(chalk_ir::ApplicationTy {
1230+
name: chalk_ir::TypeName::Ref(ast_mutability_to_chalk_mutability(
1231+
mutability.clone(),
1232+
)),
1233+
substitution: chalk_ir::Substitution::from(
1234+
interner,
1235+
&[
1236+
lifetime.lower(env)?.cast(interner),
1237+
ty.lower(env)?.cast(interner),
1238+
],
1239+
),
1240+
})
1241+
.intern(interner)),
12241242
}
12251243
}
12261244
}

0 commit comments

Comments
 (0)