]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_typeck/src/astconv/generics.rs
implement nits
[rust.git] / compiler / rustc_typeck / src / astconv / generics.rs
index a877dfcfcb753d587eb9ebe68468bdc71516264d..3bfb2d3f1b0f958173bed32d9d9bd3914d1e48c2 100644 (file)
@@ -548,14 +548,18 @@ pub(crate) fn check_impl_trait(
         generics: &ty::Generics,
     ) -> bool {
         let explicit = !seg.infer_args;
-        let impl_trait = generics.params.iter().any(|param| match param.kind {
-            ty::GenericParamDefKind::Type {
-                synthetic:
-                    Some(hir::SyntheticTyParamKind::ImplTrait | hir::SyntheticTyParamKind::Rustc),
-                ..
-            } => true,
-            _ => false,
-        });
+        let impl_trait =
+            generics.params.iter().any(|param| match param.kind {
+                ty::GenericParamDefKind::Type {
+                    synthetic:
+                        Some(
+                            hir::SyntheticTyParamKind::ImplTrait
+                            | hir::SyntheticTyParamKind::FromAttr,
+                        ),
+                    ..
+                } => true,
+                _ => false,
+            });
 
         if explicit && impl_trait {
             let spans = seg