File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed
compiler/rustc_trait_selection/src/traits Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -47,11 +47,11 @@ pub fn expand_trait_aliases<'tcx>(
4747 queue. extend (
4848 tcx. explicit_super_predicates_of ( trait_pred. def_id ( ) )
4949 . iter_identity_copied ( )
50- . map ( |( clause , span) | {
50+ . map ( |( super_clause , span) | {
5151 let mut spans = spans. clone ( ) ;
5252 spans. push ( span) ;
5353 (
54- clause . instantiate_supertrait (
54+ super_clause . instantiate_supertrait (
5555 tcx,
5656 clause. kind ( ) . rebind ( trait_pred. trait_ref ) ,
5757 ) ,
Original file line number Diff line number Diff line change 1+ // Make sure we are using the right binder vars when expanding
2+ // `for<'a> Foo<'a>` to `for<'a> Bar<'a>`.
3+
4+ //@ check-pass
5+
6+ #![ feature( trait_alias) ]
7+
8+ trait Bar < ' a > { }
9+
10+ trait Foo < ' a > = Bar < ' a > ;
11+
12+ fn test2 ( _: & ( impl for < ' a > Foo < ' a > + ?Sized ) ) { }
13+
14+ fn test ( x : & dyn for < ' a > Foo < ' a > ) {
15+ test2 ( x) ;
16+ }
17+
18+ fn main ( ) { }
You can’t perform that action at this time.
0 commit comments