Use TyCtxt::is_fn_trait
is a couple more places
This commit is contained in:
parent
ea447924ce
commit
5ba0056346
2 changed files with 2 additions and 6 deletions
|
@ -1764,8 +1764,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
|
|||
.enumerate()
|
||||
.find(|(other_idx, (pred, _))| match pred.kind().skip_binder() {
|
||||
ty::PredicateKind::Clause(ty::Clause::Trait(trait_pred))
|
||||
if self.tcx.fn_trait_kind_from_def_id(trait_pred.def_id())
|
||||
.is_some()
|
||||
if self.tcx.is_fn_trait(trait_pred.def_id())
|
||||
&& other_idx != idx
|
||||
// Make sure that the self type matches
|
||||
// (i.e. constraining this closure)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue