Update src/librustdoc/passes/collect_trait_impls.rs

Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
This commit is contained in:
Michael Howell 2022-06-01 08:40:19 -07:00
parent f5ac93b94b
commit 57450c637c

View File

@ -101,9 +101,11 @@
// 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,
}