88// option. This file may not be copied, modified, or distributed
99// except according to those terms.
1010
11- // Test an interesting corner case: a fn that takes two arguments that
12- // are references with the same lifetime is in fact equivalent to a fn
13- // that takes two references with distinct lifetimes. This is true
14- // because the two functions can call one another -- effectively, the
15- // single lifetime `'a` is just inferred to be the intersection of the
16- // two distinct lifetimes.
11+ // Test an interesting corner case that ought to be legal (though the
12+ // current code actually gets it wrong, see below): a fn that takes
13+ // two arguments that are references with the same lifetime is in fact
14+ // equivalent to a fn that takes two references with distinct
15+ // lifetimes. This is true because the two functions can call one
16+ // another -- effectively, the single lifetime `'a` is just inferred
17+ // to be the intersection of the two distinct lifetimes.
18+ //
19+ // FIXME: However, we currently reject this example with an error,
20+ // because of how we handle binders and equality in `relate_tys`.
1721//
1822// compile-flags:-Zno-leak-check
1923
@@ -28,10 +32,6 @@ fn make_cell_aa() -> Cell<for<'a> fn(&'a u32, &'a u32)> {
2832fn aa_eq_ab ( ) {
2933 let a: Cell < for <' a , ' b > fn ( & ' a u32 , & ' b u32 ) > = make_cell_aa ( ) ;
3034 //~^ ERROR higher-ranked subtype error
31- //
32- // FIXME -- this .. arguably ought to be accepted. However, the
33- // current leak check also rejects this example, and it's kind of
34- // a pain to support it. There are some comments in `relate_tys`
3535 drop ( a) ;
3636}
3737
0 commit comments