Skip to content

Commit 8d16309

Browse files
committed
invoke check place for field projection
1 parent d06c9ac commit 8d16309

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

crates/formality-check/src/mini_rust_check.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -276,13 +276,7 @@ impl Check<'_> {
276276
place_ty = ty;
277277
}
278278
Field(field_projection) => {
279-
let Local(ref local_id) = *field_projection.root else {
280-
bail!("Only Local is allowed as the root of FieldProjection")
281-
};
282-
283-
let Some(ty) = env.local_variables.get(&local_id) else {
284-
bail!("The local id used in PlaceExpression::Field is invalid.")
285-
};
279+
let ty = self.check_place(env, &field_projection.root).unwrap();
286280

287281
let Some(adt_id) = ty.get_adt_id() else {
288282
bail!("The local used for field projection is not adt.")

0 commit comments

Comments
 (0)