File tree Expand file tree Collapse file tree 4 files changed +29
-2
lines changed Expand file tree Collapse file tree 4 files changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -541,15 +541,17 @@ impl<'hir> Map<'hir> {
541541
542542 pub fn ty_param_owner ( & self , id : HirId ) -> HirId {
543543 match self . get_by_hir_id ( id) {
544- Node :: Item ( & Item { node : ItemKind :: Trait ( ..) , .. } ) => id,
544+ Node :: Item ( & Item { node : ItemKind :: Trait ( ..) , .. } ) |
545+ Node :: Item ( & Item { node : ItemKind :: TraitAlias ( ..) , .. } ) => id,
545546 Node :: GenericParam ( _) => self . get_parent_node_by_hir_id ( id) ,
546547 _ => bug ! ( "ty_param_owner: {} not a type parameter" , self . hir_to_string( id) )
547548 }
548549 }
549550
550551 pub fn ty_param_name ( & self , id : HirId ) -> Name {
551552 match self . get_by_hir_id ( id) {
552- Node :: Item ( & Item { node : ItemKind :: Trait ( ..) , .. } ) => keywords:: SelfUpper . name ( ) ,
553+ Node :: Item ( & Item { node : ItemKind :: Trait ( ..) , .. } ) |
554+ Node :: Item ( & Item { node : ItemKind :: TraitAlias ( ..) , .. } ) => keywords:: SelfUpper . name ( ) ,
553555 Node :: GenericParam ( param) => param. name . ident ( ) . name ,
554556 _ => bug ! ( "ty_param_name: {} not a type parameter" , self . hir_to_string( id) ) ,
555557 }
Original file line number Diff line number Diff line change 1+ #![ feature( trait_alias) ]
2+
3+ trait Svc < Req > { type Res ; }
4+
5+ trait MkSvc < Target , Req > = Svc < Target > where Self :: Res : Svc < Req > ;
6+ //~^ ERROR associated type `Res` not found for `Self`
7+
8+ fn main ( ) { }
Original file line number Diff line number Diff line change 1+ error[E0220]: associated type `Res` not found for `Self`
2+ --> $DIR/issue-59029-1.rs:5:46
3+ |
4+ LL | trait MkSvc<Target, Req> = Svc<Target> where Self::Res: Svc<Req>;
5+ | ^^^^^^^^^ associated type `Res` not found
6+
7+ error: aborting due to previous error
8+
9+ For more information about this error, try `rustc --explain E0220`.
Original file line number Diff line number Diff line change 1+ // run-pass
2+ #![ feature( trait_alias) ]
3+
4+ trait Svc < Req > { type Res ; }
5+
6+ trait MkSvc < Target , Req > = Svc < Target > where <Self as Svc < Target > >:: Res : Svc < Req > ;
7+
8+ fn main ( ) { }
You can’t perform that action at this time.
0 commit comments