parent
05d1652337
commit
65fc7058d8
5 changed files with 106 additions and 0 deletions
|
@ -40,7 +40,19 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
Err(..) => return false,
|
||||
};
|
||||
|
||||
// This conditional prevents us from asking to call errors and unresolved types.
|
||||
// It might seem that we can use `predicate_must_hold_modulo_regions`,
|
||||
// but since a Dummy binder is used to fill in the FnOnce trait's arguments,
|
||||
// type resolution always gives a "maybe" here.
|
||||
if self.autoderef(span, ty).any(|(ty, _)| {
|
||||
info!("check deref {:?} error", ty);
|
||||
matches!(ty.kind(), ty::Error(_) | ty::Infer(_))
|
||||
}) {
|
||||
return false;
|
||||
}
|
||||
|
||||
self.autoderef(span, ty).any(|(ty, _)| {
|
||||
info!("check deref {:?} impl FnOnce", ty);
|
||||
self.probe(|_| {
|
||||
let fn_once_substs = tcx.mk_substs_trait(
|
||||
ty,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue