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/Cargo.toml | 6 +++--- crates/hir_ty/src/traits/chalk.rs | 11 +++++++++-- 2 files changed, 12 insertions(+), 5 deletions(-) (limited to 'crates/hir_ty') diff --git a/crates/hir_ty/Cargo.toml b/crates/hir_ty/Cargo.toml index 289e812fe..965c1780a 100644 --- a/crates/hir_ty/Cargo.toml +++ b/crates/hir_ty/Cargo.toml @@ -17,9 +17,9 @@ ena = "0.14.0" log = "0.4.8" rustc-hash = "1.1.0" scoped-tls = "1" -chalk-solve = { version = "0.43", default-features = false } -chalk-ir = "0.43" -chalk-recursive = "0.43" +chalk-solve = { version = "0.45", default-features = false } +chalk-ir = "0.45" +chalk-recursive = "0.45" stdx = { path = "../stdx", version = "0.0.0" } hir_def = { path = "../hir_def", version = "0.0.0" } 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