88// option. This file may not be copied, modified, or distributed
99// except according to those terms.
1010
11- // must-compile-successfully
1211#![ allow( dead_code, non_camel_case_types) ]
1312
1413use std:: rc:: Rc ;
1514
1615type SVec < T : Send +Send > = Vec < T > ;
17- //~^ WARN bounds on generic type parameters are ignored in type aliases
16+ //~^ WARN bounds on generic parameters are ignored in type aliases
1817type VVec < ' b , ' a : ' b +' b > = Vec < & ' a i32 > ;
19- //~^ WARN bounds on generic lifetime parameters are ignored in type aliases
18+ //~^ WARN bounds on generic parameters are ignored in type aliases
2019type WVec < ' b , T : ' b +' b > = Vec < T > ;
21- //~^ WARN bounds on generic type parameters are ignored in type aliases
20+ //~^ WARN bounds on generic parameters are ignored in type aliases
2221type W2Vec < ' b , T > where T : ' b , T : ' b = Vec < T > ;
2322//~^ WARN where clauses are ignored in type aliases
2423
@@ -40,16 +39,16 @@ fn foo<'a>(y: &'a i32) {
4039fn bar1 < ' a , ' b > (
4140 x : & ' a i32 ,
4241 y : & ' b i32 ,
43- f : for <' xa , ' xb : ' xa> fn ( & ' xa i32 , & ' xb i32 ) -> & ' xa i32 )
44- //~^ WARN bounds on generic lifetime parameters are ignored in higher-ranked function types
42+ f : for <' xa , ' xb : ' xa+ ' xa > fn ( & ' xa i32 , & ' xb i32 ) -> & ' xa i32 )
43+ //~^ ERROR lifetime bounds cannot be used in this context
4544{
4645 // If the bound in f's type would matter, the call below would (have to)
4746 // be rejected.
4847 f ( x, y) ;
4948}
5049
5150fn bar2 < ' a , ' b , F : for < ' xa , ' xb : ' xa > Fn ( & ' xa i32 , & ' xb i32 ) -> & ' xa i32 > (
52- //~^ WARN bounds on generic lifetime parameters are ignored in higher-ranked trait bounds
51+ //~^ ERROR lifetime bounds cannot be used in this context
5352 x : & ' a i32 ,
5453 y : & ' b i32 ,
5554 f : F )
@@ -64,7 +63,7 @@ fn bar3<'a, 'b, F>(
6463 y : & ' b i32 ,
6564 f : F )
6665 where F : for < ' xa , ' xb : ' xa > Fn ( & ' xa i32 , & ' xb i32 ) -> & ' xa i32
67- //~^ WARN bounds on generic lifetime parameters are ignored in higher-ranked trait bounds
66+ //~^ ERROR lifetime bounds cannot be used in this context
6867{
6968 // If the bound in f's type would matter, the call below would (have to)
7069 // be rejected.
@@ -76,29 +75,29 @@ fn bar4<'a, 'b, F>(
7675 y : & ' b i32 ,
7776 f : F )
7877 where for < ' xa , ' xb : ' xa > F : Fn ( & ' xa i32 , & ' xb i32 ) -> & ' xa i32
79- //~^ WARN bounds on generic lifetime parameters are ignored in higher-ranked trait bounds
78+ //~^ ERROR lifetime bounds cannot be used in this context
8079{
8180 // If the bound in f's type would matter, the call below would (have to)
8281 // be rejected.
8382 f ( x, y) ;
8483}
8584
8685struct S1 < F : for < ' xa , ' xb : ' xa > Fn ( & ' xa i32 , & ' xb i32 ) -> & ' xa i32 > ( F ) ;
87- //~^ WARN bounds on generic lifetime parameters are ignored in higher-ranked trait bounds
86+ //~^ ERROR lifetime bounds cannot be used in this context
8887struct S2 < F > ( F ) where F : for < ' xa , ' xb : ' xa > Fn ( & ' xa i32 , & ' xb i32 ) -> & ' xa i32 ;
89- //~^ WARN bounds on generic lifetime parameters are ignored in higher-ranked trait bounds
88+ //~^ ERROR lifetime bounds cannot be used in this context
9089struct S3 < F > ( F ) where for < ' xa , ' xb : ' xa > F : Fn ( & ' xa i32 , & ' xb i32 ) -> & ' xa i32 ;
91- //~^ WARN bounds on generic lifetime parameters are ignored in higher-ranked trait bounds
90+ //~^ ERROR lifetime bounds cannot be used in this context
9291
9392struct S_fnty ( for <' xa , ' xb : ' xa> fn ( & ' xa i32 , & ' xb i32 ) -> & ' xa i32 ) ;
94- //~^ WARN bounds on generic lifetime parameters are ignored in higher-ranked function types
93+ //~^ ERROR lifetime bounds cannot be used in this context
9594
9695type T1 = Box < for <' xa , ' xb : ' xa> Fn ( & ' xa i32 , & ' xb i32 ) -> & ' xa i32 > ;
97- //~^ WARN bounds on generic lifetime parameters are ignored in higher-ranked trait bounds
96+ //~^ ERROR lifetime bounds cannot be used in this context
9897
9998fn main ( ) {
10099 let _ : Option < for <' xa , ' xb : ' xa> fn ( & ' xa i32 , & ' xb i32 ) -> & ' xa i32 > = None ;
101- //~^ WARN bounds on generic lifetime parameters are ignored in higher-ranked function types
100+ //~^ ERROR lifetime bounds cannot be used in this context
102101 let _ : Option < Box < for <' xa , ' xb : ' xa> Fn ( & ' xa i32 , & ' xb i32 ) -> & ' xa i32 > > = None ;
103- //~^ WARN bounds on generic lifetime parameters are ignored in higher-ranked trait bounds
102+ //~^ ERROR lifetime bounds cannot be used in this context
104103}
0 commit comments