diff options
| author | Yuki Okushi <yuki.okushi@huawei.com> | 2021-06-16 06:36:15 +0900 |
|---|---|---|
| committer | Yuki Okushi <yuki.okushi@huawei.com> | 2021-08-03 20:08:16 +0900 |
| commit | b84d08d1e46df54ee3a2729296697e0b1ecc6097 (patch) | |
| tree | b47776551788a4d1d71cbb4c570df8614dad8c7d | |
| parent | 14e92d71160348d22ece30624b0843178cee23f1 (diff) | |
| download | rust-b84d08d1e46df54ee3a2729296697e0b1ecc6097.tar.gz rust-b84d08d1e46df54ee3a2729296697e0b1ecc6097.zip | |
Use `has_impl_trait` where possible
| -rw-r--r-- | compiler/rustc_typeck/src/astconv/generics.rs | 12 |
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 |
