Skip to content

Commit 4c56758

Browse files
committed
Update callee.rs
1 parent 827a0d6 commit 4c56758

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

compiler/rustc_hir_typeck/src/callee.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
224224
//
225225
// The simplest fix by far is to just ignore this case and deref again,
226226
// so we wind up with `FnMut::call_mut(&mut *f, ())`.
227-
ty::Ref(..) if autoderef.step_count() == 0 => {
228-
return None;
227+
ty::Ref(_, deref_ty, _) if autoderef.step_count() == 0 => {
228+
match deref_ty.kind() {
229+
ty::Adt(..) => {},
230+
_ => {return None}
231+
}
229232
}
230233

231234
ty::Error(_) => {

0 commit comments

Comments
 (0)