From c04406287a31a342b8650b143a3ea6ea1261442d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= Date: Wed, 23 Dec 2020 11:41:03 +0200 Subject: Bump chalk --- crates/hir_ty/src/traits/chalk.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'crates/hir_ty/src') diff --git a/crates/hir_ty/src/traits/chalk.rs b/crates/hir_ty/src/traits/chalk.rs index 69eae6f79..2196af677 100644 --- a/crates/hir_ty/src/traits/chalk.rs +++ b/crates/hir_ty/src/traits/chalk.rs @@ -56,8 +56,13 @@ impl<'a> chalk_solve::RustIrDatabase for ChalkContext<'a> { fn adt_datum(&self, struct_id: AdtId) -> Arc { self.db.struct_datum(self.krate, struct_id) } - fn adt_repr(&self, _struct_id: AdtId) -> rust_ir::AdtRepr { - rust_ir::AdtRepr { repr_c: false, repr_packed: false } + fn adt_repr(&self, _struct_id: AdtId) -> Arc> { + // FIXME: keep track of these + Arc::new(rust_ir::AdtRepr { c: false, packed: false, int: None }) + } + fn discriminant_type(&self, _ty: chalk_ir::Ty) -> chalk_ir::Ty { + // FIXME: keep track of this + chalk_ir::TyKind::Scalar(chalk_ir::Scalar::Uint(chalk_ir::UintTy::U32)).intern(&Interner) } fn impl_datum(&self, impl_id: ImplId) -> Arc { self.db.impl_datum(self.krate, impl_id) @@ -457,6 +462,7 @@ fn well_known_trait_from_lang_attr(name: &str) -> Option { "fn" => WellKnownTrait::Fn, "unsize" => WellKnownTrait::Unsize, "coerce_unsized" => WellKnownTrait::CoerceUnsized, + "discriminant_kind" => WellKnownTrait::DiscriminantKind, _ => return None, }) } @@ -473,6 +479,7 @@ fn lang_attr_from_well_known_trait(attr: WellKnownTrait) -> &'static str { WellKnownTrait::Unsize => "unsize", WellKnownTrait::Unpin => "unpin", WellKnownTrait::CoerceUnsized => "coerce_unsized", + WellKnownTrait::DiscriminantKind => "discriminant_kind", } } -- cgit v1.2.3