File tree 2 files changed +20
-2
lines changed
compiler/rustc_trait_selection/src/traits
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>(
47
47
queue. extend (
48
48
tcx. explicit_super_predicates_of ( trait_pred. def_id ( ) )
49
49
. iter_identity_copied ( )
50
- . map ( |( clause , span) | {
50
+ . map ( |( super_clause , span) | {
51
51
let mut spans = spans. clone ( ) ;
52
52
spans. push ( span) ;
53
53
(
54
- clause . instantiate_supertrait (
54
+ super_clause . instantiate_supertrait (
55
55
tcx,
56
56
clause. kind ( ) . rebind ( trait_pred. trait_ref ) ,
57
57
) ,
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