Bump chalk

This commit is contained in:
Laurențiu Nicola 2020-07-30 20:37:28 +03:00
parent fa64817eab
commit 797cdb00d9
4 changed files with 35 additions and 28 deletions

16
Cargo.lock generated
View File

@ -125,9 +125,9 @@ checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
[[package]]
name = "chalk-derive"
version = "0.18.0"
version = "0.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eea3a22f0c30b2504ac4ab58934dac0d00b92a4d7788df32795cabca24c3f929"
checksum = "654c611946ba2629c5028cb7708687af975faf2c29d731824cb294c873df4697"
dependencies = [
"proc-macro2",
"quote",
@ -137,9 +137,9 @@ dependencies = [
[[package]]
name = "chalk-ir"
version = "0.18.0"
version = "0.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fb617b643e145e3b151502799e91a9625dd5daf1cf05dc2cb821bc75ae0c9cbd"
checksum = "0a5341fbc654ca886b73b804a36aebf0e621057ccc1a68e9815b5b39b3ac9ae8"
dependencies = [
"chalk-derive",
"lazy_static",
@ -147,9 +147,9 @@ dependencies = [
[[package]]
name = "chalk-recursive"
version = "0.18.0"
version = "0.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d280565c8eefbf9b2bc615df49c7dfd971faad37774bf65734e626fd23864bd6"
checksum = "4484807b155b5a411e6135d330295f9ba5042e2920b8712c6574ca6ea91e9ee5"
dependencies = [
"chalk-derive",
"chalk-ir",
@ -160,9 +160,9 @@ dependencies = [
[[package]]
name = "chalk-solve"
version = "0.18.0"
version = "0.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "be906fbca3f3077dce0e76d9864771d0f450c946af0d86b569fb9504148a065a"
checksum = "281f82facd2538997fbe52132b1941ed213d266748215c31d15f62a8664429ad"
dependencies = [
"chalk-derive",
"chalk-ir",

View File

@ -28,9 +28,9 @@ test_utils = { path = "../test_utils" }
scoped-tls = "1"
chalk-solve = { version = "0.18.0" }
chalk-ir = { version = "0.18.0" }
chalk-recursive = { version = "0.18.0" }
chalk-solve = { version = "0.19.0" }
chalk-ir = { version = "0.19.0" }
chalk-recursive = { version = "0.19.0" }
[dev-dependencies]
expect = { path = "../expect" }

View File

@ -183,6 +183,7 @@ fn opaque_ty_data(&self, id: chalk_ir::OpaqueTyId<Interner>) -> Arc<OpaqueTyDatu
.collect(),
1,
),
where_clauses: make_binders(vec![], 0),
};
let num_vars = datas.num_binders;
Arc::new(OpaqueTyDatum { opaque_ty_id: id, bound: make_binders(bound, num_vars) })
@ -193,15 +194,6 @@ fn hidden_opaque_type(&self, _id: chalk_ir::OpaqueTyId<Interner>) -> chalk_ir::T
Ty::Unknown.to_chalk(self.db)
}
fn force_impl_for(
&self,
_well_known: rust_ir::WellKnownTrait,
_ty: &chalk_ir::TyData<Interner>,
) -> Option<bool> {
// this method is mostly for rustc
None
}
fn is_object_safe(&self, _trait_id: chalk_ir::TraitId<Interner>) -> bool {
// FIXME: implement actual object safety
true
@ -547,8 +539,13 @@ pub(crate) fn fn_def_datum_query(
),
where_clauses,
};
let datum =
FnDefDatum { id: fn_def_id, binders: make_binders(bound, sig.num_binders), abi: () };
let datum = FnDefDatum {
id: fn_def_id,
abi: (),
safety: chalk_ir::Safety::Safe,
variadic: sig.value.is_varargs,
binders: make_binders(bound, sig.num_binders),
};
Arc::new(datum)
}

View File

@ -30,11 +30,16 @@ fn to_chalk(self, db: &dyn HirDatabase) -> chalk_ir::Ty<Interner> {
Ty::Apply(apply_ty) => match apply_ty.ctor {
TypeCtor::Ref(m) => ref_to_chalk(db, m, apply_ty.parameters),
TypeCtor::Array => array_to_chalk(db, apply_ty.parameters),
TypeCtor::FnPtr { num_args: _, is_varargs: _ } => {
// FIXME: handle is_varargs
TypeCtor::FnPtr { num_args: _, is_varargs } => {
let substitution = apply_ty.parameters.to_chalk(db).shifted_in(&Interner);
chalk_ir::TyData::Function(chalk_ir::Fn { num_binders: 0, substitution })
.intern(&Interner)
chalk_ir::TyData::Function(chalk_ir::FnPointer {
num_binders: 0,
abi: (),
safety: chalk_ir::Safety::Safe,
variadic: is_varargs,
substitution,
})
.intern(&Interner)
}
_ => {
let name = apply_ty.ctor.to_chalk(db);
@ -118,7 +123,12 @@ fn from_chalk(db: &dyn HirDatabase, chalk: chalk_ir::Ty<Interner>) -> Self {
let parameters = from_chalk(db, opaque_ty.substitution);
Ty::Opaque(OpaqueTy { opaque_ty_id: impl_trait_id, parameters })
}
chalk_ir::TyData::Function(chalk_ir::Fn { num_binders, substitution }) => {
chalk_ir::TyData::Function(chalk_ir::FnPointer {
num_binders,
variadic,
substitution,
..
}) => {
assert_eq!(num_binders, 0);
let parameters: Substs = from_chalk(
db,
@ -127,7 +137,7 @@ fn from_chalk(db: &dyn HirDatabase, chalk: chalk_ir::Ty<Interner>) -> Self {
Ty::Apply(ApplicationTy {
ctor: TypeCtor::FnPtr {
num_args: (parameters.len() - 1) as u16,
is_varargs: false,
is_varargs: variadic,
},
parameters,
})