Get TyCtxt from self instead of passing as argument in AutoTraitFinder

methods
This commit is contained in:
Noam Koren 2021-02-27 19:13:10 +02:00
parent 5233edcf1c
commit 854fffde5d
2 changed files with 14 additions and 17 deletions

View file

@ -77,7 +77,7 @@ impl<'tcx> AutoTraitFinder<'tcx> {
ty: Ty<'tcx>,
orig_env: ty::ParamEnv<'tcx>,
trait_did: DefId,
mut auto_trait_callback: impl FnMut(&InferCtxt<'_, 'tcx>, AutoTraitInfo<'tcx>) -> A,
mut auto_trait_callback: impl FnMut(AutoTraitInfo<'tcx>) -> A,
) -> AutoTraitResult<A> {
let tcx = self.tcx;
@ -211,7 +211,7 @@ impl<'tcx> AutoTraitFinder<'tcx> {
let info = AutoTraitInfo { full_user_env, region_data, vid_to_region };
AutoTraitResult::PositiveImpl(auto_trait_callback(&infcx, info))
AutoTraitResult::PositiveImpl(auto_trait_callback(info))
})
}
}