Re-use InferenceTable by snapshotting in method resolution

This commit is contained in:
Lukas Wirth 2024-03-04 15:56:34 +01:00
parent 2898c4217d
commit 593156a357
4 changed files with 48 additions and 56 deletions

View file

@ -657,7 +657,7 @@ impl InferenceContext<'_> {
);
}
}
if let Some(derefed) = builtin_deref(&mut self.table, &inner_ty, true) {
if let Some(derefed) = builtin_deref(self.table.db, &inner_ty, true) {
self.resolve_ty_shallow(derefed)
} else {
deref_by_trait(&mut self.table, inner_ty)