Skip to content

Commit 797cdb0

Browse files
committed
Bump chalk
1 parent fa64817 commit 797cdb0

File tree

4 files changed

+35
-28
lines changed

4 files changed

+35
-28
lines changed

Cargo.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/ra_hir_ty/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ test_utils = { path = "../test_utils" }
2828

2929
scoped-tls = "1"
3030

31-
chalk-solve = { version = "0.18.0" }
32-
chalk-ir = { version = "0.18.0" }
33-
chalk-recursive = { version = "0.18.0" }
31+
chalk-solve = { version = "0.19.0" }
32+
chalk-ir = { version = "0.19.0" }
33+
chalk-recursive = { version = "0.19.0" }
3434

3535
[dev-dependencies]
3636
expect = { path = "../expect" }

crates/ra_hir_ty/src/traits/chalk.rs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ impl<'a> chalk_solve::RustIrDatabase<Interner> for ChalkContext<'a> {
183183
.collect(),
184184
1,
185185
),
186+
where_clauses: make_binders(vec![], 0),
186187
};
187188
let num_vars = datas.num_binders;
188189
Arc::new(OpaqueTyDatum { opaque_ty_id: id, bound: make_binders(bound, num_vars) })
@@ -193,15 +194,6 @@ impl<'a> chalk_solve::RustIrDatabase<Interner> for ChalkContext<'a> {
193194
Ty::Unknown.to_chalk(self.db)
194195
}
195196

196-
fn force_impl_for(
197-
&self,
198-
_well_known: rust_ir::WellKnownTrait,
199-
_ty: &chalk_ir::TyData<Interner>,
200-
) -> Option<bool> {
201-
// this method is mostly for rustc
202-
None
203-
}
204-
205197
fn is_object_safe(&self, _trait_id: chalk_ir::TraitId<Interner>) -> bool {
206198
// FIXME: implement actual object safety
207199
true
@@ -547,8 +539,13 @@ pub(crate) fn fn_def_datum_query(
547539
),
548540
where_clauses,
549541
};
550-
let datum =
551-
FnDefDatum { id: fn_def_id, binders: make_binders(bound, sig.num_binders), abi: () };
542+
let datum = FnDefDatum {
543+
id: fn_def_id,
544+
abi: (),
545+
safety: chalk_ir::Safety::Safe,
546+
variadic: sig.value.is_varargs,
547+
binders: make_binders(bound, sig.num_binders),
548+
};
552549
Arc::new(datum)
553550
}
554551

crates/ra_hir_ty/src/traits/chalk/mapping.rs

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,16 @@ impl ToChalk for Ty {
3030
Ty::Apply(apply_ty) => match apply_ty.ctor {
3131
TypeCtor::Ref(m) => ref_to_chalk(db, m, apply_ty.parameters),
3232
TypeCtor::Array => array_to_chalk(db, apply_ty.parameters),
33-
TypeCtor::FnPtr { num_args: _, is_varargs: _ } => {
34-
// FIXME: handle is_varargs
33+
TypeCtor::FnPtr { num_args: _, is_varargs } => {
3534
let substitution = apply_ty.parameters.to_chalk(db).shifted_in(&Interner);
36-
chalk_ir::TyData::Function(chalk_ir::Fn { num_binders: 0, substitution })
37-
.intern(&Interner)
35+
chalk_ir::TyData::Function(chalk_ir::FnPointer {
36+
num_binders: 0,
37+
abi: (),
38+
safety: chalk_ir::Safety::Safe,
39+
variadic: is_varargs,
40+
substitution,
41+
})
42+
.intern(&Interner)
3843
}
3944
_ => {
4045
let name = apply_ty.ctor.to_chalk(db);
@@ -118,7 +123,12 @@ impl ToChalk for Ty {
118123
let parameters = from_chalk(db, opaque_ty.substitution);
119124
Ty::Opaque(OpaqueTy { opaque_ty_id: impl_trait_id, parameters })
120125
}
121-
chalk_ir::TyData::Function(chalk_ir::Fn { num_binders, substitution }) => {
126+
chalk_ir::TyData::Function(chalk_ir::FnPointer {
127+
num_binders,
128+
variadic,
129+
substitution,
130+
..
131+
}) => {
122132
assert_eq!(num_binders, 0);
123133
let parameters: Substs = from_chalk(
124134
db,
@@ -127,7 +137,7 @@ impl ToChalk for Ty {
127137
Ty::Apply(ApplicationTy {
128138
ctor: TypeCtor::FnPtr {
129139
num_args: (parameters.len() - 1) as u16,
130-
is_varargs: false,
140+
is_varargs: variadic,
131141
},
132142
parameters,
133143
})

0 commit comments

Comments
 (0)