@@ -1195,6 +1195,13 @@ impl<'a> ModuleData<'a> {
1195
1195
}
1196
1196
}
1197
1197
1198
+ fn is_trait_alias ( & self ) -> bool {
1199
+ match self . kind {
1200
+ ModuleKind :: Def ( Def :: TraitAlias ( _) , _) => true ,
1201
+ _ => false ,
1202
+ }
1203
+ }
1204
+
1198
1205
fn nearest_item_scope ( & ' a self ) -> Module < ' a > {
1199
1206
if self . is_trait ( ) { self . parent . unwrap ( ) } else { self }
1200
1207
}
@@ -4369,8 +4376,10 @@ impl<'a> Resolver<'a> {
4369
4376
let mut collected_traits = Vec :: new ( ) ;
4370
4377
module. for_each_child ( |name, ns, binding| {
4371
4378
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
+ _ => ( ) ,
4374
4383
}
4375
4384
} ) ;
4376
4385
* traits = Some ( collected_traits. into_boxed_slice ( ) ) ;
@@ -4834,6 +4843,7 @@ impl<'a> Resolver<'a> {
4834
4843
let container = match parent. kind {
4835
4844
ModuleKind :: Def ( Def :: Mod ( _) , _) => "module" ,
4836
4845
ModuleKind :: Def ( Def :: Trait ( _) , _) => "trait" ,
4846
+ ModuleKind :: Def ( Def :: TraitAlias ( _) , _) => "trait alias" ,
4837
4847
ModuleKind :: Block ( ..) => "block" ,
4838
4848
_ => "enum" ,
4839
4849
} ;
@@ -4862,6 +4872,7 @@ impl<'a> Resolver<'a> {
4862
4872
( TypeNS , _) if old_binding. is_extern_crate ( ) => "extern crate" ,
4863
4873
( TypeNS , Some ( module) ) if module. is_normal ( ) => "module" ,
4864
4874
( TypeNS , Some ( module) ) if module. is_trait ( ) => "trait" ,
4875
+ ( TypeNS , Some ( module) ) if module. is_trait_alias ( ) => "trait alias" ,
4865
4876
( TypeNS , _) => "type" ,
4866
4877
} ;
4867
4878
0 commit comments