@@ -1195,6 +1195,13 @@ impl<'a> ModuleData<'a> {
11951195 }
11961196 }
11971197
1198+ fn is_trait_alias ( & self ) -> bool {
1199+ match self . kind {
1200+ ModuleKind :: Def ( Def :: TraitAlias ( _) , _) => true ,
1201+ _ => false ,
1202+ }
1203+ }
1204+
11981205 fn nearest_item_scope ( & ' a self ) -> Module < ' a > {
11991206 if self . is_trait ( ) { self . parent . unwrap ( ) } else { self }
12001207 }
@@ -4369,8 +4376,10 @@ impl<'a> Resolver<'a> {
43694376 let mut collected_traits = Vec :: new ( ) ;
43704377 module. for_each_child ( |name, ns, binding| {
43714378 if ns != TypeNS { return }
4372- if let Def :: Trait ( _) = binding. def ( ) {
4373- collected_traits. push ( ( name, binding) ) ;
4379+ match binding. def ( ) {
4380+ Def :: Trait ( _) |
4381+ Def :: TraitAlias ( _) => collected_traits. push ( ( name, binding) ) ,
4382+ _ => ( ) ,
43744383 }
43754384 } ) ;
43764385 * traits = Some ( collected_traits. into_boxed_slice ( ) ) ;
@@ -4834,6 +4843,7 @@ impl<'a> Resolver<'a> {
48344843 let container = match parent. kind {
48354844 ModuleKind :: Def ( Def :: Mod ( _) , _) => "module" ,
48364845 ModuleKind :: Def ( Def :: Trait ( _) , _) => "trait" ,
4846+ ModuleKind :: Def ( Def :: TraitAlias ( _) , _) => "trait alias" ,
48374847 ModuleKind :: Block ( ..) => "block" ,
48384848 _ => "enum" ,
48394849 } ;
@@ -4862,6 +4872,7 @@ impl<'a> Resolver<'a> {
48624872 ( TypeNS , _) if old_binding. is_extern_crate ( ) => "extern crate" ,
48634873 ( TypeNS , Some ( module) ) if module. is_normal ( ) => "module" ,
48644874 ( TypeNS , Some ( module) ) if module. is_trait ( ) => "trait" ,
4875+ ( TypeNS , Some ( module) ) if module. is_trait_alias ( ) => "trait alias" ,
48654876 ( TypeNS , _) => "type" ,
48664877 } ;
48674878
0 commit comments