Implement offset_of in hir-def and hir-ty

This commit is contained in:
Lukas Wirth 2023-09-05 12:13:24 +02:00
parent 9b8eb807a3
commit 15048304e3
17 changed files with 120 additions and 193 deletions

View file

@ -843,6 +843,7 @@ impl InferenceContext<'_> {
});
expected
}
Expr::OffsetOf(_) => TyKind::Scalar(Scalar::Uint(UintTy::Usize)).intern(Interner),
};
// use a new type variable if we got unknown here
let ty = self.insert_type_vars_shallow(ty);