From b84d08d1e46df54ee3a2729296697e0b1ecc6097 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Wed, 16 Jun 2021 06:36:15 +0900 Subject: [PATCH] Use `has_impl_trait` where possible --- compiler/rustc_typeck/src/astconv/generics.rs | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/compiler/rustc_typeck/src/astconv/generics.rs b/compiler/rustc_typeck/src/astconv/generics.rs index 9e700d9e8d8..0cfdde26c2b 100644 --- a/compiler/rustc_typeck/src/astconv/generics.rs +++ b/compiler/rustc_typeck/src/astconv/generics.rs @@ -647,17 +647,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o { return false; } - let impl_trait = generics.params.iter().any(|param| { - matches!( - param.kind, - ty::GenericParamDefKind::Type { - synthetic: Some( - hir::SyntheticTyParamKind::ImplTrait | hir::SyntheticTyParamKind::FromAttr, - ), - .. - } - ) - }); + let impl_trait = generics.has_impl_trait(); if impl_trait { let spans = seg