]> git.lizzy.rs Git - rust.git/commitdiff
Update src/librustdoc/passes/collect_trait_impls.rs
authorMichael Howell <michael@notriddle.com>
Wed, 1 Jun 2022 15:40:19 +0000 (08:40 -0700)
committerMichael Howell <michael@notriddle.com>
Wed, 1 Jun 2022 16:55:33 +0000 (09:55 -0700)
Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
src/librustdoc/passes/collect_trait_impls.rs

index 0dc1c9d9663130ea46095484d6c4eaeb792b5b62..a042a68a2a1bcce866f1b5ef6d32e1962c5b8444 100644 (file)
                     // form that is valid for use in type inference.
                     let ty = tcx.type_of(def_id);
                     match ty.kind() {
-                        ty::Slice(ty) => matches!(ty.kind(), ty::Param(..)),
-                        ty::Ref(_region, ty, _mutbl) => matches!(ty.kind(), ty::Param(..)),
-                        ty::RawPtr(ty::TypeAndMut { ty, .. }) => matches!(ty.kind(), ty::Param(..)),
+                        ty::Slice(ty)
+                        | ty::Ref(_, ty, _)
+                        | ty::RawPtr(ty::TypeAndMut { ty, .. }) => {
+                            matches!(ty.kind(), ty::Param(..))
+                        }
                         ty::Tuple(tys) => tys.iter().all(|ty| matches!(ty.kind(), ty::Param(..))),
                         _ => true,
                     }