8
8
// option. This file may not be copied, modified, or distributed
9
9
// except according to those terms.
10
10
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`.
17
21
//
18
22
// compile-flags:-Zno-leak-check
19
23
@@ -28,10 +32,6 @@ fn make_cell_aa() -> Cell<for<'a> fn(&'a u32, &'a u32)> {
28
32
fn aa_eq_ab ( ) {
29
33
let a: Cell < for <' a , ' b > fn ( & ' a u32 , & ' b u32 ) > = make_cell_aa ( ) ;
30
34
//~^ 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`
35
35
drop ( a) ;
36
36
}
37
37
0 commit comments