From e260afc3ba1eeeb3bd006fb72474365698b88c47 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Wed, 15 Jun 2022 06:14:48 -0400 Subject: [PATCH] simplify argument type for to take param-ty we don't really take other things --- compiler/rustc_infer/src/infer/outlives/verify.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/compiler/rustc_infer/src/infer/outlives/verify.rs b/compiler/rustc_infer/src/infer/outlives/verify.rs index 17681338a63..bc6fb5ebf7c 100644 --- a/compiler/rustc_infer/src/infer/outlives/verify.rs +++ b/compiler/rustc_infer/src/infer/outlives/verify.rs @@ -83,10 +83,8 @@ fn param_bound(&self, param_ty: ty::ParamTy) -> VerifyBound<'tcx> { // Start with anything like `T: 'a` we can scrape from the // environment - let param_bounds = self - .declared_generic_bounds_from_env(GenericKind::Param(param_ty)) - .into_iter() - .map(|outlives| outlives.1); + let param_bounds = + self.declared_generic_bounds_from_env(param_ty).into_iter().map(|outlives| outlives.1); // Add in the default bound of fn body that applies to all in // scope type parameters: @@ -218,9 +216,9 @@ fn recursive_bound( /// bounds, but all the bounds it returns can be relied upon. fn declared_generic_bounds_from_env( &self, - generic: GenericKind<'tcx>, + param_ty: ty::ParamTy, ) -> Vec, ty::Region<'tcx>>> { - let generic_ty = generic.to_ty(self.tcx); + let generic_ty = param_ty.to_ty(self.tcx); self.declared_generic_bounds_from_env_with_compare_fn(|ty| ty == generic_ty) }