From 97b4b7f72b72965f4cde19761064821e2b0dc435 Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Fri, 9 Feb 2024 20:25:18 +0000 Subject: [PATCH] use `impl Trait` argument instead of generic param for simplicity --- compiler/rustc_hir_analysis/src/coherence/builtin.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/compiler/rustc_hir_analysis/src/coherence/builtin.rs b/compiler/rustc_hir_analysis/src/coherence/builtin.rs index fe1a9f2eebd6..fc911ecdad2f 100644 --- a/compiler/rustc_hir_analysis/src/coherence/builtin.rs +++ b/compiler/rustc_hir_analysis/src/coherence/builtin.rs @@ -53,10 +53,11 @@ struct Checker<'tcx> { } impl<'tcx> Checker<'tcx> { - fn check(&self, trait_def_id: Option, f: F) -> Result<(), ErrorGuaranteed> - where - F: FnOnce(TyCtxt<'tcx>, LocalDefId) -> Result<(), ErrorGuaranteed>, - { + fn check( + &self, + trait_def_id: Option, + f: impl FnOnce(TyCtxt<'tcx>, LocalDefId) -> Result<(), ErrorGuaranteed>, + ) -> Result<(), ErrorGuaranteed> { if Some(self.trait_def_id) == trait_def_id { f(self.tcx, self.impl_def_id) } else { Ok(()) } } }