Add TyCtxt::is_fn_trait

This commit is contained in:
Maybe Waffle
2022-11-22 18:31:23 +00:00
parent d0c7ed3bea
commit 4b6e1d1c5f
6 changed files with 16 additions and 11 deletions

View File

@@ -489,7 +489,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
candidates: &mut SelectionCandidateSet<'tcx>,
) {
// We provide impl of all fn traits for fn pointers.
if self.tcx().fn_trait_kind_from_def_id(obligation.predicate.def_id()).is_none() {
if !self.tcx().is_fn_trait(obligation.predicate.def_id()) {
return;
}