about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYuki Okushi <yuki.okushi@huawei.com>2021-06-16 06:36:15 +0900
committerYuki Okushi <yuki.okushi@huawei.com>2021-08-03 20:08:16 +0900
commitb84d08d1e46df54ee3a2729296697e0b1ecc6097 (patch)
treeb47776551788a4d1d71cbb4c570df8614dad8c7d
parent14e92d71160348d22ece30624b0843178cee23f1 (diff)
downloadrust-b84d08d1e46df54ee3a2729296697e0b1ecc6097.tar.gz
rust-b84d08d1e46df54ee3a2729296697e0b1ecc6097.zip
Use `has_impl_trait` where possible
-rw-r--r--compiler/rustc_typeck/src/astconv/generics.rs12
1 files changed, 1 insertions, 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