@@ -5,7 +5,7 @@ use rustdoc_types::{GenericParamDefKind, ItemEnum, Type as RustdocType};
55
66use crate :: language:: { PathType , Type } ;
77use crate :: rustdoc:: { Crate , CrateCollection } ;
8- use rustdoc_resolver:: { GenericBindings , resolve_type} ;
8+ use rustdoc_resolver:: { GenericBindings , TypeAliasResolution , resolve_type} ;
99
1010/// It returns an error if `type_` doesn't implement the specified trait.
1111///
@@ -81,7 +81,7 @@ pub(crate) fn implements_trait(
8181 // We start by checking if there is a trait implementation for this type in the crate where the
8282 // type was defined.
8383 match type_ {
84- Type :: Path ( our_path_type) => {
84+ Type :: Path ( our_path_type) | Type :: TypeAlias ( our_path_type ) => {
8585 let type_definition_crate =
8686 get_crate_by_package_id ( krate_collection, & our_path_type. package_id ) ?;
8787 let type_id = type_definition_crate
@@ -102,6 +102,7 @@ pub(crate) fn implements_trait(
102102 & our_path_type. package_id ,
103103 krate_collection,
104104 & generic_bindings,
105+ TypeAliasResolution :: ResolveThrough ,
105106 ) ?;
106107 generic_bindings
107108 . types
@@ -122,6 +123,7 @@ pub(crate) fn implements_trait(
122123 & our_path_type. package_id ,
123124 krate_collection,
124125 & generic_bindings,
126+ TypeAliasResolution :: ResolveThrough ,
125127 ) ?;
126128 if implements_trait ( krate_collection, & type_, expected_trait) ? {
127129 return Ok ( true ) ;
0 commit comments