Don't follow raw pointer derefs for method receiver type candidates

This commit is contained in:
Alex Kirszenberg 2023-07-19 19:39:00 +02:00
parent 3759c41d3c
commit 5187533495
2 changed files with 22 additions and 1 deletions

View file

@ -1504,7 +1504,7 @@ fn autoderef_method_receiver(
ty: Ty,
) -> Vec<(Canonical<Ty>, ReceiverAdjustments)> {
let mut deref_chain: Vec<_> = Vec::new();
let mut autoderef = autoderef::Autoderef::new(table, ty, true);
let mut autoderef = autoderef::Autoderef::new(table, ty, false);
while let Some((ty, derefs)) = autoderef.next() {
deref_chain.push((
autoderef.table.canonicalize(ty).value,